[llvm] [InferAddressSpaces] collect flat address expression from return value (PR #70610)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 30 00:18:18 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 {
----------------
arsenm wrote:
Can you also add a test with a vector of pointers
https://github.com/llvm/llvm-project/pull/70610
More information about the llvm-commits
mailing list