summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2013-09-27 20:35:39 +0000
committerJustin Bogner <mail@justinbogner.com>2013-09-27 20:35:39 +0000
commit4a9ac8cd75899973ac5e06a733389f8b5dcdf08e (patch)
tree9f4dd8350479ec38bd60bfc26d0348d34ef95b6c /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
parentea1ba0adfcb7d0c500bc18534757d9296712e3c6 (diff)
downloadbcm5719-llvm-4a9ac8cd75899973ac5e06a733389f8b5dcdf08e.tar.gz
bcm5719-llvm-4a9ac8cd75899973ac5e06a733389f8b5dcdf08e.zip
InstCombine: Only foldSelectICmpAndOr for integer types
Currently foldSelectICmpAndOr asserts if the "or" involves a vector containing several of the same power of two. We can easily avoid this by only performing the fold on integer types, like foldSelectICmpAnd does. Fixes <rdar://problem/15012516> llvm-svn: 191552
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 7581dbe0f08..283bec2881f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -367,7 +367,7 @@ static Value *foldSelectICmpAndOr(const SelectInst &SI, Value *TrueVal,
Value *FalseVal,
InstCombiner::BuilderTy *Builder) {
const ICmpInst *IC = dyn_cast<ICmpInst>(SI.getCondition());
- if (!IC || !IC->isEquality())
+ if (!IC || !IC->isEquality() || !SI.getType()->isIntegerTy())
return 0;
Value *CmpLHS = IC->getOperand(0);
OpenPOWER on IntegriCloud