[llvm] [InferAddressSpaces] collect flat address expression from return value (PR #70610)
Wenju He via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 30 01:08:11 PDT 2023
================
@@ -4,10 +4,9 @@
; this doesn't do something insane on non-canonical IR.
; CHECK-LABEL: @return_select_group_flat(
-; CHECK-NEXT: %cast0 = addrspacecast ptr addrspace(3) %group.ptr.0 to ptr
-; CHECK-NEXT: %cast1 = addrspacecast ptr addrspace(3) %group.ptr.1 to ptr
-; CHECK-NEXT: %select = select i1 %c, ptr %cast0, ptr %cast1
-; CHECK-NEXT: ret ptr %select
+; CHECK-NEXT: [[SELECT:%.*]] = select i1 %c, ptr addrspace(3) %group.ptr.0, ptr addrspace(3) %group.ptr.1
+; CHECK-NEXT: [[TMP1:%.*]] = addrspacecast ptr addrspace(3) [[SELECT]] to ptr
+; CHECK-NEXT: ret ptr [[TMP1]]
define ptr @return_select_group_flat(i1 %c, ptr addrspace(3) %group.ptr.0, ptr addrspace(3) %group.ptr.1) #0 {
----------------
wenju-he wrote:
I added noop_ptrint_pair_ce2_vec to noop-ptrint-pair.ll
I find that currently isAddressExpression isn't handling ConstantAggregate so vector of pointers is not inferred. The change at line 73 of https://github.com/llvm/llvm-project/pull/70610/commits/bca6a6664119b96c6736df131ebe71a7cece2b93 is just because currently constant is replaced globally, i.e. it is replaced while handling another function.
https://github.com/llvm/llvm-project/pull/70610
More information about the llvm-commits
mailing list