[SystemZ] Make sure SelectCode() is not called on a target opcode.

Since getNode() might not always return the requsted opcode, for instance if
called with (ISD::AND, -1) arguments, there should be a check so that
SelectCode() is only called when appropriate.

Review: Ulrich Weigand
llvm-svn: 326178
This commit is contained in:
Jonas Paulsson 2018-02-27 07:53:23 +00:00
parent debfbcf86e
commit f268cd0aad
1 changed files with 2 additions and 1 deletions

View File

@ -993,7 +993,8 @@ bool SystemZDAGToDAGISel::tryRISBGZero(SDNode *N) {
N = New.getNode();
}
// Now, select the machine opcode to implement this operation.
SelectCode(N);
if (!N->isMachineOpcode())
SelectCode(N);
return true;
}
}