<p dir="ltr">Is this nor testable?</p>
<div class="gmail_quote">On Oct 8, 2015 12:41 AM, "Jonas Paulsson via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jonpa<br>
Date: Thu Oct  8 02:40:11 2015<br>
New Revision: 249663<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=249663&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=249663&view=rev</a><br>
Log:<br>
[SystemZ] More minor fixing in SystemZElimCompare.cpp<br>
<br>
Don't use subreg indices since they are not used after regalloc.<br>
<br>
Reviewed by Ulrich Weigand.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp?rev=249663&r1=249662&r2=249663&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp?rev=249663&r1=249662&r2=249663&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp (original)<br>
+++ llvm/trunk/lib/Target/SystemZ/SystemZElimCompare.cpp Thu Oct  8 02:40:11 2015<br>
@@ -104,14 +104,12 @@ static bool isCCLiveOut(MachineBasicBloc<br>
   return false;<br>
 }<br>
<br>
-// Return true if any CC result of MI would reflect the value of subreg<br>
-// SubReg of Reg.<br>
-static bool resultTests(MachineInstr *MI, unsigned Reg, unsigned SubReg) {<br>
+// Return true if any CC result of MI would reflect the value of Reg.<br>
+static bool resultTests(MachineInstr *MI, unsigned Reg) {<br>
   if (MI->getNumOperands() > 0 &&<br>
       MI->getOperand(0).isReg() &&<br>
       MI->getOperand(0).isDef() &&<br>
-      MI->getOperand(0).getReg() == Reg &&<br>
-      MI->getOperand(0).getSubReg() == SubReg)<br>
+      MI->getOperand(0).getReg() == Reg)<br>
     return true;<br>
<br>
   switch (MI->getOpcode()) {<br>
@@ -127,8 +125,7 @@ static bool resultTests(MachineInstr *MI<br>
   case SystemZ::LTEBR:<br>
   case SystemZ::LTDBR:<br>
   case SystemZ::LTXBR:<br>
-    if (MI->getOperand(1).getReg() == Reg &&<br>
-        MI->getOperand(1).getSubReg() == SubReg)<br>
+    if (MI->getOperand(1).getReg() == Reg)<br>
       return true;<br>
   }<br>
<br>
@@ -326,7 +323,6 @@ optimizeCompareZero(MachineInstr *Compar<br>
<br>
   // Search back for CC results that are based on the first operand.<br>
   unsigned SrcReg = Compare->getOperand(0).getReg();<br>
-  unsigned SrcSubReg = Compare->getOperand(0).getSubReg();<br>
   MachineBasicBlock &MBB = *Compare->getParent();<br>
   MachineBasicBlock::iterator MBBI = Compare, MBBE = MBB.begin();<br>
   Reference CCRefs;<br>
@@ -334,7 +330,7 @@ optimizeCompareZero(MachineInstr *Compar<br>
   while (MBBI != MBBE) {<br>
     --MBBI;<br>
     MachineInstr *MI = MBBI;<br>
-    if (resultTests(MI, SrcReg, SrcSubReg)) {<br>
+    if (resultTests(MI, SrcReg)) {<br>
       // Try to remove both MI and Compare by converting a branch to BRCT(G).<br>
       // We don't care in this case whether CC is modified between MI and<br>
       // Compare.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>