Fold affine.load ops on global constant memrefs when indices are all
constant.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| mlir/lib/Dialect/Affine/IR/AffineOps.cpp | ||
|---|---|---|
| 2404 | I did think of inverting the checks (which would be the normal way); the reason I didn't is that this is a folding hook where the list of conditions may grow (further below this check). Inverting would lead to a reversal when the next folding rule is added. And you can't invert the inner ones since there isn't a for loop here (there's no early exit). Fine with inverting though but that would lead to a larger diff on the next change. | |
| 2410 | Sure. | |
| mlir/test/Dialect/Affine/canonicalize.mlir | ||
|---|---|---|
| 1096–1097 | Remove DAG? The order in the return should always be the same, right? | |
Drop unnecessary -DAGs.
| mlir/test/Dialect/Affine/canonicalize.mlir | ||
|---|---|---|
| 1096–1097 | Right. The second set of -DAGs aren't needed. | |
Plz invert some conditions and use early exit instead of applying 5-deep nesting.