mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-04 10:30:01 +00:00
Remove unnecessary caching of the TargetMachine on NVPTXFrameLowering.
Adjust the constructor accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211846 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04c4efc593
commit
9456c7b20a
@ -43,17 +43,21 @@ void NVPTXFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
// cvta.local %SP, %SPL;
|
||||
if (is64bit) {
|
||||
unsigned LocalReg = MRI.createVirtualRegister(&NVPTX::Int64RegsRegClass);
|
||||
MachineInstr *MI = BuildMI(
|
||||
MBB, MBBI, dl, tm.getInstrInfo()->get(NVPTX::cvta_local_yes_64),
|
||||
NVPTX::VRFrame).addReg(LocalReg);
|
||||
BuildMI(MBB, MI, dl, tm.getInstrInfo()->get(NVPTX::MOV_DEPOT_ADDR_64),
|
||||
MachineInstr *MI =
|
||||
BuildMI(MBB, MBBI, dl,
|
||||
MF.getTarget().getInstrInfo()->get(NVPTX::cvta_local_yes_64),
|
||||
NVPTX::VRFrame).addReg(LocalReg);
|
||||
BuildMI(MBB, MI, dl,
|
||||
MF.getTarget().getInstrInfo()->get(NVPTX::MOV_DEPOT_ADDR_64),
|
||||
LocalReg).addImm(MF.getFunctionNumber());
|
||||
} else {
|
||||
unsigned LocalReg = MRI.createVirtualRegister(&NVPTX::Int32RegsRegClass);
|
||||
MachineInstr *MI = BuildMI(
|
||||
MBB, MBBI, dl, tm.getInstrInfo()->get(NVPTX::cvta_local_yes),
|
||||
NVPTX::VRFrame).addReg(LocalReg);
|
||||
BuildMI(MBB, MI, dl, tm.getInstrInfo()->get(NVPTX::MOV_DEPOT_ADDR),
|
||||
MachineInstr *MI =
|
||||
BuildMI(MBB, MBBI, dl,
|
||||
MF.getTarget().getInstrInfo()->get(NVPTX::cvta_local_yes),
|
||||
NVPTX::VRFrame).addReg(LocalReg);
|
||||
BuildMI(MBB, MI, dl,
|
||||
MF.getTarget().getInstrInfo()->get(NVPTX::MOV_DEPOT_ADDR),
|
||||
LocalReg).addImm(MF.getFunctionNumber());
|
||||
}
|
||||
}
|
||||
|
@ -14,19 +14,18 @@
|
||||
#ifndef NVPTX_FRAMELOWERING_H
|
||||
#define NVPTX_FRAMELOWERING_H
|
||||
|
||||
#include "NVPTXSubtarget.h"
|
||||
#include "llvm/Target/TargetFrameLowering.h"
|
||||
|
||||
namespace llvm {
|
||||
class NVPTXTargetMachine;
|
||||
|
||||
class NVPTXFrameLowering : public TargetFrameLowering {
|
||||
NVPTXTargetMachine &tm;
|
||||
bool is64bit;
|
||||
|
||||
public:
|
||||
explicit NVPTXFrameLowering(NVPTXTargetMachine &_tm, bool _is64bit)
|
||||
: TargetFrameLowering(TargetFrameLowering::StackGrowsUp, 8, 0), tm(_tm),
|
||||
is64bit(_is64bit) {}
|
||||
explicit NVPTXFrameLowering(NVPTXSubtarget &STI)
|
||||
: TargetFrameLowering(TargetFrameLowering::StackGrowsUp, 8, 0),
|
||||
is64bit(STI.is64Bit()) {}
|
||||
|
||||
bool hasFP(const MachineFunction &MF) const override;
|
||||
void emitPrologue(MachineFunction &MF) const override;
|
||||
|
@ -85,7 +85,7 @@ NVPTXTargetMachine::NVPTXTargetMachine(const Target &T, StringRef TT,
|
||||
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
|
||||
Subtarget(TT, CPU, FS, is64bit), DL(computeDataLayout(Subtarget)),
|
||||
InstrInfo(Subtarget), TLInfo(*this), TSInfo(&DL),
|
||||
FrameLowering(*this, is64bit) {
|
||||
FrameLowering(Subtarget) {
|
||||
initAsmInfo();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user