[mlir][Interfaces] `CallOpInterface`: Model forwarded result + improve verification (#214724)
`CallOpInterface` distinguishes between forwarded operands and consumed
operands. This commit adds the concept of "forwarded results", making
operands/results symmetric.
Forwarded operands are forwarded from the caller to the callee's block
arguments. Forwarded results are forwarded from the callee to the
caller's results. All other operands/results are consumed/produced by
the call op.
This commit also improves verification:
- The number of forwarded operands and callee arguments must match.
- The number of forwarded results and caller results must match.
- Verification that was duplicated in op verifiers is now performed by
the interface verifier.
Note: `llvm.call` / `llvm.func` support variadic operands. These are not
supported by `CallOpInterface` or `CallableOpInterface`. The
`CallOpInterface` now no longer reports variadic operands as part of the
forwarded operands (`getArgOperands`). The old implementation used to
inconsistent: `CallOpInterface` included variadic operands, but
`CallableOpInterface` did not.
Discussion:
https://discourse.llvm.org/t/callopinterface-semantics-verification-around-value-forwarding/91497
Assisted-by: Claude Opus 5