summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorRoman Tereshin <rtereshin@apple.com>2019-10-30 20:58:46 -0700
committerRoman Tereshin <rtereshin@apple.com>2019-11-01 01:57:48 -0700
commit6082a062a76d0bc9c9c641f5600569bafdf4c338 (patch)
tree2fd8375fc653551acc1558cdeb67993473dcc676 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentec630194fe64e9e304487040e808d0696a4f1895 (diff)
downloadbcm5719-llvm-6082a062a76d0bc9c9c641f5600569bafdf4c338.tar.gz
bcm5719-llvm-6082a062a76d0bc9c9c641f5600569bafdf4c338.zip
[GlobalISel] Match table opt: fix a bug in matching num of operands
If there is a dag node with a variable number of operands that has at least N operands (for some non-negative N), and multiple patterns with that node with different number of operands, we would drop the number of operands check in patterns with N operands, presumably because it's guaranteed in such case that none of the per-operand checks will access the operand list out-of-bounds. Except semantically the check is about having exactly N operands, not at least N operands, and a backend might rely on it to disambiguate different patterns. In this patch we change the condition on emitting the number of operands check from "the instruction is not guaranteed to have at least as many operands as are checked by the pattern being matched" to "the instruction is not guaranteed to have a specific number of operands". We're relying (still) on the rest of the CodeGenPatterns mechanics to validate that the pattern itself doesn't try to access more operands than there is in the instruction in cases when the instruction does have fixed number of operands, and on the machine verifier to validate at runtime that particular MIs like that satisfy the constraint as well. Reviewers: dsanders, qcolombet Reviewed By: qcolombet Subscribers: arsenm, rovka, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69653
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud