This allows caller to use non-const functions, e.g., getOperandNumber, etc. It
is expected that OpOperand is not modified in a callback function.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h | ||
---|---|---|
54 | Nit: Please also state that the callback is expected to not modify the OpOperand. |
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h | ||
---|---|---|
54 | That would raise some lvalue issue. I've found that most of time we would call controlFn(producer->getResult(0), *consumerOpOperand). If we drop the const on OpResult, I think we will have to declare a variable to store it. I assume the methods in OpResult is not that useful, so I'd keep the const in this case. |
Nit: Please also state that the callback is expected to not modify the OpOperand.
Do we want to drop the const on OpResult as well?