[LLVMdev] Does LLVM optimize variable to constant value in the compiling time?

Caldarale, Charles R Chuck.Caldarale at unisys.com
Fri Feb 22 13:48:51 PST 2013


> From: Robert Sandra [mailto:robert.sandra0712 at gmail.com] 
> Subject: Re: [LLVMdev] Does LLVM optimize variable to constant value in the compiling time?

> By optimization, do you mean enable the optimization whiling building llvm or 
> use optimization flag while using clang command to get the bitcode file?

The optimization when using clang.

> I use the following command to get the bitcode:

> clang -O0 -emit-llvm hello.c -c -o hello.bc

Then I would expect the output to reflect your exact C statements, with no attempt at optimization.  I think even -O1 will clean this up.

> The llvm version I am using is 3.3svn.

Always good to state the version you're using.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.





More information about the llvm-dev mailing list