Add optimization bisect opt-in calls for Hexagon passes

Differential Revision: http://reviews.llvm.org/D19509

llvm-svn: 267593
This commit is contained in:
Andrew Kaylor 2016-04-26 19:46:28 +00:00
parent 900cadd3ad
commit 5b444a21df
18 changed files with 52 additions and 1 deletions

View File

@ -2191,6 +2191,9 @@ bool BitSimplification::processBlock(MachineBasicBlock &B,
bool HexagonBitSimplify::runOnMachineFunction(MachineFunction &MF) { bool HexagonBitSimplify::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
auto &HST = MF.getSubtarget<HexagonSubtarget>(); auto &HST = MF.getSubtarget<HexagonSubtarget>();
auto &HRI = *HST.getRegisterInfo(); auto &HRI = *HST.getRegisterInfo();
auto &HII = *HST.getInstrInfo(); auto &HII = *HST.getInstrInfo();
@ -2733,6 +2736,9 @@ bool HexagonLoopRescheduling::processLoop(LoopCand &C) {
bool HexagonLoopRescheduling::runOnMachineFunction(MachineFunction &MF) { bool HexagonLoopRescheduling::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
auto &HST = MF.getSubtarget<HexagonSubtarget>(); auto &HST = MF.getSubtarget<HexagonSubtarget>();
HII = HST.getInstrInfo(); HII = HST.getInstrInfo();
HRI = HST.getRegisterInfo(); HRI = HST.getRegisterInfo();

View File

@ -102,6 +102,9 @@ HexagonCFGOptimizer::InvertAndChangeJumpTarget(MachineInstr* MI,
bool HexagonCFGOptimizer::runOnMachineFunction(MachineFunction &Fn) { bool HexagonCFGOptimizer::runOnMachineFunction(MachineFunction &Fn) {
if (skipFunction(*Fn.getFunction()))
return false;
// Loop over all of the basic blocks. // Loop over all of the basic blocks.
for (MachineFunction::iterator MBBb = Fn.begin(), MBBe = Fn.end(); for (MachineFunction::iterator MBBb = Fn.begin(), MBBe = Fn.end();
MBBb != MBBe; ++MBBb) { MBBb != MBBe; ++MBBb) {

View File

@ -1268,6 +1268,9 @@ void HexagonCommonGEP::removeDeadCode() {
bool HexagonCommonGEP::runOnFunction(Function &F) { bool HexagonCommonGEP::runOnFunction(Function &F) {
if (skipFunction(F))
return false;
// For now bail out on C++ exception handling. // For now bail out on C++ exception handling.
for (Function::iterator A = F.begin(), Z = F.end(); A != Z; ++A) for (Function::iterator A = F.begin(), Z = F.end(); A != Z; ++A)
for (BasicBlock::iterator I = A->begin(), E = A->end(); I != E; ++I) for (BasicBlock::iterator I = A->begin(), E = A->end(); I != E; ++I)

View File

@ -1032,6 +1032,9 @@ void HexagonEarlyIfConversion::simplifyFlowGraph(const FlowPattern &FP) {
bool HexagonEarlyIfConversion::runOnMachineFunction(MachineFunction &MF) { bool HexagonEarlyIfConversion::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
auto &ST = MF.getSubtarget(); auto &ST = MF.getSubtarget();
TII = ST.getInstrInfo(); TII = ST.getInstrInfo();
TRI = ST.getRegisterInfo(); TRI = ST.getRegisterInfo();

View File

@ -1307,6 +1307,9 @@ bool HexagonExpandCondsets::coalesceSegments(MachineFunction &MF) {
bool HexagonExpandCondsets::runOnMachineFunction(MachineFunction &MF) { bool HexagonExpandCondsets::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
HII = static_cast<const HexagonInstrInfo*>(MF.getSubtarget().getInstrInfo()); HII = static_cast<const HexagonInstrInfo*>(MF.getSubtarget().getInstrInfo());
TRI = MF.getSubtarget().getRegisterInfo(); TRI = MF.getSubtarget().getRegisterInfo();
LIS = &getAnalysis<LiveIntervals>(); LIS = &getAnalysis<LiveIntervals>();

View File

@ -90,6 +90,8 @@ static bool isHardwareLoop(const MachineInstr *MI) {
} }
bool HexagonFixupHwLoops::runOnMachineFunction(MachineFunction &MF) { bool HexagonFixupHwLoops::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
return fixupLoopInstrs(MF); return fixupLoopInstrs(MF);
} }

View File

@ -242,6 +242,9 @@ bool HexagonGenExtract::visitBlock(BasicBlock *B) {
bool HexagonGenExtract::runOnFunction(Function &F) { bool HexagonGenExtract::runOnFunction(Function &F) {
if (skipFunction(F))
return false;
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
bool Changed; bool Changed;

View File

@ -1469,6 +1469,9 @@ bool HexagonGenInsert::removeDeadCode(MachineDomTreeNode *N) {
bool HexagonGenInsert::runOnMachineFunction(MachineFunction &MF) { bool HexagonGenInsert::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
bool Timing = OptTiming, TimingDetail = Timing && OptTimingDetail; bool Timing = OptTiming, TimingDetail = Timing && OptTimingDetail;
bool Changed = false; bool Changed = false;
TimerGroup __G("hexinsert"); TimerGroup __G("hexinsert");

View File

@ -309,6 +309,8 @@ bool HexagonGenMux::genMuxInBlock(MachineBasicBlock &B) {
} }
bool HexagonGenMux::runOnMachineFunction(MachineFunction &MF) { bool HexagonGenMux::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo(); HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
HRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo(); HRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
bool Changed = false; bool Changed = false;

View File

@ -477,6 +477,9 @@ bool HexagonGenPredicate::eliminatePredCopies(MachineFunction &MF) {
bool HexagonGenPredicate::runOnMachineFunction(MachineFunction &MF) { bool HexagonGenPredicate::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
TII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo(); TII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
TRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo(); TRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
MRI = &MF.getRegInfo(); MRI = &MF.getRegInfo();

View File

@ -346,6 +346,8 @@ FunctionPass *llvm::createHexagonHardwareLoops() {
bool HexagonHardwareLoops::runOnMachineFunction(MachineFunction &MF) { bool HexagonHardwareLoops::runOnMachineFunction(MachineFunction &MF) {
DEBUG(dbgs() << "********* Hexagon Hardware Loops *********\n"); DEBUG(dbgs() << "********* Hexagon Hardware Loops *********\n");
if (skipFunction(*MF.getFunction()))
return false;
bool Changed = false; bool Changed = false;

View File

@ -394,6 +394,9 @@ bool HexagonNewValueJump::runOnMachineFunction(MachineFunction &MF) {
<< "********** Function: " << "********** Function: "
<< MF.getName() << "\n"); << MF.getName() << "\n");
if (skipFunction(*MF.getFunction()))
return false;
// If we move NewValueJump before register allocation we'll need live variable // If we move NewValueJump before register allocation we'll need live variable
// analysis here too. // analysis here too.

View File

@ -69,6 +69,9 @@ bool HexagonOptimizeSZextends::intrinsicAlreadySextended(Intrinsic::ID IntID) {
} }
bool HexagonOptimizeSZextends::runOnFunction(Function &F) { bool HexagonOptimizeSZextends::runOnFunction(Function &F) {
if (skipFunction(F))
return false;
unsigned Idx = 1; unsigned Idx = 1;
// Try to optimize sign extends in formal parameters. It's relying on // 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 // callee already sign extending the values. I'm not sure if our ABI

View File

@ -112,6 +112,9 @@ INITIALIZE_PASS(HexagonPeephole, "hexagon-peephole", "Hexagon Peephole",
false, false) false, false)
bool HexagonPeephole::runOnMachineFunction(MachineFunction &MF) { bool HexagonPeephole::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
QII = static_cast<const HexagonInstrInfo *>(MF.getSubtarget().getInstrInfo()); QII = static_cast<const HexagonInstrInfo *>(MF.getSubtarget().getInstrInfo());
QRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo(); QRI = MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
MRI = &MF.getRegInfo(); MRI = &MF.getRegInfo();

View File

@ -267,6 +267,9 @@ bool HexagonDCE::rewrite(NodeAddr<InstrNode*> IA, SetVector<NodeId> &Remove) {
bool HexagonRDFOpt::runOnMachineFunction(MachineFunction &MF) { bool HexagonRDFOpt::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(*MF.getFunction()))
return false;
if (RDFLimit.getPosition()) { if (RDFLimit.getPosition()) {
if (RDFCount >= RDFLimit) if (RDFCount >= RDFLimit)
return false; return false;

View File

@ -1163,6 +1163,9 @@ bool HexagonSplitDoubleRegs::runOnMachineFunction(MachineFunction &MF) {
DEBUG(dbgs() << "Splitting double registers in function: " DEBUG(dbgs() << "Splitting double registers in function: "
<< MF.getName() << '\n'); << MF.getName() << '\n');
if (skipFunction(*MF.getFunction()))
return false;
auto &ST = MF.getSubtarget<HexagonSubtarget>(); auto &ST = MF.getSubtarget<HexagonSubtarget>();
TRI = ST.getRegisterInfo(); TRI = ST.getRegisterInfo();
TII = ST.getInstrInfo(); TII = ST.getInstrInfo();

View File

@ -594,6 +594,9 @@ bool HexagonStoreWidening::processBasicBlock(MachineBasicBlock &MBB) {
bool HexagonStoreWidening::runOnMachineFunction(MachineFunction &MFn) { bool HexagonStoreWidening::runOnMachineFunction(MachineFunction &MFn) {
if (skipFunction(*MFn.getFunction()))
return false;
MF = &MFn; MF = &MFn;
auto &ST = MFn.getSubtarget<HexagonSubtarget>(); auto &ST = MFn.getSubtarget<HexagonSubtarget>();
TII = ST.getInstrInfo(); TII = ST.getInstrInfo();

View File

@ -170,7 +170,7 @@ static MachineBasicBlock::iterator moveInstrOut(MachineInstr *MI,
bool HexagonPacketizer::runOnMachineFunction(MachineFunction &MF) { bool HexagonPacketizer::runOnMachineFunction(MachineFunction &MF) {
if (DisablePacketizer) if (DisablePacketizer || skipFunction(*MF.getFunction()))
return false; return false;
HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo(); HII = MF.getSubtarget<HexagonSubtarget>().getInstrInfo();