<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 21, 2014 at 10:27 AM, Matt Arsenault <span dir="ltr"><<a href="mailto:Matthew.Arsenault@amd.com" target="_blank">Matthew.Arsenault@amd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: arsenm<br>
Date: Sun Sep 21 12:27:31 2014<br>
New Revision: 218222<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218222&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=218222&view=rev</a><br>
Log:<br>
Use llvm_unreachable instead of assert(!)<br>
<br>
Modified:<br>
    llvm/trunk/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp?rev=218222&r1=218221&r2=218222&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp?rev=218222&r1=218221&r2=218222&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp (original)<br>
+++ llvm/trunk/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp Sun Sep 21 12:27:31 2014<br>
@@ -232,7 +232,7 @@ void AMDGPUInstPrinter::printOperand(con<br>
     const MCExpr *Exp = Op.getExpr();<br>
     Exp->print(O);<br>
   } else {<br>
-    assert(!"unknown operand type in printOperand");<br>
+    llvm_unreachable("unknown operand type in printOperand");<br></blockquote><div><br></div><div>Alternatively you could remove the previous if condition (isExpr) and replace it with an assertion (actually I assume getExpr already has such an assertion?) So the compiler doesn't have to work so hard to remove the isExpr (even though the unreachable proves the isExpr is always true, if it can't prove the absence of side effects it's still going to keep the call in the code just in case)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   }<br>
 }<br>
<br>
@@ -259,7 +259,7 @@ void AMDGPUInstPrinter::printInterpSlot(<br>
   } else if (Imm == 0) {<br>
     O << "P10";<br>
   } else {<br>
-    assert(!"Invalid interpolation parameter slot");<br>
+    llvm_unreachable("Invalid interpolation parameter slot");<br></blockquote><div><br></div><div>Similarly here.<br><br>(not always the better choice, mind you - sometimes keeping the code structure and just putting unreachable at the end keeps the code more consistent, etc)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   }<br>
 }<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>