summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-04-15 15:32:12 +0000
committerSanjay Patel <spatel@rotateright.com>2016-04-15 15:32:12 +0000
commitf11ab05bdb2f032c1fbddf11987e073e112d9b0a (patch)
tree77c26ebae2ae94271efd63d47520b6f3a59fb27d /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parentc5727ecd8884dff1a6abb0559275638f5d235469 (diff)
downloadbcm5719-llvm-f11ab05bdb2f032c1fbddf11987e073e112d9b0a.tar.gz
bcm5719-llvm-f11ab05bdb2f032c1fbddf11987e073e112d9b0a.zip
[SimplifyCFG] propagate branch metadata when creating select (PR27344)
This is almost identical to: http://reviews.llvm.org/rL264527 This doesn't solve PR27344; it just allows the profile weights to survive. To solve the bug, we need to use the profile weights in the backend. llvm-svn: 266442
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 456ad2a62b7..1c27bc67cfb 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1678,8 +1678,8 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB,
Value *TrueV = ThenV, *FalseV = OrigV;
if (Invert)
std::swap(TrueV, FalseV);
- Value *V = Builder.CreateSelect(BrCond, TrueV, FalseV,
- TrueV->getName() + "." + FalseV->getName());
+ Value *V = Builder.CreateSelect(
+ BrCond, TrueV, FalseV, TrueV->getName() + "." + FalseV->getName(), BI);
PN->setIncomingValue(OrigI, V);
PN->setIncomingValue(ThenI, V);
}
OpenPOWER on IntegriCloud