Prevent users of iter_args of an affine for loop from being hoisted
out of it. Otherwise, LICM leads to a violation of the SSA dominance
(as demonstrated in the added test case).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM - some minor comments on compactness.
| mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
|---|---|---|
| 53 | Operation::operand_range aren't normally used on methods/API - just ValueRange should do - more compact/cleaner. | |
| 56 | Likewise. | |
| 135 | auto -> Value | |
| 135–139 | You can use llvm::is_contained to encode this in one line. | |
| 137 | Nit: terminate with a full stop. | |
| 198 | auto -> ValueRange should work I think. | |
Comment Actions
Incorporated all the suggestions, thanks @bondhugula !
| mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
|---|---|---|
| 137 | Not adding a full stop to be consistent with other places. Sounds good ? | |
Comment Actions
LGTM.
| mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | ||
|---|---|---|
| 137 | Sounds fine. | |
Operation::operand_range aren't normally used on methods/API - just ValueRange should do - more compact/cleaner.