Zheng CZ Chen via llvm-dev
2019-Mar-06 02:13 UTC
[llvm-dev] Must the MatcherTable start with an OPC_SwitchOpcode?
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>