Add an option to predicate the epilogue within the kernel instead of
peeling the epilogue. This is a useful option to prevent generating
large amount of code for deep pipeline. This currently require a user
lambda to implement operation predication.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks, just one small question below, LGTM otherwise.
mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp | ||
---|---|---|
151 | What do you mean by this? Why would it be better? |
mlir/include/mlir/Dialect/SCF/Transforms.h | ||
---|---|---|
147 | Nit: If epilogue -> If the epilogus | |
155 | You don't need the PatternRewriter. The `OpBuilder is enough? That allows wider usage outside of pattern rewrites. | |
158 | Please remove reference to the undef op -- it's completely vague/missing information as to why. require -> requires | |
mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp | ||
236 | This second sentence is broken. Rewrite? | |
266 | Nit: Create | |
326 | predicated | |
mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp | ||
127 | I think "skip-epilogue-peeling" isn't fully accurate. no-epilogue-peeling? | |
149 | version of op. | |
152 | Yes, this last line is vague. Instead, please mark a TODO if there is a future scope for improvement. |
mlir/include/mlir/Dialect/SCF/Transforms.h | ||
---|---|---|
155 | I want to allow user to potentially erase the operation and return a new one which requires a PatternRewriter. | |
158 | Removed. | |
mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp | ||
151 | What I meant is that in general it is probably better to speculatively execute operations without side effect than adding control flow. This was just to point out how it is meant to be used but I think this is more confusing than anything else so I removed this comment. | |
152 | Removed, this is not about future improvements just a comment on how it is expected to be used but looks like it is more confusing than helping. |
Nit: If epilogue -> If the epilogus
Comma after 'predicated'.
user -> the user
predicated version -> the predicated version