mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Use the cached subtarget from the MachineFunction rather than
doing a lookup on the TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229995 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -117,7 +117,7 @@ bool X86CallFrameOptimization::isLegal(MachineFunction &MF) {
|
|||||||
// No point in running this in 64-bit mode, since some arguments are
|
// No point in running this in 64-bit mode, since some arguments are
|
||||||
// passed in-register in all common calling conventions, so the pattern
|
// passed in-register in all common calling conventions, so the pattern
|
||||||
// we're looking for will never match.
|
// we're looking for will never match.
|
||||||
const X86Subtarget &STI = MF.getTarget().getSubtarget<X86Subtarget>();
|
const X86Subtarget &STI = MF.getSubtarget<X86Subtarget>();
|
||||||
if (STI.is64Bit())
|
if (STI.is64Bit())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ bool X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
|
|||||||
|
|
||||||
// If PUSHrmm is not slow on this target, try to fold the source of the
|
// If PUSHrmm is not slow on this target, try to fold the source of the
|
||||||
// push into the instruction.
|
// push into the instruction.
|
||||||
const X86Subtarget &ST = MF.getTarget().getSubtarget<X86Subtarget>();
|
const X86Subtarget &ST = MF.getSubtarget<X86Subtarget>();
|
||||||
bool SlowPUSHrmm = ST.isAtom() || ST.isSLM();
|
bool SlowPUSHrmm = ST.isAtom() || ST.isSLM();
|
||||||
|
|
||||||
// Check that this is legal to fold. Right now, we're extremely
|
// Check that this is legal to fold. Right now, we're extremely
|
||||||
|
@@ -88,7 +88,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MachineFunction *MF;
|
MachineFunction *MF;
|
||||||
const TargetMachine *TM;
|
|
||||||
const X86InstrInfo *TII; // Machine instruction info.
|
const X86InstrInfo *TII; // Machine instruction info.
|
||||||
};
|
};
|
||||||
char FixupLEAPass::ID = 0;
|
char FixupLEAPass::ID = 0;
|
||||||
@@ -150,8 +149,7 @@ FunctionPass *llvm::createX86FixupLEAs() { return new FixupLEAPass(); }
|
|||||||
|
|
||||||
bool FixupLEAPass::runOnMachineFunction(MachineFunction &Func) {
|
bool FixupLEAPass::runOnMachineFunction(MachineFunction &Func) {
|
||||||
MF = &Func;
|
MF = &Func;
|
||||||
TM = &Func.getTarget();
|
const X86Subtarget &ST = Func.getSubtarget<X86Subtarget>();
|
||||||
const X86Subtarget &ST = TM->getSubtarget<X86Subtarget>();
|
|
||||||
if (!ST.LEAusesAG() && !ST.slowLEA())
|
if (!ST.LEAusesAG() && !ST.slowLEA())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -332,7 +330,7 @@ bool FixupLEAPass::processBasicBlock(MachineFunction &MF,
|
|||||||
MachineFunction::iterator MFI) {
|
MachineFunction::iterator MFI) {
|
||||||
|
|
||||||
for (MachineBasicBlock::iterator I = MFI->begin(); I != MFI->end(); ++I) {
|
for (MachineBasicBlock::iterator I = MFI->begin(); I != MFI->end(); ++I) {
|
||||||
if (TM->getSubtarget<X86Subtarget>().isSLM())
|
if (MF.getSubtarget<X86Subtarget>().isSLM())
|
||||||
processInstructionForSLM(I, MFI);
|
processInstructionForSLM(I, MFI);
|
||||||
else
|
else
|
||||||
processInstruction(I, MFI);
|
processInstruction(I, MFI);
|
||||||
|
Reference in New Issue
Block a user