File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -1918,6 +1918,7 @@ bool VectorCombine::foldShuffleOfSelects(Instruction &I) {
19181918 if (!C1VecTy || !C2VecTy)
19191919 return false ;
19201920
1921+ // SelectInsts must have the same FMF.
19211922 auto *Select0 = cast<Instruction>(I.getOperand (0 ));
19221923 if (auto *SI0FOp = dyn_cast<FPMathOperator>(Select0))
19231924 if (auto *SI1FOp = dyn_cast<FPMathOperator>((I.getOperand (1 ))))
@@ -1951,6 +1952,8 @@ bool VectorCombine::foldShuffleOfSelects(Instruction &I) {
19511952 Value *ShuffleTrue = Builder.CreateShuffleVector (T1, T2, Mask);
19521953 Value *ShuffleFalse = Builder.CreateShuffleVector (F1, F2, Mask);
19531954 Value *NewSel = Builder.CreateSelect (ShuffleCmp, ShuffleTrue, ShuffleFalse);
1955+
1956+ // We presuppose that the SelectInsts have the same FMF.
19541957 if (isa<FPMathOperator>(NewSel))
19551958 cast<Instruction>(NewSel)->setFastMathFlags (Select0->getFastMathFlags ());
19561959
You can’t perform that action at this time.
0 commit comments