[Codegen][LLVMGPU] Add layout support for ArgCompare operations#23693
[Codegen][LLVMGPU] Add layout support for ArgCompare operations#23693bangtianliu merged 2 commits intoiree-org:mainfrom
Conversation
95a1651 to
09f915e
Compare
09f915e to
1b3345e
Compare
1974732 to
fd40274
Compare
Max191
left a comment
There was a problem hiding this comment.
LGTM, but maybe wait for someone who is more well-versed with layout analysis as well.
| if (argCompare.getInitValue() == val) { | ||
| LDBG() << " Propagating init_value layout to result\n"; | ||
| addCandidate(argCompare.getResultValue(), layout); | ||
| continue; | ||
| } | ||
| if (argCompare.getInitIndex() == val) { | ||
| LDBG() << " Propagating init_index layout to result\n"; | ||
| addCandidate(argCompare.getResultIndex(), layout); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Weird edge case: Couldn't the init value and init index technically be the same tensor? I highly doubt there would ever be an arg_compare like that, but just for completeness, should we remove the continues in these init cases and put the continue at the end of the containing if (auto argCompare = dyn_cast<ArgCompareOp>(user)) { instead?
Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
fd40274 to
fd0e107
Compare
|
cc @Groverkss @sommerlukas for review |
sommerlukas
left a comment
There was a problem hiding this comment.
Just a few small things on the tests.
compiler/src/iree/compiler/Codegen/Common/test/vector_layout_analysis.mlir
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/vector_layout_analysis.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/vector_layout_analysis.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/vector_layout_analysis.mlir
Outdated
Show resolved
Hide resolved
sommerlukas
left a comment
There was a problem hiding this comment.
Thanks for addressing the comments, but I think we should have the check lines actually match the expected value.
compiler/src/iree/compiler/Codegen/Common/test/vector_layout_analysis.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/test/vector_layout_analysis.mlir
Outdated
Show resolved
Hide resolved
a60ed3c to
d51a71f
Compare
compiler/src/iree/compiler/Codegen/Common/VectorLayoutAnalysis.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
d51a71f to
371a77e
Compare
This PR adds tensor layout propagation for iree_linalg_ext.arg_compare operations in the LLVMGPU backend, enabling arg_compare to participate in the vector distribution pipeline.
Issue: #23005
Assisted-by: Claude Code