[llvm] r191711 - The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress

Preston Gurd preston.gurd at intel.com
Mon Sep 30 16:18:42 PDT 2013


Author: pgurd
Date: Mon Sep 30 18:18:42 2013
New Revision: 191711

URL: http://llvm.org/viewvc/llvm-project?rev=191711&view=rev
Log:
The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress
on ADD16rr opcodes, if src1 != src, since that would cause 
convertToThreeAddress to try to create a virtual register. This is not
permitted after register allocation, which is when the X86FixupLEAs pass
runs.

This patch fixes PR16785.


Modified:
    llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp

Modified: llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp?rev=191711&r1=191710&r2=191711&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp Mon Sep 30 18:18:42 2013
@@ -125,6 +125,14 @@ FixupLEAPass::postRAConvertToLEA(Machine
       // which requires isImm() to be true
       return 0;
     }
+  case X86::ADD16rr:
+  case X86::ADD16rr_DB:
+    if (MI->getOperand(1).getReg() != MI->getOperand(2).getReg()) {
+      // if src1 != src2, then convertToThreeAddress will
+      // need to create a Virtual register, which we cannot do
+      // after register allocation.
+      return 0;
+    }
   }
   return TII->convertToThreeAddress(MFI, MBBI, 0);
 }





More information about the llvm-commits mailing list