summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-06-07 20:28:55 +0000
committerBill Wendling <isanbard@gmail.com>2013-06-07 20:28:55 +0000
commit37e9adb091199e9c6cfb9af7b7f0088eda428446 (patch)
tree248de499fe68220167b1def42ed1b856731b22e0 /llvm/lib/Target/R600/AMDILCFGStructurizer.cpp
parent3498e4ff1d3a54e49edbb1b33a06ef3bf1a624a0 (diff)
downloadbcm5719-llvm-37e9adb091199e9c6cfb9af7b7f0088eda428446.tar.gz
bcm5719-llvm-37e9adb091199e9c6cfb9af7b7f0088eda428446.zip
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change. No functionality change intended. llvm-svn: 183561
Diffstat (limited to 'llvm/lib/Target/R600/AMDILCFGStructurizer.cpp')
-rw-r--r--llvm/lib/Target/R600/AMDILCFGStructurizer.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp b/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp
index fcb5b7ed4b7..ea1a07ebb61 100644
--- a/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp
+++ b/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp
@@ -2472,23 +2472,26 @@ public:
protected:
TargetMachine &TM;
- const TargetInstrInfo *TII;
- const AMDGPURegisterInfo *TRI;
public:
AMDGPUCFGStructurizer(char &pid, TargetMachine &tm);
const TargetInstrInfo *getTargetInstrInfo() const;
+ const AMDGPURegisterInfo *getTargetRegisterInfo() const;
};
} // end anonymous namespace
AMDGPUCFGStructurizer::AMDGPUCFGStructurizer(char &pid, TargetMachine &tm)
-: MachineFunctionPass(pid), TM(tm), TII(tm.getInstrInfo()),
- TRI(static_cast<const AMDGPURegisterInfo *>(tm.getRegisterInfo())) {
+ : MachineFunctionPass(pid), TM(tm) {
}
const TargetInstrInfo *AMDGPUCFGStructurizer::getTargetInstrInfo() const {
- return TII;
+ return TM.getInstrInfo();
+}
+
+const AMDGPURegisterInfo *AMDGPUCFGStructurizer::getTargetRegisterInfo() const {
+ return static_cast<const AMDGPURegisterInfo *>(TM.getRegisterInfo());
}
+
//===----------------------------------------------------------------------===//
//
// CFGPrepare
@@ -3017,7 +3020,8 @@ FunctionPass *llvm::createAMDGPUCFGPreparationPass(TargetMachine &tm) {
}
bool AMDGPUCFGPrepare::runOnMachineFunction(MachineFunction &func) {
- return CFGStructurizer<AMDGPUCFGStructurizer>().prepare(func, *this, TRI);
+ return CFGStructurizer<AMDGPUCFGStructurizer>().prepare(func, *this,
+ getTargetRegisterInfo());
}
// createAMDGPUCFGStructurizerPass- Returns a pass
@@ -3026,5 +3030,6 @@ FunctionPass *llvm::createAMDGPUCFGStructurizerPass(TargetMachine &tm) {
}
bool AMDGPUCFGPerform::runOnMachineFunction(MachineFunction &func) {
- return CFGStructurizer<AMDGPUCFGStructurizer>().run(func, *this, TRI);
+ return CFGStructurizer<AMDGPUCFGStructurizer>().run(func, *this,
+ getTargetRegisterInfo());
}
OpenPOWER on IntegriCloud