[llvm] [InstCombine] Remove Store which has one-use AddrSpaceCastInst as Ptr (#68120) (PR #79565)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 26 07:36:46 PST 2024
================
@@ -345,6 +345,22 @@ define void @store_to_readonly_noalias(ptr readonly noalias %0) {
ret void
}
+; if ptr which store to is addrspacecast, and its target is alloca. remove it.
+define void @src_store_oneuse_addrspaceast_alloca(ptr align 8 %arg) {
+; CHECK-LABEL: @src_store_oneuse_addrspaceast_alloca(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: store ptr poison, ptr null, align 8
+; CHECK-NEXT: ret void
+;
+bb:
+ %i = alloca ptr, align 8, addrspace(5)
+ %i1 = addrspacecast ptr addrspace(5) %i to ptr
+ store ptr %arg, ptr %i1, align 8
----------------
ParkHanbum wrote:
to summarize, do you mean that a test with GEP is also necessary? but imo, this issue have not related with GEP. I would appreciate it if you could tell me why you are referring to GEP.
https://github.com/llvm/llvm-project/pull/79565
More information about the llvm-commits
mailing list