Lowers from tosa's pad op to the linalg equivalent for floating,
integer, and quantized values.
Details
- Reviewers
antiagainst - Commits
- rG4157a079afbf: [mlir][tosa] Add tosa.pad to linalg.pad operation
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Cool, just a few nits.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
1018 | Aren't these guaranteed by the source op's validation? If it's missing there, it's better to add there. | |
1060 | Use else if to chain them together so don't need to try the following cases if a previous one is hit? | |
1062 | Nit: this is quite skewed. What about having a local variable for it? :) | |
1071 | Should probably llvm_unreachable to guard against constant == null to fall through? | |
1075 | You can combine the create and replace with replaceOpWithNewOp. |
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
1060 | Changed to else ifs. | |
1062 | Instead of making the constant op for each I changed to just getting a valid Attr. Cleans up the skewed-ness quite a bit. | |
1071 | Added a rewriter error above. | |
1075 | Actually createPadOp is not the default constructor (instead containing some specialized behavior). It does not actually work with the constructor as a side effect so I need to separately construct and replace. |
Aren't these guaranteed by the source op's validation? If it's missing there, it's better to add there.