summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-03-21 03:13:10 +0000
committerEric Christopher <echristo@gmail.com>2015-03-21 03:13:10 +0000
commitc5a85af3b23b958f1c86768b7622503d76761966 (patch)
treeaeee4a24c27d615f149cdd235b81ddf4abb4b463 /llvm/lib/CodeGen
parentcba722f8c13c8a52cf81a09ab4ad19478bb82e6e (diff)
downloadbcm5719-llvm-c5a85af3b23b958f1c86768b7622503d76761966.tar.gz
bcm5719-llvm-c5a85af3b23b958f1c86768b7622503d76761966.zip
Cache the Function dependent subtarget on the MachineFunction.
As preparation for removing the getSubtargetImpl() call from TargetMachine go ahead and flip the switch on caching the function dependent subtarget and remove the bare getSubtargetImpl call from the X86 port. As part of this add a few tests that show we can generate code and assemble on X86 based on features/cpu on the Function. llvm-svn: 232879
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 4cd584ee9d1..9c90334c712 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -54,7 +54,7 @@ void ilist_traits<MachineBasicBlock>::deleteNode(MachineBasicBlock *MBB) {
MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
unsigned FunctionNum, MachineModuleInfo &mmi)
- : Fn(F), Target(TM), STI(TM.getSubtargetImpl()), Ctx(mmi.getContext()),
+ : Fn(F), Target(TM), STI(TM.getSubtargetImpl(*F)), Ctx(mmi.getContext()),
MMI(mmi) {
if (STI->getRegisterInfo())
RegInfo = new (Allocator) MachineRegisterInfo(this);
OpenPOWER on IntegriCloud