summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-08-29 13:24:34 +0000
committerSanjay Patel <spatel@rotateright.com>2018-08-29 13:24:34 +0000
commit7a05641fa8ee27682514d5c40dd344f4a557b03c (patch)
tree9ef929061098cc5868b3d54018ea4f1f90f473cb /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
parentf6db5bcd381e5f0e5970e74a9b15c6a1e804b80f (diff)
downloadbcm5719-llvm-7a05641fa8ee27682514d5c40dd344f4a557b03c.tar.gz
bcm5719-llvm-7a05641fa8ee27682514d5c40dd344f4a557b03c.zip
[InstCombine] remove unnecessary shuffle undef folding
Add a test for constant folding to show that (shuffle undef, undef, mask) should already be handled via instsimplify. llvm-svn: 340926
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 1c2de6352fa..7be6dd02794 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -1379,13 +1379,6 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
// Canonicalize shuffle(x ,x,mask) -> shuffle(x, undef,mask')
// Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask').
if (LHS == RHS || isa<UndefValue>(LHS)) {
- if (isa<UndefValue>(LHS) && LHS == RHS) {
- // shuffle(undef,undef,mask) -> undef.
- Value *Result = (VWidth == LHSWidth)
- ? LHS : UndefValue::get(SVI.getType());
- return replaceInstUsesWith(SVI, Result);
- }
-
// Remap any references to RHS to use LHS.
SmallVector<Constant*, 16> Elts;
for (unsigned i = 0, e = LHSWidth; i != VWidth; ++i) {
OpenPOWER on IntegriCloud