[llvm] [SLP] Fix cost estimation of external uses with wrong VF (PR #148185)
Gaƫtan Bossu via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 11 03:24:40 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
----------------
gbossu wrote:
One of the things I do find surprising is that the scalar load of `%a7` is kept, instead of being extracted from the last lane of `TMP1`. I guess it is fine, but costing and codegen are inconsistent. Changing that behaviour is out of scope for this PR.
https://github.com/llvm/llvm-project/pull/148185
More information about the llvm-commits
mailing list