summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-04-26 00:47:39 +0000
committerSanjay Patel <spatel@rotateright.com>2016-04-26 00:47:39 +0000
commita31b0c0ece352e7ba31a65f155e9252647c2b1cd (patch)
treea337dbfe094b07c3bbea40e60d2b0bda04ca05ce /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent90d96bf41e49de6f95ce3848815e99dc40906adb (diff)
downloadbcm5719-llvm-a31b0c0ece352e7ba31a65f155e9252647c2b1cd.tar.gz
bcm5719-llvm-a31b0c0ece352e7ba31a65f155e9252647c2b1cd.zip
[CodeGenPrepare] don't convert an unpredictable select into control flow
Suggested in the review of D19488: http://reviews.llvm.org/D19488 llvm-svn: 267504
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 9ba93a956fa..659b0c572fb 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -4568,7 +4568,8 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
bool VectorCond = !SI->getCondition()->getType()->isIntegerTy(1);
// Can we convert the 'select' to CF ?
- if (DisableSelectToBranch || OptSize || !TLI || VectorCond)
+ if (DisableSelectToBranch || OptSize || !TLI || VectorCond ||
+ SI->getMetadata(LLVMContext::MD_unpredictable))
return false;
TargetLowering::SelectSupportKind SelectKind;
OpenPOWER on IntegriCloud