summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-02-10 14:31:24 +0000
committerDuncan Sands <baldrick@free.fr>2012-02-10 14:31:24 +0000
commit26641d7c029d13c766b723e2d1d47fc78ea3c296 (patch)
treedace24f66701848a0b086e65c0d4da0376c1402c /llvm/lib/Analysis/InstructionSimplify.cpp
parentbf48ac622a514818c0b8873fc21894758a438609 (diff)
downloadbcm5719-llvm-26641d7c029d13c766b723e2d1d47fc78ea3c296.tar.gz
bcm5719-llvm-26641d7c029d13c766b723e2d1d47fc78ea3c296.zip
Fix PR11948: the result type of an icmp may be a vector of boolean -
don't assume it is a boolean. llvm-svn: 150247
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index bce7e793188..7656220ba1f 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -476,6 +476,11 @@ static Value *ThreadCmpOverSelect(CmpInst::Predicate Pred, Value *LHS,
// the original comparison.
if (TCmp == FCmp)
return TCmp;
+
+ // The remaining cases only make sense if the select condition has the same
+ // type as the result of the comparison, so bail out if this is not so.
+ if (Cond->getType()->isVectorTy() != RHS->getType()->isVectorTy())
+ return 0;
// If the false value simplified to false, then the result of the compare
// is equal to "Cond && TCmp". This also catches the case when the false
// value simplified to false and the true value to true, returning "Cond".
OpenPOWER on IntegriCloud