Currently there is an expectations that there is a corresponsing block argument
for each operand. For some operation, it leads to unused arguments. For example,
in map, only input operands are used for the computation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks!
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td | ||
---|---|---|
581 | What about calling it getTiedOpOperands? Because it returns the list of getTiedOpOperand(i) for every block arg. |
I think this is a big change. Having unused arguments is not a big deal. It removes some consistency that would be very involved to work around.
I think this is a big change. Having unused arguments is not a big deal. It removes some consistency that would be very involved to work around.
I've actually been annoyed by the trailing unused bbarg hanging around for some time ..
In the linalg.generic case I agree that consistency trumps the rest.
It is innocuous to me to relax the interface so we can create ops with nicer ergonomics.
If anything, I think this even increases consistency because the bbArgs region verifier directly relates to the matching block operands without an implicit level of indirection.
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td | ||
---|---|---|
581 | The "tied" terminology would be a misnomer here I think as it relates to DPS "Tied" means two operands are mapped to the same register. When we write Constraints = "$src1 = $dst" in tablegen, generated code would set $src1 and $dst as "tied" (GlobalISel/Utils.cpp): I introduced it improperly a while back but would appreciate the cleanup. Then this one could be called getOpOperandsMatchingBBargs ? |
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td | ||
---|---|---|
581 | getOpOperandsMatchingBBargs sounds good. I was hesitant to add such a verbose name at first. |
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td | ||
---|---|---|
581 | I'll prepare a separate patch to cleanup getTiedOpOperand(bbArg) -> getMatchingOpOperand(bbArg) tomorrow. |
removing my blocker based on @nicolasvasilache comments.
Thanks for your flexibility @mravishankar!
I'll prepare a separate patch to cleanup getTiedOpOperand(bbArg) -> getMatchingOpOperand(bbArg) tomorrow.
Great, thank you!
What about calling it getTiedOpOperands? Because it returns the list of getTiedOpOperand(i) for every block arg.