mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Have MachineFunction cache a pointer to the subtarget to make lookups
shorter/easier and have the DAG use that to do the same lookup. This can be used in the future for TargetMachine based caching lookups from the MachineFunction easily. Update the MIPS subtarget switching machinery to update this pointer at the same time it runs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,6 +39,7 @@ class MachineModuleInfo;
|
||||
class MCContext;
|
||||
class Pass;
|
||||
class TargetMachine;
|
||||
class TargetSubtargetInfo;
|
||||
class TargetRegisterClass;
|
||||
struct MachinePointerInfo;
|
||||
|
||||
@@ -76,6 +77,7 @@ struct MachineFunctionInfo {
|
||||
class MachineFunction {
|
||||
const Function *Fn;
|
||||
const TargetMachine &Target;
|
||||
const TargetSubtargetInfo *STI;
|
||||
MCContext &Ctx;
|
||||
MachineModuleInfo &MMI;
|
||||
GCModuleInfo *GMI;
|
||||
@@ -163,6 +165,11 @@ public:
|
||||
///
|
||||
const TargetMachine &getTarget() const { return Target; }
|
||||
|
||||
/// getSubtarget - Return the subtarget for which this machine code is being
|
||||
/// compiled.
|
||||
const TargetSubtargetInfo &getSubtarget() const { return *STI; }
|
||||
void setSubtarget(TargetSubtargetInfo *ST) { STI = ST; }
|
||||
|
||||
/// getRegInfo - Return information about the registers currently in use.
|
||||
///
|
||||
MachineRegisterInfo &getRegInfo() { return *RegInfo; }
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/ilist.h"
|
||||
#include "llvm/CodeGen/DAGCombine.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/SelectionDAGNodes.h"
|
||||
#include "llvm/Support/RecyclingAllocator.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@@ -276,6 +277,7 @@ public:
|
||||
|
||||
MachineFunction &getMachineFunction() const { return *MF; }
|
||||
const TargetMachine &getTarget() const { return TM; }
|
||||
const TargetSubtargetInfo &getSubtarget() const { return MF->getSubtarget(); }
|
||||
const TargetLowering &getTargetLoweringInfo() const { return *TLI; }
|
||||
const TargetSelectionDAGInfo &getSelectionDAGInfo() const { return TSI; }
|
||||
LLVMContext *getContext() const {return Context; }
|
||||
|
Reference in New Issue
Block a user