[llvm] [Transform][LoadStoreVectorizer] allow redundant in Chain (PR #163019)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 14 12:03:31 PDT 2025
================
@@ -22,8 +22,9 @@ entry:
}
; CHECK-LABEL: @cast_to_cast
-; CHECK: %tmp4 = load ptr, ptr %tmp1, align 8
-; CHECK: %tmp5 = load ptr, ptr %tmp3, align 8
+; CHECK: load <1 x i64>
+; CHECK: extractelement <1 x i64>
+; CHECK: extractelement <1 x i64>
define void @cast_to_cast() {
entry:
%a.ascast = addrspacecast ptr addrspace(5) undef to ptr
----------------
Artem-B wrote:
<!--__GRAPHITE_HTML_TAG_START__--><p class='graphite__hidden'><i>[Re: lines +25 to +37]</i></p><!--__GRAPHITE_HTML_TAG_END__-->
The result of this test looks rather suspicious.
I'm not sure I understand the purpose of the test to start with, as there appears to be no casts to casts, just two `load(select(asc()))` operations.
AFAICT, the test ends up doing loads on `undef` pointer in both cases, which is a UB. I think this test should be removed or fixed. If the intent was to load from the different pointers, then we should not have combined the loads. And if the intent was to eventually make the loads from the same pointer, then the test is not doing that and needs to be fixed.
<!--__GRAPHITE_HTML_TAG_START__--><p class='graphite__hidden'>See this comment inline on <a href="https://app.graphite.dev/github/pr/llvm/llvm-project/163019?utm_source=unchanged-line-comment">Graphite</a>.</p><!--__GRAPHITE_HTML_TAG_END__-->
https://github.com/llvm/llvm-project/pull/163019
More information about the llvm-commits
mailing list