[LLVMdev] Is this a missed (simple) optimization?

AnonW wayne.phillips at GMAIL.COM
Fri Nov 16 03:58:31 PST 2012


I think this is a missed optimization, but maybe I'm missing some significant
piece of knowledge(!) as to why this might not be optimizable :)  Test
case...
 
   int A;  // some global 
   int B;  // some global 

   void Test(int *Out) 
   { 
      *Out = A;   // Can't this be optimized away? 
      *Out = B; 
   }; 

The LLVM backend (tested 3.1 and 3.0 online demo) doesn't optimize away the
first store, even with O3 level compiling in clang.  Is there some valid
reason for this?

Any insight appreciated.  Thanks.



--
View this message in context: http://llvm.1065342.n5.nabble.com/Is-this-a-missed-simple-optimization-tp51361.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.



More information about the llvm-dev mailing list