[llvm] [VectorCombine] Preserves the maximal legal FPMathFlags during foldShuffleToIdentity (PR #94295)

Henry Jiang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 10:05:51 PDT 2024


================
@@ -1736,23 +1741,49 @@ static Value *generateNewInstTree(ArrayRef<InstLane> Item, FixedVectorType *Ty,
     Ops[Idx] = generateNewInstTree(generateInstLaneVectorFromOperand(Item, Idx),
                                    Ty, IdentityLeafs, SplatLeafs, Builder);
   }
+
+  SmallVector<Value *, 8> ValueList;
+  for (const auto &Lane : Item) {
+    if (Lane.second != FrontLane || !Lane.first)
+      continue;
+    ValueList.push_back(Lane.first);
----------------
mustartt wrote:

Lets just add them all, since the instructions are the same across the lanes.

https://github.com/llvm/llvm-project/pull/94295


More information about the llvm-commits mailing list