Remove getTargetLowering from TargetPassConfig as the target lowering

can change depending upon subtarget/subtarget features for a function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209329 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2014-05-21 22:42:07 +00:00
parent 9bfc3f592d
commit 5fe59a2e10
3 changed files with 10 additions and 11 deletions

View File

@ -133,10 +133,6 @@ public:
return *static_cast<TMC*>(TM);
}
const TargetLowering *getTargetLowering() const {
return TM->getTargetLowering();
}
//
void setInitialized() { Initialized = true; }

View File

@ -17,9 +17,10 @@
//
//===----------------------------------------------------------------------===//
#include "HexagonTargetMachine.h"
#include "HexagonMachineFunctionInfo.h"
#include "HexagonSubtarget.h"
#include "HexagonTargetMachine.h"
#include "HexagonTargetObjectFile.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LatencyPriorityQueue.h"
#include "llvm/CodeGen/MachineDominators.h"
@ -66,6 +67,12 @@ char HexagonSplitConst32AndConst64::ID = 0;
bool HexagonSplitConst32AndConst64::runOnMachineFunction(MachineFunction &Fn) {
const HexagonTargetObjectFile &TLOF =
(const HexagonTargetObjectFile &)
QTM.getTargetLowering()->getObjFileLowering();
if (TLOF.IsSmallDataEnabled())
return true;
const TargetInstrInfo *TII = QTM.getInstrInfo();
// Loop over all of the basic blocks

View File

@ -150,16 +150,12 @@ bool HexagonPassConfig::addPostRegAlloc() {
bool HexagonPassConfig::addPreSched2() {
const HexagonTargetMachine &TM = getHexagonTargetMachine();
const HexagonTargetObjectFile &TLOF =
(const HexagonTargetObjectFile &)getTargetLowering()->getObjFileLowering();
addPass(createHexagonCopyToCombine());
if (getOptLevel() != CodeGenOpt::None)
addPass(&IfConverterID);
if (!TLOF.IsSmallDataEnabled()) {
addPass(createHexagonSplitConst32AndConst64(TM));
printAndVerify("After hexagon split const32/64 pass");
}
addPass(createHexagonSplitConst32AndConst64(TM));
printAndVerify("After hexagon split const32/64 pass");
return true;
}