forked from OSchip/llvm-project
Add optimization bisect opt-in calls for Hexagon passes
Differential Revision: http://reviews.llvm.org/D19509 llvm-svn: 267593
This commit is contained in:
parent
900cadd3ad
commit
5b444a21df
|
@ -2191,6 +2191,9 @@ bool BitSimplification::processBlock(MachineBasicBlock &B,
|
|||
|
||||
|
||||
bool HexagonBitSimplify::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
auto &HST = MF.getSubtarget<HexagonSubtarget>();
|
||||
auto &HRI = *HST.getRegisterInfo();
|
||||
auto &HII = *HST.getInstrInfo();
|
||||
|
@ -2733,6 +2736,9 @@ bool HexagonLoopRescheduling::processLoop(LoopCand &C) {
|
|||
|
||||
|
||||
bool HexagonLoopRescheduling::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
auto &HST = MF.getSubtarget<HexagonSubtarget>();
|
||||
HII = HST.getInstrInfo();
|
||||
HRI = HST.getRegisterInfo();
|
||||
|
|
|
@ -102,6 +102,9 @@ HexagonCFGOptimizer::InvertAndChangeJumpTarget(MachineInstr* MI,
|
|||
|
||||
|
||||
bool HexagonCFGOptimizer::runOnMachineFunction(MachineFunction &Fn) {
|
||||
if (skipFunction(*Fn.getFunction()))
|
||||
return false;
|
||||
|
||||
// Loop over all of the basic blocks.
|
||||
for (MachineFunction::iterator MBBb = Fn.begin(), MBBe = Fn.end();
|
||||
MBBb != MBBe; ++MBBb) {
|
||||
|
|
|
@ -1268,6 +1268,9 @@ void HexagonCommonGEP::removeDeadCode() {
|
|||
|
||||
|
||||
bool HexagonCommonGEP::runOnFunction(Function &F) {
|
||||
if (skipFunction(F))
|
||||
return false;
|
||||
|
||||
// For now bail out on C++ exception handling.
|
||||
for (Function::iterator A = F.begin(), Z = F.end(); A != Z; ++A)
|
||||
for (BasicBlock::iterator I = A->begin(), E = A->end(); I != E; ++I)
|
||||
|
|
|
@ -1032,6 +1032,9 @@ void HexagonEarlyIfConversion::simplifyFlowGraph(const FlowPattern &FP) {
|
|||
|
||||
|
||||
bool HexagonEarlyIfConversion::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
auto &ST = MF.getSubtarget();
|
||||
TII = ST.getInstrInfo();
|
||||
TRI = ST.getRegisterInfo();
|
||||
|
|
|
@ -1307,6 +1307,9 @@ bool HexagonExpandCondsets::coalesceSegments(MachineFunction &MF) {
|
|||
|
||||
|
||||
bool HexagonExpandCondsets::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
HII = static_cast<const HexagonInstrInfo*>(MF.getSubtarget().getInstrInfo());
|
||||
TRI = MF.getSubtarget().getRegisterInfo();
|
||||
LIS = &getAnalysis<LiveIntervals>();
|
||||
|
|
|
@ -90,6 +90,8 @@ static bool isHardwareLoop(const MachineInstr *MI) {
|
|||
}
|
||||
|
||||
bool HexagonFixupHwLoops::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
return fixupLoopInstrs(MF);
|
||||
}
|
||||
|
||||
|
|
|
@ -242,6 +242,9 @@ bool HexagonGenExtract::visitBlock(BasicBlock *B) {
|
|||
|
||||
|
||||
bool HexagonGenExtract::runOnFunction(Function &F) {
|
||||
if (skipFunction(F))
|
||||
return false;
|
||||
|
||||
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
|
||||
bool Changed;
|
||||
|
||||
|
|
|
@ -1469,6 +1469,9 @@ bool HexagonGenInsert::removeDeadCode(MachineDomTreeNode *N) {
|
|||
|
||||
|
||||
bool HexagonGenInsert::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
bool Timing = OptTiming, TimingDetail = Timing && OptTimingDetail;
|
||||
bool Changed = false;
|
||||
TimerGroup __G("hexinsert");
|
||||
|
|
|
@ -309,6 +309,8 @@ bool HexagonGenMux::genMuxInBlock(MachineBasicBlock &B) {
|
|||
}
|
||||
|
||||
bool HexagonGenMux::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
|
||||
HRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
|
||||
bool Changed = false;
|
||||
|
|
|
@ -477,6 +477,9 @@ bool HexagonGenPredicate::eliminatePredCopies(MachineFunction &MF) {
|
|||
|
||||
|
||||
bool HexagonGenPredicate::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
TII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
|
||||
TRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
|
||||
MRI = &MF.getRegInfo();
|
||||
|
|
|
@ -346,6 +346,8 @@ FunctionPass *llvm::createHexagonHardwareLoops() {
|
|||
|
||||
bool HexagonHardwareLoops::runOnMachineFunction(MachineFunction &MF) {
|
||||
DEBUG(dbgs() << "********* Hexagon Hardware Loops *********\n");
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
bool Changed = false;
|
||||
|
||||
|
|
|
@ -394,6 +394,9 @@ bool HexagonNewValueJump::runOnMachineFunction(MachineFunction &MF) {
|
|||
<< "********** Function: "
|
||||
<< MF.getName() << "\n");
|
||||
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
// If we move NewValueJump before register allocation we'll need live variable
|
||||
// analysis here too.
|
||||
|
||||
|
|
|
@ -69,6 +69,9 @@ bool HexagonOptimizeSZextends::intrinsicAlreadySextended(Intrinsic::ID IntID) {
|
|||
}
|
||||
|
||||
bool HexagonOptimizeSZextends::runOnFunction(Function &F) {
|
||||
if (skipFunction(F))
|
||||
return false;
|
||||
|
||||
unsigned Idx = 1;
|
||||
// Try to optimize sign extends in formal parameters. It's relying on
|
||||
// callee already sign extending the values. I'm not sure if our ABI
|
||||
|
|
|
@ -112,6 +112,9 @@ INITIALIZE_PASS(HexagonPeephole, "hexagon-peephole", "Hexagon Peephole",
|
|||
false, false)
|
||||
|
||||
bool HexagonPeephole::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
QII = static_cast<const HexagonInstrInfo *>(MF.getSubtarget().getInstrInfo());
|
||||
QRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
|
||||
MRI = &MF.getRegInfo();
|
||||
|
|
|
@ -267,6 +267,9 @@ bool HexagonDCE::rewrite(NodeAddr<InstrNode*> IA, SetVector<NodeId> &Remove) {
|
|||
|
||||
|
||||
bool HexagonRDFOpt::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
if (RDFLimit.getPosition()) {
|
||||
if (RDFCount >= RDFLimit)
|
||||
return false;
|
||||
|
|
|
@ -1163,6 +1163,9 @@ bool HexagonSplitDoubleRegs::runOnMachineFunction(MachineFunction &MF) {
|
|||
DEBUG(dbgs() << "Splitting double registers in function: "
|
||||
<< MF.getName() << '\n');
|
||||
|
||||
if (skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
auto &ST = MF.getSubtarget<HexagonSubtarget>();
|
||||
TRI = ST.getRegisterInfo();
|
||||
TII = ST.getInstrInfo();
|
||||
|
|
|
@ -594,6 +594,9 @@ bool HexagonStoreWidening::processBasicBlock(MachineBasicBlock &MBB) {
|
|||
|
||||
|
||||
bool HexagonStoreWidening::runOnMachineFunction(MachineFunction &MFn) {
|
||||
if (skipFunction(*MFn.getFunction()))
|
||||
return false;
|
||||
|
||||
MF = &MFn;
|
||||
auto &ST = MFn.getSubtarget<HexagonSubtarget>();
|
||||
TII = ST.getInstrInfo();
|
||||
|
|
|
@ -170,7 +170,7 @@ static MachineBasicBlock::iterator moveInstrOut(MachineInstr *MI,
|
|||
|
||||
|
||||
bool HexagonPacketizer::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (DisablePacketizer)
|
||||
if (DisablePacketizer || skipFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
|
||||
|
|
Loading…
Reference in New Issue