mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Force non-darwin targets to use a static relo model. This fixes PR734,
tested by CodeGen/Generic/vector.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27657 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8981f06a44
commit
a39d798e0a
@ -805,7 +805,10 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
||||
SDOperand CPI = DAG.getTargetConstantPool(C, MVT::i32, CP->getAlignment());
|
||||
SDOperand Zero = DAG.getConstant(0, MVT::i32);
|
||||
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::Static) {
|
||||
// If this is a non-darwin platform, we don't support non-static relo models
|
||||
// yet.
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::Static ||
|
||||
!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) {
|
||||
// Generate non-pic code that has direct accesses to the constant pool.
|
||||
// The address of the global is just (hi(&g)+lo(&g)).
|
||||
SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, CPI, Zero);
|
||||
@ -813,8 +816,6 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
||||
return DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo);
|
||||
}
|
||||
|
||||
// Only lower ConstantPool on Darwin.
|
||||
if (!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) break;
|
||||
SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, CPI, Zero);
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC) {
|
||||
// With PIC, the first instruction is actually "GR+hi(&G)".
|
||||
@ -832,7 +833,10 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
||||
SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i32, GSDN->getOffset());
|
||||
SDOperand Zero = DAG.getConstant(0, MVT::i32);
|
||||
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::Static) {
|
||||
// If this is a non-darwin platform, we don't support non-static relo models
|
||||
// yet.
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::Static ||
|
||||
!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) {
|
||||
// Generate non-pic code that has direct accesses to globals.
|
||||
// The address of the global is just (hi(&g)+lo(&g)).
|
||||
SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, GA, Zero);
|
||||
@ -840,9 +844,6 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
||||
return DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo);
|
||||
}
|
||||
|
||||
// Only lower GlobalAddress on Darwin.
|
||||
if (!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) break;
|
||||
|
||||
SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, GA, Zero);
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC) {
|
||||
// With PIC, the first instruction is actually "GR+hi(&G)".
|
||||
|
Loading…
x
Reference in New Issue
Block a user