diff options
| author | Daniel Sanders <daniel_l_sanders@apple.com> | 2018-01-17 20:34:29 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2018-01-17 20:34:29 +0000 |
| commit | 12e6e709e96924733f9e5ff4ccd7cd036c5bd7cc (patch) | |
| tree | 543ec3a8da2591c68087fb60ed90da553583c1b4 /llvm/utils | |
| parent | d703ec94a95221c2916f5a89304673d65639527e (diff) | |
| download | bcm5719-llvm-12e6e709e96924733f9e5ff4ccd7cd036c5bd7cc.tar.gz bcm5719-llvm-12e6e709e96924733f9e5ff4ccd7cd036c5bd7cc.zip | |
[globalisel][tablegen] Honour priority order within nested instructions.
It appears that we haven't been prioritizing rules that contain nested
instructions properly. InstructionOperandMatcher didn't override
isHigherPriorityThan so it never compared the instructions/operands/predicates
inside nested instructions.
Fixes PR35926. Thanks to Diana Picus for the bug report.
llvm-svn: 322754
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index b4073b15daa..fd9ba08c7e2 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -1692,6 +1692,19 @@ public: RuleMatcher &Rule) const override { InsnMatcher->emitPredicateOpcodes(Table, Rule); } + + bool isHigherPriorityThan(const OperandPredicateMatcher &B) const override { + if (OperandPredicateMatcher::isHigherPriorityThan(B)) + return true; + if (B.OperandPredicateMatcher::isHigherPriorityThan(*this)) + return false; + + if (const InstructionOperandMatcher *BP = + dyn_cast<InstructionOperandMatcher>(&B)) + if (InsnMatcher->isHigherPriorityThan(*BP->InsnMatcher)) + return true; + return false; + } }; //===- Actions ------------------------------------------------------------===// |

