diff options
author | Justin Bogner <mail@justinbogner.com> | 2013-09-27 20:35:39 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2013-09-27 20:35:39 +0000 |
commit | 4a9ac8cd75899973ac5e06a733389f8b5dcdf08e (patch) | |
tree | 9f4dd8350479ec38bd60bfc26d0348d34ef95b6c /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | |
parent | ea1ba0adfcb7d0c500bc18534757d9296712e3c6 (diff) | |
download | bcm5719-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.cpp | 2 |
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); |