mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Migrate some of PPC away from the use of bare getSubtarget/getSubtargetImpl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227547 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31f58f2c74
commit
87dd120c6a
@ -230,7 +230,8 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicBlock *BB) {
|
||||
|
||||
if (!TM)
|
||||
return true;
|
||||
const TargetLowering *TLI = TM->getSubtargetImpl()->getTargetLowering();
|
||||
const TargetLowering *TLI =
|
||||
TM->getSubtargetImpl(*BB->getParent())->getTargetLowering();
|
||||
|
||||
if (Function *F = CI->getCalledFunction()) {
|
||||
// Most intrinsics don't become function calls, but some might.
|
||||
|
@ -85,18 +85,19 @@ typedef struct Address {
|
||||
class PPCFastISel final : public FastISel {
|
||||
|
||||
const TargetMachine &TM;
|
||||
const PPCSubtarget *PPCSubTarget;
|
||||
const TargetInstrInfo &TII;
|
||||
const TargetLowering &TLI;
|
||||
const PPCSubtarget *PPCSubTarget;
|
||||
LLVMContext *Context;
|
||||
|
||||
public:
|
||||
explicit PPCFastISel(FunctionLoweringInfo &FuncInfo,
|
||||
const TargetLibraryInfo *LibInfo)
|
||||
: FastISel(FuncInfo, LibInfo), TM(FuncInfo.MF->getTarget()),
|
||||
TII(*TM.getSubtargetImpl()->getInstrInfo()),
|
||||
TLI(*TM.getSubtargetImpl()->getTargetLowering()),
|
||||
PPCSubTarget(&TM.getSubtarget<PPCSubtarget>()),
|
||||
PPCSubTarget(
|
||||
&static_cast<const PPCSubtarget &>(FuncInfo.MF->getSubtarget())),
|
||||
TII(*PPCSubTarget->getInstrInfo()),
|
||||
TLI(*PPCSubTarget->getTargetLowering()),
|
||||
Context(&FuncInfo.Fn->getContext()) {}
|
||||
|
||||
// Backend specific FastISel code.
|
||||
@ -2298,13 +2299,11 @@ namespace llvm {
|
||||
// Create the fast instruction selector for PowerPC64 ELF.
|
||||
FastISel *PPC::createFastISel(FunctionLoweringInfo &FuncInfo,
|
||||
const TargetLibraryInfo *LibInfo) {
|
||||
const TargetMachine &TM = FuncInfo.MF->getTarget();
|
||||
|
||||
// Only available on 64-bit ELF for now.
|
||||
const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
|
||||
if (Subtarget->isPPC64() && Subtarget->isSVR4ABI())
|
||||
const PPCSubtarget &Subtarget =
|
||||
static_cast<const PPCSubtarget &>(FuncInfo.MF->getSubtarget());
|
||||
if (Subtarget.isPPC64() && Subtarget.isSVR4ABI())
|
||||
return new PPCFastISel(FuncInfo, LibInfo);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user