diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-09-28 09:33:53 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-09-28 09:33:53 +0000 |
commit | 7e0e166d1783671e555eff26b9932012fadea691 (patch) | |
tree | 7be7078bad57bde7d4b8c9044f0bf35aa75ad074 /lib/Transforms/InstCombine/InstCombineSelect.cpp | |
parent | 8bb12aeeb4f38f62f2d97618d0c688f47c9bd972 (diff) |
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.cpp | 4 |
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; |