[LLVMdev] bug or expected behaviour?

David Mirabito david.mirabito at gmail.com
Tue Jun 4 17:31:45 PDT 2013


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. 
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)

$ 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.

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