[LLVMdev] bug or expected behaviour?

Carl Norum carl at lytro.com
Tue Jun 4 22:10:00 PDT 2013


On Jun 4, 2013, at 5:31 PM, David Mirabito <david.mirabito at gmail.com> wrote:
> Hi Carl,
> 
> I don't know much about the specifics of any given optimisation, but if you do something like the following, you can at least see which optimisation pass is responsible. 

Thanks for the example; it's going to take me a while to figure out what the output really means, though!

> At the very least perhaps that can point to the next place to investigate. (also interesting to note Apple's shipped clang doesn't exhibit this behaviour, I had to use my own recent svn tree)

Yeah, I noticed that as well, so it's definitely a behaviour change.

> $ clang -arch arm -emit-llvm  -S -O0 example.c -o arm.bc
> $ opt -print-after-all -O1 arm.bc
> 
> I can see where the branch test is whittled down to an 'if true' and then eliminated, but cannot comment as to why this might be.

I think I see that too.  I'll have to stare at that output some more to see if it yields any insight.

-- Carl


> Cheers,
> -DavidM
> 
> On 05/06/2013, at 9:50 AM, Carl Norum <carl at lytro.com> wrote:
> 
>> 
>> On Jun 4, 2013, at 4:42 PM, Tyler Hardin <tghardin1 at catamount.wcu.edu> wrote:
>>> I was suggesting to add it to the function, like
>>> volatile void func(..);
>>> Theoretically, this would tell the compiler not to omit seemingly superfluous calls to func.
>> 
>> 'volatile' can't apply to a function, so I'm not sure what you mean.  In your example, 'volatile' modifies the 'void'.  So I think "theoretically", it doesn't do anything at all.
>> 
>> -- Carl
>> 
>> 
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 





More information about the llvm-dev mailing list