-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[InferAddressSpaces] collect flat address expression from return value #70610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ | |
; Instcombine pulls the addrspacecast out of the select, make sure | ||
; 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-LABEL: define ptr @return_select_group_flat( | ||
; CHECK-SAME: i1 [[C:%.*]], ptr addrspace(3) [[GROUP_PTR_0:%.*]], ptr addrspace(3) [[GROUP_PTR_1:%.*]]) #[[ATTR0:[0-9]+]] { | ||
; 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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add a test with a vector of pointers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added noop_ptrint_pair_ce2_vec to noop-ptrint-pair.ll |
||
%cast0 = addrspacecast ptr addrspace(3) %group.ptr.0 to ptr | ||
%cast1 = addrspacecast ptr addrspace(3) %group.ptr.1 to ptr | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this also should check the signature of the function; need to make sure you aren't mutating it in a way that breaks uses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done