[llvm] [SLP]Remove operands upon marking instruction for deletion. (PR #97409)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 09:46:14 PDT 2024


================
@@ -17344,14 +17370,11 @@ class HorizontalReduction {
         Value *ReducedSubTree =
             emitReduction(VectorizedRoot, Builder, ReduxWidth, TTI);
         if (ReducedSubTree->getType() != VL.front()->getType()) {
-          ReducedSubTree = Builder.CreateIntCast(
-              ReducedSubTree, VL.front()->getType(), any_of(VL, [&](Value *R) {
-                KnownBits Known = computeKnownBits(
-                    R, cast<Instruction>(ReductionOps.front().front())
-                           ->getModule()
-                           ->getDataLayout());
-                return !Known.isNonNegative();
-              }));
+          assert(ReducedSubTree->getType() != VL.front()->getType() &&
+                 "Expected different reduction type.");
+          ReducedSubTree =
+              Builder.CreateIntCast(ReducedSubTree, VL.front()->getType(),
+                                    *V.isSignedMinBitwidthRootNode());
----------------
alexey-bataev wrote:

I reworked the function, if the types do not match, it means that the root node is resized due to minbitwidth analysis and there is signedness info in MinBWs map for the root node

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


More information about the llvm-commits mailing list