llvm.org GIT mirror llvm / release_35
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. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232544 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 4 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
40074007 return true;
40084008
40094009 // If the Terminator is the only non-phi instruction, simplify the block.
4010 BasicBlock::iterator I = BB->getFirstNonPHIOrDbgOrLifetime();
4010 BasicBlock::iterator I = BB->getFirstNonPHIOrDbg();
40114011 if (I->isTerminator() && BB != &BB->getParent()->getEntryBlock() &&
40124012 TryToSimplifyUncondBranchFromEmptyBlock(BB))
40134013 return true;
0 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
11
2 ; Test that a lifetime intrinsic doesn't prevent us from simplifying this.
2 ; Test that a lifetime intrinsic isn't removed because that would change semantics
33
44 ; CHECK: foo
55 ; CHECK: entry:
6 ; CHECK-NOT: bb0:
7 ; CHECK-NOT: bb1:
6 ; CHECK: bb0:
7 ; CHECK: bb1:
88 ; CHECK: ret
99 define void @foo(i1 %x) {
1010 entry: