[llvm] r320811 - Fix the second build bot break introduced by r320791.

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 06:17:45 PST 2017


Author: nemanjai
Date: Fri Dec 15 06:17:45 2017
New Revision: 320811

URL: http://llvm.org/viewvc/llvm-project?rev=320811&view=rev
Log:
Fix the second build bot break introduced by r320791.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp?rev=320811&r1=320810&r2=320811&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Fri Dec 15 06:17:45 2017
@@ -2286,6 +2286,13 @@ MachineInstr *PPCInstrInfo::getConstantD
         MachineBasicBlock::reverse_iterator E = MI.getParent()->rend(), It = MI;
         It++;
         unsigned Reg = MI.getOperand(i).getReg();
+        // MachineInstr::readsRegister only returns true if the machine
+        // instruction reads the exact register or its super-register. It
+        // does not consider uses of sub-registers which seems like strange
+        // behaviour. Nonetheless, if we end up with a 64-bit register here,
+        // get the corresponding 32-bit register to check.
+        if (PPC::G8RCRegClass.contains(Reg))
+          Reg = Reg - PPC::X0 + PPC::R0;
 
         // Is this register defined by a load-immediate in this block?
         for ( ; It != E; ++It) {




More information about the llvm-commits mailing list