Skip to content

Commit

Permalink
Remove getTargetLowering from TargetPassConfig as the target lowering
Browse files Browse the repository at this point in the history
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
  • Loading branch information
echristo committed May 21, 2014
1 parent 9bfc3f5 commit 5fe59a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 0 additions & 4 deletions include/llvm/CodeGen/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ class TargetPassConfig : public ImmutablePass {
return *static_cast<TMC*>(TM);
}

const TargetLowering *getTargetLowering() const {
return TM->getTargetLowering();
}

//
void setInitialized() { Initialized = true; }

Expand Down
9 changes: 8 additions & 1 deletion lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions lib/Target/Hexagon/HexagonTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5fe59a2

Please sign in to comment.