diff options
| author | Eric Christopher <echristo@gmail.com> | 2014-10-08 07:51:41 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2014-10-08 07:51:41 +0000 |
| commit | 51bedaf223d9da7837a66bf8b621594bebd10385 (patch) | |
| tree | a6970ea6cec23dbb91afb6323a70ca90c579f120 | |
| parent | b17140de3509418d5c383a6ad131ad812f833f0a (diff) | |
| download | bcm5719-llvm-51bedaf223d9da7837a66bf8b621594bebd10385.tar.gz bcm5719-llvm-51bedaf223d9da7837a66bf8b621594bebd10385.zip | |
Use cached subtarget rather than looking it up on the
TargetMachine again.
llvm-svn: 219285
| -rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 97a0c93b48b..6a304abef2d 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -57,7 +57,7 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM, GCModuleInfo *gmi) : Fn(F), Target(TM), STI(TM.getSubtargetImpl()), Ctx(mmi.getContext()), MMI(mmi), GMI(gmi) { - if (TM.getSubtargetImpl()->getRegisterInfo()) + if (STI->getRegisterInfo()) RegInfo = new (Allocator) MachineRegisterInfo(this); else RegInfo = nullptr; @@ -72,15 +72,13 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM, getStackAlignment(AttributeSet::FunctionIndex)); ConstantPool = new (Allocator) MachineConstantPool(TM); - Alignment = - TM.getSubtargetImpl()->getTargetLowering()->getMinFunctionAlignment(); + Alignment = STI->getTargetLowering()->getMinFunctionAlignment(); // FIXME: Shouldn't use pref alignment if explicit alignment is set on Fn. if (!Fn->getAttributes().hasAttribute(AttributeSet::FunctionIndex, Attribute::OptimizeForSize)) - Alignment = std::max( - Alignment, - TM.getSubtargetImpl()->getTargetLowering()->getPrefFunctionAlignment()); + Alignment = std::max(Alignment, + STI->getTargetLowering()->getPrefFunctionAlignment()); FunctionNumber = FunctionNum; JumpTableInfo = nullptr; |

