aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-17 18:21:49 +0000
committerDevang Patel <dpatel@apple.com>2008-09-17 18:21:49 +0000
commitdff594ed06581fd20578dbb19c9768e941a1182e (patch)
tree9991042d24398da2803793872bc2ea61fd2d97c8 /lib
parent65a9ca9a76643d2357e25c4b9268a67ec13fd2cd (diff)
downloadexternal_llvm-dff594ed06581fd20578dbb19c9768e941a1182e.zip
external_llvm-dff594ed06581fd20578dbb19c9768e941a1182e.tar.gz
external_llvm-dff594ed06581fd20578dbb19c9768e941a1182e.tar.bz2
Do not hoist instruction above branch condition. The instruction may use branch condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index efd1765..39163e4 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1046,15 +1046,8 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *BB1) {
return false;
}
- // If we get here, we can hoist the instruction. Try to place it before the
- // icmp instruction preceeding the conditional branch.
- BasicBlock::iterator InsertPos = BI;
- if (InsertPos != BIParent->begin())
- --InsertPos;
- if (InsertPos == BrCond && !isa<PHINode>(BrCond))
- BIParent->getInstList().splice(InsertPos, BB1->getInstList(), I);
- else
- BIParent->getInstList().splice(BI, BB1->getInstList(), I);
+ // If we get here, we can hoist the instruction.
+ BIParent->getInstList().splice(BI, BB1->getInstList(), I);
// Create a select whose true value is the speculatively executed value and
// false value is the previously determined FalseV.