Migrate to using the subtarget on the machine function and update

all uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-02-02 23:03:45 +00:00
parent 439705d6be
commit 82181dfe51

View File

@ -58,8 +58,8 @@ class X86FastISel final : public FastISel {
public: public:
explicit X86FastISel(FunctionLoweringInfo &funcInfo, explicit X86FastISel(FunctionLoweringInfo &funcInfo,
const TargetLibraryInfo *libInfo) const TargetLibraryInfo *libInfo)
: FastISel(funcInfo, libInfo) { : FastISel(funcInfo, libInfo) {
Subtarget = &TM.getSubtarget<X86Subtarget>(); Subtarget = &funcInfo.MF->getSubtarget<X86Subtarget>();
X86ScalarSSEf64 = Subtarget->hasSSE2(); X86ScalarSSEf64 = Subtarget->hasSSE2();
X86ScalarSSEf32 = Subtarget->hasSSE1(); X86ScalarSSEf32 = Subtarget->hasSSE1();
} }
@ -127,7 +127,7 @@ private:
bool X86SelectFPTrunc(const Instruction *I); bool X86SelectFPTrunc(const Instruction *I);
const X86InstrInfo *getInstrInfo() const { const X86InstrInfo *getInstrInfo() const {
return getTargetMachine()->getSubtargetImpl()->getInstrInfo(); return Subtarget->getInstrInfo();
} }
const X86TargetMachine *getTargetMachine() const { const X86TargetMachine *getTargetMachine() const {
return static_cast<const X86TargetMachine *>(&TM); return static_cast<const X86TargetMachine *>(&TM);
@ -2148,8 +2148,7 @@ bool X86FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
MachineFrameInfo *MFI = FuncInfo.MF->getFrameInfo(); MachineFrameInfo *MFI = FuncInfo.MF->getFrameInfo();
MFI->setFrameAddressIsTaken(true); MFI->setFrameAddressIsTaken(true);
const X86RegisterInfo *RegInfo = static_cast<const X86RegisterInfo *>( const X86RegisterInfo *RegInfo = Subtarget->getRegisterInfo();
TM.getSubtargetImpl()->getRegisterInfo());
unsigned FrameReg = RegInfo->getPtrSizedFrameRegister(*(FuncInfo.MF)); unsigned FrameReg = RegInfo->getPtrSizedFrameRegister(*(FuncInfo.MF));
assert(((FrameReg == X86::RBP && VT == MVT::i64) || assert(((FrameReg == X86::RBP && VT == MVT::i64) ||
(FrameReg == X86::EBP && VT == MVT::i32)) && (FrameReg == X86::EBP && VT == MVT::i32)) &&
@ -2738,8 +2737,7 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
.addImm(NumBytes).addImm(0); .addImm(NumBytes).addImm(0);
// Walk the register/memloc assignments, inserting copies/loads. // Walk the register/memloc assignments, inserting copies/loads.
const X86RegisterInfo *RegInfo = static_cast<const X86RegisterInfo *>( const X86RegisterInfo *RegInfo = Subtarget->getRegisterInfo();
TM.getSubtargetImpl()->getRegisterInfo());
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign const &VA = ArgLocs[i]; CCValAssign const &VA = ArgLocs[i];
const Value *ArgVal = OutVals[VA.getValNo()]; const Value *ArgVal = OutVals[VA.getValNo()];