[llvm] [LV] Support multiplies by constants when forming scaled reductions. (PR #161092)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 01:32:45 PDT 2025


================
@@ -1741,6 +1741,16 @@ void LoopVectorizationPlanner::printPlans(raw_ostream &O) {
 }
 #endif
 
+bool llvm::canConstantBeExtended(const ConstantInt *CI, Type *NarrowType,
+                                 TTI::PartialReductionExtendKind ExtKind) {
+  APInt TruncatedVal = CI->getValue().trunc(NarrowType->getScalarSizeInBits());
----------------
fhahn wrote:

Yep, it should be `@red_sext_mul_by_128` at line 272 in [llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-constant-ops.ll](https://github.com/llvm/llvm-project/pull/161092/files#diff-c9a795e76639c70836fe45c96bb9eb33b3a9a4e5b217792603c4e9c9ca057c30L272)

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


More information about the llvm-commits mailing list