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 | ||
---|---|---|
2362 | 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. | |
2368 | Sure. |
mlir/test/Dialect/Affine/canonicalize.mlir | ||
---|---|---|
990–991 | Remove DAG? The order in the return should always be the same, right? |
Drop unnecessary -DAGs.
mlir/test/Dialect/Affine/canonicalize.mlir | ||
---|---|---|
990–991 | Right. The second set of -DAGs aren't needed. |
Plz invert some conditions and use early exit instead of applying 5-deep nesting.