[llvm] [SLP] Fix cost estimation of external uses with wrong VF (PR #148185)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 03:36:20 PDT 2025


================
@@ -31,3 +31,34 @@ define void @test() {
   store double %res4, ptr getelementptr inbounds ([8 x double], ptr @dst, i32 0, i64 3), align 8
   ret void
 }
+
+; Same as above, but %a7 is also used as a scalar and must be extracted from
+; the wide load. (Or in this case, kept as a scalar load).
+define double @test_with_extract() {
+; CHECK-LABEL: @test_with_extract(
+; CHECK-NEXT:    [[TMP1:%.*]] = load <8 x double>, ptr @src, align 8
+; CHECK-NEXT:    [[A7:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src, i32 0, i64 7), align 8
----------------
alexey-bataev wrote:

Better to extract this test into a separate file and make it generating the remarks with the cost to see how it affects the cost

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


More information about the llvm-commits mailing list