-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[llvm][opt][Transforms] Preserve AMDGPU atomic metadata #140314
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 5 commits
31ceada
9e7ca22
8ea68b4
c6cfed6
401b882
c309620
c724475
768c92e
f3844ae
f28e605
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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,107 @@ | ||||||
| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 | ||||||
| ;; Test to ensure that AMDGPU atomic related metadata is not dropped when | ||||||
| ;; instructions are sunk. Currently the metadata from the first instruction | ||||||
| ;; is kept, which prevents full loss of optimisation information. | ||||||
|
|
||||||
| ; RUN: opt < %s -passes=simplifycfg -sink-common-insts -S | FileCheck %s | ||||||
|
|
||||||
| define amdgpu_kernel void @both(i1 %pred0, i1 %pred1, ptr captures(none) %p, double %d) local_unnamed_addr { | ||||||
|
||||||
| define amdgpu_kernel void @both(i1 %pred0, i1 %pred1, ptr captures(none) %p, double %d) local_unnamed_addr { | |
| define void @both(i1 %pred0, i1 %pred1, ptr captures(none) %p, double %d) { |
Outdated
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.
Why is it valid to preserve the metadata if it's only present on one of the branches?
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 believe I might've gotten this wrong actually, and it probably is not valid to do this - I'll elaborate a bit when replying to @arsenm's point about the intersection.
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 don't follow this part, it should be intersection
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 I misunderstood how these worked / assumed they are per-module global settings. I'll add @yxsamliu to the review since I know you and him worked on this. Intersection seems correct, however I wonder if we should actually prevent sinking / combining altogether if it results in removal of the metadata, since it could incur a pretty significant performance penalty / atomics with different MD aren't really the same instruction to begin with. Thoughts?