mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Bug fix. Passive nodes are not in SUnitMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1599,21 +1599,17 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr, NULL, 0); break;
|
||||
}
|
||||
|
||||
Addr = LD;
|
||||
if (TLI.getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
||||
// For PIC, the sequence is:
|
||||
// BRIND(load(Jumptable + index) + RelocBase)
|
||||
// RelocBase is the JumpTable on PPC and X86, GOT on Alpha
|
||||
SDOperand Reloc;
|
||||
if (TLI.usesGlobalOffsetTable())
|
||||
Reloc = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, PTy);
|
||||
else
|
||||
Reloc = Table;
|
||||
Addr = (PTy != MVT::i32) ? DAG.getNode(ISD::SIGN_EXTEND, PTy, LD) : LD;
|
||||
Addr = DAG.getNode(ISD::ADD, PTy, Addr, Reloc);
|
||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr);
|
||||
} else {
|
||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), LD);
|
||||
// RelocBase can be JumpTable, GOT or some sort of global base.
|
||||
if (PTy != MVT::i32)
|
||||
Addr = DAG.getNode(ISD::SIGN_EXTEND, PTy, Addr);
|
||||
Addr = DAG.getNode(ISD::ADD, PTy, Addr,
|
||||
TLI.getPICJumpTableRelocBase(Table, DAG));
|
||||
}
|
||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user