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

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


> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Robert Sandra
> Subject: [LLVMdev] Does LLVM optimize variable to constant value in the compiling time?

> Considering the following codes:

> int x = 21; 
> if(x > 20) { 
>    p = &C; 
> } else { 
>    p = &E; 
> }

> I looked into the bitcode that LLVM generates, it still considers the 'else' 
> branch, which will be never reached during the runtime.

What version of LLVM?  What happens if you enable optimization?

 - 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