<html><body><p><font size="2">Hi all,</font><br><br><font size="2">There is a cache OpcodeOffset in class SelectionDAGISel to accelerate ISEL. But OpcodeOffset can only be filled when MatcherTable[0] is OPC_SwitchOpcode.</font><br><br><font size="2">Code for the check: </font><br><br><font size="2">  } else if (MatcherTable[0] == OPC_SwitchOpcode) {</font><br><font size="2">    // Otherwise, the table isn't computed, but the state machine does start</font><br><font size="2">    // with an OPC_SwitchOpcode instruction.  Populate the table now, since this</font><br><font size="2">    // is the first time we're selecting an instruction.</font><br><br><font size="2">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.</font><br><br><font size="2">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.</font><br><br><font size="2">Thanks.</font><br><br><font size="2">BRS//</font><br><font size="2">Chen Zheng</font><br><font size="2">Power Compiler Backend Developer</font><br><BR>
</body></html>