[PATCH] D39034: [WIP][GlobalISel][TableGen] Optimize MatchTable for faster instruction selection
Quentin Colombet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 8 13:56:47 PST 2017
qcolombet marked an inline comment as done.
qcolombet added inline comments.
================
Comment at: utils/TableGen/GlobalISelEmitter.cpp:3365-3367
+ // If this operand is free of constraints, rip it off.
+ if (OpMatcher.predicates_empty()) {
+ Matcher.pop_front();
----------------
qcolombet wrote:
> dsanders wrote:
> > This doesn't look right. It's removing the whole instruction matcher if its first operand matcher runs out of predicates. There may be other operand matchers left which do have predicates.
> Good catch, this check is supposed to check that OpMatcher was the last one!
Actually, I've checked the implementation of InstructionMatcher::pop_front and it only does what I intended: removing the first operand.
Talking with Daniel offline there was something else to fix: getNumOperands, so that the related check remains correct (it was looking at the size of this list).
Repository:
rL LLVM
https://reviews.llvm.org/D39034
More information about the llvm-commits
mailing list