[llvm-commits] [llvm] r75571 - in /llvm/trunk: lib/Transforms/Scalar/SimplifyCFGPass.cpp test/Transforms/SimplifyCFG/2009-07-13-no-delete-asm.ll

Dale Johannesen dalej at apple.com
Tue Jul 14 10:38:36 PDT 2009


On Jul 14, 2009, at 10:28 AMPDT, Chris Lattner wrote:
>>
>> No, the gcc doc is (for once) quite clear that volatile asm's  
>> should never be deleted.  They aren't necessarily executable code,  
>> they might change the section of assembly, or define a global data  
>> object, or something like that.  I could probably be persuaded to  
>> add a check for volatile, but I don't think it's a good idea; the  
>> goal of asm handling should be to imitate gcc as much as possible  
>> (that's the only reasonable definition of how they should work,  
>> although it's probably not fully implementable in llvm), and gcc  
>> doesn't eliminate this one.
>
> You are probably thinking of a file scope asm block.  volatile asms  
> absolutely can be duplicated (thus they can't define global data)  
> and can definitely be deleted.

No, I'm thinking of volatile asms; the language on this has changed  
since my 2.95 hardcopy, and now agrees with what you say.  Perhaps  
it's time for an upgrade.

>> The original testcase, which I perhaps should not have modified,  
>> involves a load from undefined memory feeding into a volatile asm;  
>> earlier optimizations removed the load in favor of the store  
>> above.   They probably shouldn't have done that, which is a later  
>> patch.
>>
> It sounds like the problem is the earlier pass, please revert r75571.

OK.




More information about the llvm-commits mailing list