[llvm-branch-commits] [llvm-branch] r232544 - Merging r214336:

Tom Stellard thomas.stellard at amd.com
Tue Mar 17 13:42:08 PDT 2015


Author: tstellar
Date: Tue Mar 17 15:42:08 2015
New Revision: 232544

URL: http://llvm.org/viewvc/llvm-project?rev=232544&view=rev
Log:
Merging r214336:

------------------------------------------------------------------------
r214336 | rafael.espindola | 2014-07-30 17:04:00 -0400 (Wed, 30 Jul 2014) | 9 lines

SimplifyCFG: Avoid miscompilations due to removed lifetime intrinsics.

The lifetime intrinsics need some work in order to make it clear which
optimizations are or are not valid.

For now dropping this optimization avoids a miscompilation.

Patch by Björn Steinbrink.

------------------------------------------------------------------------

Modified:
    llvm/branches/release_35/lib/Transforms/Utils/SimplifyCFG.cpp
    llvm/branches/release_35/test/Transforms/SimplifyCFG/lifetime.ll

Modified: llvm/branches/release_35/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/Transforms/Utils/SimplifyCFG.cpp?rev=232544&r1=232543&r2=232544&view=diff
==============================================================================
--- llvm/branches/release_35/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/branches/release_35/lib/Transforms/Utils/SimplifyCFG.cpp Tue Mar 17 15:42:08 2015
@@ -4008,7 +4008,7 @@ bool SimplifyCFGOpt::SimplifyUncondBranc
     return true;
 
   // If the Terminator is the only non-phi instruction, simplify the block.
-  BasicBlock::iterator I = BB->getFirstNonPHIOrDbgOrLifetime();
+  BasicBlock::iterator I = BB->getFirstNonPHIOrDbg();
   if (I->isTerminator() && BB != &BB->getParent()->getEntryBlock() &&
       TryToSimplifyUncondBranchFromEmptyBlock(BB))
     return true;

Modified: llvm/branches/release_35/test/Transforms/SimplifyCFG/lifetime.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/test/Transforms/SimplifyCFG/lifetime.ll?rev=232544&r1=232543&r2=232544&view=diff
==============================================================================
--- llvm/branches/release_35/test/Transforms/SimplifyCFG/lifetime.ll (original)
+++ llvm/branches/release_35/test/Transforms/SimplifyCFG/lifetime.ll Tue Mar 17 15:42:08 2015
@@ -1,11 +1,11 @@
 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
 
-; Test that a lifetime intrinsic doesn't prevent us from simplifying this.
+; Test that a lifetime intrinsic isn't removed because that would change semantics
 
 ; CHECK: foo
 ; CHECK: entry:
-; CHECK-NOT: bb0:
-; CHECK-NOT: bb1:
+; CHECK: bb0:
+; CHECK: bb1:
 ; CHECK: ret
 define void @foo(i1 %x) {
 entry:






More information about the llvm-branch-commits mailing list