[llvm-commits] [llvm] r74272 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Chris Lattner
sabre at nondot.org
Thu Jun 25 22:51:45 PDT 2009
Author: lattner
Date: Fri Jun 26 00:51:45 2009
New Revision: 74272
URL: http://llvm.org/viewvc/llvm-project?rev=74272&view=rev
Log:
propagate target operand flags through addressing mode selection.
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=74272&r1=74271&r2=74272&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Fri Jun 26 00:51:45 2009
@@ -75,10 +75,11 @@
const char *ES;
int JT;
unsigned Align; // CP alignment.
+ unsigned char SymbolFlags; // X86II::MO_*
X86ISelAddressMode()
: BaseType(RegBase), isRIPRel(false), Scale(1), IndexReg(), Disp(0),
- Segment(), GV(0), CP(0), ES(0), JT(-1), Align(0) {
+ Segment(), GV(0), CP(0), ES(0), JT(-1), Align(0), SymbolFlags(0) {
}
bool hasSymbolicDisplacement() const {
@@ -200,14 +201,15 @@
// These are 32-bit even in 64-bit mode since RIP relative offset
// is 32-bit.
if (AM.GV)
- Disp = CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32, AM.Disp);
+ Disp = CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32, AM.Disp,
+ AM.SymbolFlags);
else if (AM.CP)
Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i32,
- AM.Align, AM.Disp);
+ AM.Align, AM.Disp, AM.SymbolFlags);
else if (AM.ES)
- Disp = CurDAG->getTargetExternalSymbol(AM.ES, MVT::i32);
+ Disp = CurDAG->getTargetExternalSymbol(AM.ES, MVT::i32, AM.SymbolFlags);
else if (AM.JT != -1)
- Disp = CurDAG->getTargetJumpTable(AM.JT, MVT::i32);
+ Disp = CurDAG->getTargetJumpTable(AM.JT, MVT::i32, AM.SymbolFlags);
else
Disp = CurDAG->getTargetConstant(AM.Disp, MVT::i32);
@@ -720,6 +722,7 @@
AM.GV = GV;
AM.Disp += Offset;
AM.isRIPRel = isRIPRel;
+ AM.SymbolFlags = G->getTargetFlags();
return false;
}
} else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(N0)) {
@@ -729,15 +732,18 @@
AM.Align = CP->getAlignment();
AM.Disp += Offset;
AM.isRIPRel = SymbolicAddressesAreRIPRel;
+ AM.SymbolFlags = G->getTargetFlags();
return false;
}
- } else if (ExternalSymbolSDNode *S =dyn_cast<ExternalSymbolSDNode>(N0)) {
+ } else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(N0)) {
AM.ES = S->getSymbol();
AM.isRIPRel = SymbolicAddressesAreRIPRel;
+ AM.SymbolFlags = S->getTargetFlags();
return false;
} else if (JumpTableSDNode *J = dyn_cast<JumpTableSDNode>(N0)) {
AM.JT = J->getIndex();
AM.isRIPRel = SymbolicAddressesAreRIPRel;
+ AM.SymbolFlags = J->getTargetFlags();
return false;
}
More information about the llvm-commits
mailing list