[llvm-commits] [llvm] r56626 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp
Dan Gohman
gohman at apple.com
Thu Sep 25 16:34:02 PDT 2008
Author: djg
Date: Thu Sep 25 18:34:02 2008
New Revision: 56626
URL: http://llvm.org/viewvc/llvm-project?rev=56626&view=rev
Log:
Fix a bug in which address displacements were being added to the
load from the stub, instead of the result of the load from the stub.
Modified:
llvm/trunk/lib/Target/X86/X86FastISel.cpp
Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=56626&r1=56625&r2=56626&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Thu Sep 25 18:34:02 2008
@@ -427,10 +427,18 @@
Opc = X86::MOV64rm;
RC = X86::GR64RegisterClass;
}
+
+ X86AddressMode StubAM;
+ StubAM.Base.Reg = AM.Base.Reg;
+ StubAM.GV = AM.GV;
unsigned ResultReg = createResultReg(RC);
- addFullAddress(BuildMI(MBB, TII.get(Opc), ResultReg), AM);
+ addFullAddress(BuildMI(MBB, TII.get(Opc), ResultReg), StubAM);
+
+ // Now construct the final address. Note that the Disp, Scale,
+ // and Index values may already be set here.
AM.Base.Reg = ResultReg;
AM.GV = 0;
+
// Prevent loading GV stub multiple times in same MBB.
LocalValueMap[V] = AM.Base.Reg;
}
More information about the llvm-commits
mailing list