<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;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 21, 2015, at 2:20 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Test case?</p><div class=""><br class=""></div></div></blockquote><div><br class=""></div><div>The following two commits have tests that hit this</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class="">
<div class="gmail_quote">On Feb 21, 2015 1:32 PM, "Matt Arsenault" <<a href="mailto:Matthew.Arsenault@amd.com" class="">Matthew.Arsenault@amd.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: arsenm<br class="">
Date: Sat Feb 21 15:29:04 2015<br class="">
New Revision: 230147<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230147&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=230147&view=rev</a><br class="">
Log:<br class="">
R600/SI: Don't crash when getting immediate operand size<br class="">
<br class="">
Modified:<br class="">
    llvm/trunk/lib/Target/R600/SIInstrInfo.h<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.h?rev=230147&r1=230146&r2=230147&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.h?rev=230147&r1=230146&r2=230147&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/R600/SIInstrInfo.h (original)<br class="">
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.h Sat Feb 21 15:29:04 2015<br class="">
@@ -254,6 +254,13 @@ public:<br class="">
   // instruction opcode.<br class="">
   unsigned getOpSize(uint16_t Opcode, unsigned OpNo) const {<br class="">
     const MCOperandInfo &OpInfo = get(Opcode).OpInfo[OpNo];<br class="">
+<br class="">
+    if (OpInfo.RegClass == -1) {<br class="">
+      // If this is an immediate operand, this must be a 32-bit literal.<br class="">
+      assert(OpInfo.OperandType == MCOI::OPERAND_IMMEDIATE);<br class="">
+      return 4;<br class="">
+    }<br class="">
+<br class="">
     return RI.getRegClass(OpInfo.RegClass)->getSize();<br class="">
   }<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>