[PATCH] D69653: [GlobalISel] Match table opt: fix a bug in matching num of operands
Quentin Colombet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 1 09:29:31 PDT 2019
qcolombet added a comment.
Thanks for the test case!
================
Comment at: llvm/utils/TableGen/GlobalISelEmitter.cpp:2276
if (Stash.back().get() == &OpcMatcher) {
- if (NumOperandsCheck && OpcMatcher.getNumOperands() < getNumOperands())
+ if (NumOperandsCheck && OpcMatcher.isVariadicNumOperands())
Stash.emplace_back(
----------------
rtereshin wrote:
> qcolombet wrote:
> > Stupid question: what complains if an instruction does not have the `isVariadic` attribute, but we write patterns with different number of operands?
> > (Just wondering if we need an assert that !isVariadic => getNumOperands() == OpcMatcher.getNumOperands()).
> > Stupid question: what complains if an instruction does not have the isVariadic attribute, but we write patterns with different number of operands?
> This does: https://github.com/llvm/llvm-project/blob/master/llvm/utils/TableGen/CodeGenDAGPatterns.cpp#L2414-L2420
>
> > (Just wondering if we need an assert that !isVariadic => getNumOperands() == OpcMatcher.getNumOperands()).
> Considered the same, decided redundant.
Sounds good.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69653/new/
https://reviews.llvm.org/D69653
More information about the llvm-commits
mailing list