[GHC] #7297: LLVM incorrectly hoisting loads

GHC cvs-ghc at haskell.org
Thu Jan 31 10:12:19 CET 2013


#7297: LLVM incorrectly hoisting loads
---------------------------------+------------------------------------------
    Reporter:  dterei            |       Owner:  dterei                     
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Milestone:  7.8.1                      
   Component:  Compiler (LLVM)   |     Version:  7.7                        
    Keywords:                    |          Os:  Unknown/Multiple           
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
  Difficulty:  Unknown           |    Testcase:  367_letnoescape            
   Blockedby:                    |    Blocking:                             
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by dterei):

 Copying some info from an email (Memory model of Cmm?) with Simon Marlow
 so I can archive it finally:

 {{{
 The best reference for this is the code I wrote to identify conflicts in
 the Cmm sinking pass, see the function 'conflicts':

 http://www.haskell.org/ghc/dist/current/docs/html/libraries/ghc-7.7.20120902/src/CmmSink.html

 But that won't tell you anything about whether reading a memory
 location can be cached or not.

 How does LLVM handle this?  I'm thinking that maybe we should have
 an explicit "volatile load" operation, that would behave like a CmmLoad
 but could not be hoisted.  It should be a CallishMachOp, because you
 presumably want to specify ordering for a volatile load with respect to
 other side-effecting operations.
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7297#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list