[llvm-dev] Must the MatcherTable start with an OPC_SwitchOpcode?
Zheng CZ Chen via llvm-dev
llvm-dev at lists.llvm.org
Tue Mar 5 18:13:20 PST 2019
Hi all,
There is a cache OpcodeOffset in class SelectionDAGISel to accelerate ISEL.
But OpcodeOffset can only be filled when MatcherTable[0] is
OPC_SwitchOpcode.
Code for the check:
} else if (MatcherTable[0] == OPC_SwitchOpcode) {
// Otherwise, the table isn't computed, but the state machine does
start
// with an OPC_SwitchOpcode instruction. Populate the table now, since
this
// is the first time we're selecting an instruction.
According to the comment, I guess it is a must have condition? If it is a
must have condition, can we add assert for it in someplace like 1: where we
generate the MatcherTable in TableGen or 2: the place when we do ISEL in
function SelectionDAGISel::SelectCodeCommon.
If MatcherTable[0] is not OPC_SwitchOpcode, no test case will capture this
issue and it will leads to a significant increase in isel match failures.
Thanks.
BRS//
Chen Zheng
Power Compiler Backend Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190306/bac28c6a/attachment.html>
More information about the llvm-dev
mailing list