File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1900,13 +1900,11 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
19001900 continue ;
19011901 }
19021902
1903- if (Mask[i] < ( int )LHSWidth && isa<UndefValue>(LHS)) {
1904- Mask[i] = - 1 ; // Turn into undef.
1903+ // Change select of undef to undef mask element or force to LHS.
1904+ if ( Mask[i] < ( int )LHSWidth && isa<UndefValue>(LHS))
19051905 Elts.push_back (UndefValue::get (Int32Ty));
1906- } else {
1907- Mask[i] = Mask[i] % LHSWidth; // Force to LHS.
1908- Elts.push_back (ConstantInt::get (Int32Ty, Mask[i]));
1909- }
1906+ else
1907+ Elts.push_back (ConstantInt::get (Int32Ty, Mask[i] % LHSWidth));
19101908 }
19111909 SVI.setOperand (0 , SVI.getOperand (1 ));
19121910 SVI.setOperand (1 , UndefValue::get (RHS->getType ()));
You can’t perform that action at this time.
0 commit comments