Fix a x86-64 static codegen bug. This fixes a lot of x86-64 jit failures.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 8 Jan 2008 02:06:11 +0000 (02:06 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 8 Jan 2008 02:06:11 +0000 (02:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45733 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelDAGToDAG.cpp

index bc2870ed24ce3ec5e15be8383485ecde60d53bc5..9887bcccef41b52ff0435ed1871ba4d20f195adb 100644 (file)
@@ -1091,7 +1091,10 @@ SDNode *X86DAGToDAGISel::Select(SDOperand N) {
       // Turn ADD X, c to MOV32ri X+c. This cannot be done with tblgen'd
       // code and is matched first so to prevent it from being turned into
       // LEA32r X+c.
-      // In 64-bit mode, use LEA to take advantage of RIP-relative addressing.
+      // In 64-bit small code size mode, use LEA to take advantage of
+      // RIP-relative addressing.
+      if (TM.getCodeModel() != CodeModel::Small)
+        break;
       MVT::ValueType PtrVT = TLI.getPointerTy();
       SDOperand N0 = N.getOperand(0);
       SDOperand N1 = N.getOperand(1);