-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[AMD] DCE/canonicalize true epilogue conditionals #6314
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
[AMD] DCE/canonicalize true epilogue conditionals #6314
Conversation
ca93969 to
15df1ce
Compare
dcbd67c to
987cfd6
Compare
|
Some kind of bug around here https://github.com/llvm/llvm-project/blob/8726e973459d93d34653946ba1e01ad198cdf11f/mlir/lib/Dialect/Arith/Transforms/IntRangeOptimizations.cpp#L56-L81 related to how the constant is materialized. Will figure it out next week. |
|
Upstream bug fix: llvm/llvm-project#133556 |
|
I put a fix in the branch. IntRangeAnalysis will now return a dummy return for noninteger values, because it has to return something. |
1d4b9a6 to
9e80a42
Compare
27261f4 to
9803f17
Compare
9803f17 to
9bc5cec
Compare
Waiting on llvm/llvm-project#133151 upstream.This PR adds a pattern that folds "true"
arith.cmpioperations toarith.constant true; e.g.->
(after DCE).
The specific use case is "unguarding" the epilogue in pipelined loops (e.g., as produced by
tritonamdgpu-stream-pipeline). So e.g.,becomes
Notice both the
scf.ifandarith.selectare canonicalized away.Note, this usually requires the use of
tl.assumeto hint/constrain the operands of thearith.cmpi; specifically wrt the original loop bounds something like%stop // %step >= 1(or whatever the arithmetic on the loop bounds needs to be...).Currently this is failing because I need to cherry-pick/PR an LLVM bump.Waiting on #6334.