summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineSelect.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-09-28 09:33:53 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-09-28 09:33:53 +0000
commit7e0e166d1783671e555eff26b9932012fadea691 (patch)
tree7be7078bad57bde7d4b8c9044f0bf35aa75ad074 /lib/Transforms/InstCombine/InstCombineSelect.cpp
parent8bb12aeeb4f38f62f2d97618d0c688f47c9bd972 (diff)
downloadllvm-7e0e166d1783671e555eff26b9932012fadea691.tar.gz
llvm-7e0e166d1783671e555eff26b9932012fadea691.tar.bz2
llvm-7e0e166d1783671e555eff26b9932012fadea691.tar.xz
Surprisingly, we missed a trivial case here. Fix that!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineSelect.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineSelect.cpp b/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 70483ceb06..0ba7340e64 100644
--- a/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -930,6 +930,10 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
Value *V = Builder->CreateShuffleVector(TrueVal, FalseVal, MaskVal);
return ReplaceInstUsesWith(SI, V);
}
+
+ if (isa<ConstantAggregateZero>(CondVal)) {
+ return ReplaceInstUsesWith(SI, FalseVal);
+ }
}
return 0;