All addressing modes are now exposed. The only remaining relocated forms
are for function prologue.
TODO: move external symbols over to using RelLit.
: have a pattern that matches constpool|globaladdr
: have a pattern that matches (add x imm) -> x, imm or (...) -> ..., 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25003 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp
index 80e18e7..e6a0664 100644
--- a/lib/Target/Alpha/AlphaISelPattern.cpp
+++ b/lib/Target/Alpha/AlphaISelPattern.cpp
@@ -744,20 +744,13 @@
else assert(0 && "unknown Lo part");
return Result;
- case ISD::GlobalAddress:
- AlphaLowering.restoreGP(BB);
- has_sym = true;
-
- Reg = Result = MakeReg(MVT::i64);
-
- if (EnableAlphaLSMark)
- BuildMI(BB, Alpha::MEMLABEL, 4).addImm(5).addImm(0).addImm(0)
- .addImm(getUID());
-
+ case AlphaISD::RelLit: {
+ GlobalAddressSDNode *GASD = cast<GlobalAddressSDNode>(N.getOperand(0));
BuildMI(BB, Alpha::LDQl, 2, Result)
- .addGlobalAddress(cast<GlobalAddressSDNode>(N)->getGlobal())
- .addReg(Alpha::R29);
+ .addGlobalAddress(GASD->getGlobal())
+ .addReg(SelectExpr(N.getOperand(1)));
return Result;
+ }
case ISD::ExternalSymbol:
AlphaLowering.restoreGP(BB);