<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi,<div><br></div><div>The proposed patch relaxes the behavior of TargetInstrInfo::commuteInstruction when TargetInstrInfo::findCommutedOpIndices returns false.</div><div><br></div><div>Currently TargetInstrInfo triggers a fatal error in such situation whereas based on the comment in the API[1] it should just return nullptr. Indeed the only precondition that should be ensured is that the instruction must be commutable.</div><div><br></div><div>Spotted via code inspection.</div><div><br></div><div>Is it okay to commit?</div><div><br></div><div>[1]</div><div><div>  /// commuteInstruction - If a target has any instructions that are</div><div>  /// commutable but require converting to different instructions or making</div><div>  /// non-trivial changes to commute them, this method can overloaded to do</div><div>  /// that.  The default implementation simply swaps the commutable operands.</div><div>  /// If NewMI is false, MI is modified in place and returned; otherwise, a</div><div>  /// new machine instruction is created and returned.  Do not call this</div><div>  /// method for a non-commutable instruction, but there may be some cases</div><div>  /// where this method fails and returns null.</div><div><br></div><div>Thanks,</div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
</div></body></html>