mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-18 06:38:41 +00:00
t2ldrpci_pic can be used for blockaddress as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86400 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f1c104fb32
commit
bf992817f2
@ -16,6 +16,8 @@
|
|||||||
#include "ARMConstantPoolValue.h"
|
#include "ARMConstantPoolValue.h"
|
||||||
#include "ARMGenInstrInfo.inc"
|
#include "ARMGenInstrInfo.inc"
|
||||||
#include "ARMMachineFunctionInfo.h"
|
#include "ARMMachineFunctionInfo.h"
|
||||||
|
#include "llvm/Constants.h"
|
||||||
|
#include "llvm/Function.h"
|
||||||
#include "llvm/GlobalValue.h"
|
#include "llvm/GlobalValue.h"
|
||||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||||
@ -290,10 +292,19 @@ void Thumb1InstrInfo::reMaterialize(MachineBasicBlock &MBB,
|
|||||||
"Expecting a machine constantpool entry!");
|
"Expecting a machine constantpool entry!");
|
||||||
ARMConstantPoolValue *ACPV =
|
ARMConstantPoolValue *ACPV =
|
||||||
static_cast<ARMConstantPoolValue*>(MCPE.Val.MachineCPVal);
|
static_cast<ARMConstantPoolValue*>(MCPE.Val.MachineCPVal);
|
||||||
assert(ACPV->isGlobalValue() && "Expecting a GV!");
|
|
||||||
unsigned PCLabelId = AFI->createConstPoolEntryUId();
|
unsigned PCLabelId = AFI->createConstPoolEntryUId();
|
||||||
ARMConstantPoolValue *NewCPV =
|
ARMConstantPoolValue *NewCPV = 0;
|
||||||
new ARMConstantPoolValue(ACPV->getGV(), PCLabelId, ARMCP::CPValue, 4);
|
if (ACPV->isGlobalValue())
|
||||||
|
NewCPV = new ARMConstantPoolValue(ACPV->getGV(), PCLabelId,
|
||||||
|
ARMCP::CPValue, 4);
|
||||||
|
else if (ACPV->isExtSymbol())
|
||||||
|
NewCPV = new ARMConstantPoolValue(MF.getFunction()->getContext(),
|
||||||
|
ACPV->getSymbol(), PCLabelId, 4);
|
||||||
|
else if (ACPV->isBlockAddress())
|
||||||
|
NewCPV = new ARMConstantPoolValue(ACPV->getBlockAddress(), PCLabelId,
|
||||||
|
ARMCP::CPBlockAddress, 4);
|
||||||
|
else
|
||||||
|
llvm_unreachable("Unexpected ARM constantpool value type!!");
|
||||||
CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());
|
CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());
|
||||||
MachineInstrBuilder MIB = BuildMI(MBB, I, Orig->getDebugLoc(), get(Opcode),
|
MachineInstrBuilder MIB = BuildMI(MBB, I, Orig->getDebugLoc(), get(Opcode),
|
||||||
DestReg)
|
DestReg)
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
#include "ARMAddressingModes.h"
|
#include "ARMAddressingModes.h"
|
||||||
#include "ARMGenInstrInfo.inc"
|
#include "ARMGenInstrInfo.inc"
|
||||||
#include "ARMMachineFunctionInfo.h"
|
#include "ARMMachineFunctionInfo.h"
|
||||||
|
#include "llvm/Constants.h"
|
||||||
|
#include "llvm/Function.h"
|
||||||
#include "llvm/GlobalValue.h"
|
#include "llvm/GlobalValue.h"
|
||||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||||
@ -158,10 +160,19 @@ void Thumb2InstrInfo::reMaterialize(MachineBasicBlock &MBB,
|
|||||||
"Expecting a machine constantpool entry!");
|
"Expecting a machine constantpool entry!");
|
||||||
ARMConstantPoolValue *ACPV =
|
ARMConstantPoolValue *ACPV =
|
||||||
static_cast<ARMConstantPoolValue*>(MCPE.Val.MachineCPVal);
|
static_cast<ARMConstantPoolValue*>(MCPE.Val.MachineCPVal);
|
||||||
assert(ACPV->isGlobalValue() && "Expecting a GV!");
|
|
||||||
unsigned PCLabelId = AFI->createConstPoolEntryUId();
|
unsigned PCLabelId = AFI->createConstPoolEntryUId();
|
||||||
ARMConstantPoolValue *NewCPV =
|
ARMConstantPoolValue *NewCPV = 0;
|
||||||
new ARMConstantPoolValue(ACPV->getGV(), PCLabelId, ARMCP::CPValue, 4);
|
if (ACPV->isGlobalValue())
|
||||||
|
NewCPV = new ARMConstantPoolValue(ACPV->getGV(), PCLabelId,
|
||||||
|
ARMCP::CPValue, 4);
|
||||||
|
else if (ACPV->isExtSymbol())
|
||||||
|
NewCPV = new ARMConstantPoolValue(MF.getFunction()->getContext(),
|
||||||
|
ACPV->getSymbol(), PCLabelId, 4);
|
||||||
|
else if (ACPV->isBlockAddress())
|
||||||
|
NewCPV = new ARMConstantPoolValue(ACPV->getBlockAddress(), PCLabelId,
|
||||||
|
ARMCP::CPBlockAddress, 4);
|
||||||
|
else
|
||||||
|
llvm_unreachable("Unexpected ARM constantpool value type!!");
|
||||||
CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());
|
CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());
|
||||||
MachineInstrBuilder MIB = BuildMI(MBB, I, Orig->getDebugLoc(), get(Opcode),
|
MachineInstrBuilder MIB = BuildMI(MBB, I, Orig->getDebugLoc(), get(Opcode),
|
||||||
DestReg)
|
DestReg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user