LLVM 24.0.0git
HexagonGlobalSchedulerV2.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "global_schedV2"

Functions

 STATISTIC (HexagonGSLocalPullups, "Number of instructions pull-ups locally")
 STATISTIC (HexagonGSGlobalPullups, "Number of instructions pull-ups globally")
 INITIALIZE_PASS (HexagonGlobalSchedulerV2, "global-schedV2", "Hexagon Global Scheduler V2", false, false) static inline bool isSchedBarrier(const MachineInstr *MI)
static std::vector< const MachineOperand * > collectRegmaskMOs (const MachineBasicBlock &MBB)
static std::pair< MIInstIterType, MIInstIterType > getParentBundle (MachineInstr *MI)
static MachineInstr * updateBundle (MachineInstr *BundleHead, const HexagonInstrInfo *QII, SmallVectorImpl< MachineInstr * > *SpecScope=nullptr)
static MachineInstr * removeMI (MachineInstr *MI, const HexagonInstrInfo *QII, SmallVectorImpl< MachineInstr * > *SpecPacketOpp=nullptr, MachineInstr **singleInstr=nullptr)
bool endloopAfterMI (MachineBasicBlock::instr_iterator MII, MachineBasicBlock *MBB)
static void transferLiveIns (const MachineBasicBlock *From, MachineBasicBlock *To)
static bool inBetweenBarriers (MICIterType Iter, const MachineBasicBlock *DstBB)
static bool isEmptyBlock (MachineBasicBlock *MBB)
static MIRIterType getSpeculationBeginPoint (MachineInstr *SrcMI, MachineBasicBlock *DstBB)
static bool checkIfSameBundle (MachineInstr *MI1, MachineInstr *MI2)
static MachineBasicBlock * ShouldSplitCriticalEdge (MachineBasicBlock *FromBB, MachineBasicBlock *ToBB)

Variables

static cl::opt< bool > EnableGlobalSched ("enable-global-sched", cl::Hidden, cl::init(false), cl::desc("Enable global scheduler optimizer"))
static cl::opt< bool > EnablePullupPred ("enable-pullup-pred", cl::Hidden, cl::init(true), cl::desc("Use pullup predication"))
static cl::opt< bool > EnableLocalPullup ("enable-local-pullup", cl::Hidden, cl::init(true), cl::desc("Speculate local MIs in parent BUNDLEs"))
static cl::opt< bool > EnableLocalMergePackets ("enable-local-merge-packets", cl::Hidden, cl::init(true), cl::desc("Push down local MIs into the next packet"))
static cl::opt< bool > PostSchedOpt ("post-sched-opt", cl::Hidden, cl::init(true), cl::desc("Optimize after global scheduling"))
static cl::opt< bool > PostSchedPack ("post-sched-packet", cl::Hidden, cl::init(true), cl::desc("Packetize unbundled MIs after global scheduling"))
static cl::opt< bool > NoPredInBundle ("nopred-sched-bundle", cl::Hidden, cl::desc("Do not put predicated instructions in bundle"))
static cl::opt< bool > NoSpecInBundle ("nospec-sched-bundle", cl::Hidden, cl::desc("Do not put speculated instructions in bundle"))
static cl::opt< bool > EnableSqueeze ("try-squeeze-bundle", cl::Hidden, cl::init(true), cl::desc("Try putting 5 instructions in bundle"))
static cl::opt< bool > PreventDuplexSep ("prevent-duplex-sep-v2", cl::Hidden, cl::init(true), cl::desc("Prevent separation of duplex while pullup in global scheduler V2"))
static cl::opt< bool > PullUnsafeMemops ("pull-unsafe-memops", cl::Hidden, cl::init(true), cl::desc("Pull up loads which have no memoperands"))
static cl::opt< bool > VerifyGlobalSched ("verify-global-sched", cl::Hidden, cl::init(false), cl::desc("Run the machine verifier at several stages of global scheduler"))
static cl::opt< bool > PredicateAllInst ("predicate-all-inst", cl::Hidden, cl::desc("Try predicating all possible instructions."))
static cl::opt< bool > SpeculateAllInst ("speculate-all-inst", cl::Hidden, cl::desc("Try speculating all possible instructions."))
static cl::opt< unsigned > MaxPUBundles ("hexagon-pullup-distance", cl::Hidden, cl::init(10), cl::desc("Maximum number of bundles to check for local pull-up"))
static cl::opt< bool > EnableSingleLoopSuperblock ("enable-single-loop-superblock", cl::Hidden, cl::init(true), cl::desc("Enable superblocks consisting of single block loops."))
static cl::opt< bool > EnableHVXLocalPullupLB ("enable-hvx-local-pullup-load-bypass", cl::Hidden, cl::init(true), cl::desc("Enable the HVX local pull-up pass (load bypass only)."))
static cl::opt< bool > EnableLCGPForLoadBypassOnly ("enable-lcgp-for-load-bypass-only", cl::Hidden, cl::init(true), cl::desc("Enable the HVX last chance global pull-up for load-bypass-only"))
static cl::opt< bool > EnableHVXTwoLoadCurBypass ("enable-hvx-two-load-cur-bypass", cl::Hidden, cl::init(false), cl::desc("Enable the two-load .cur load-bypass case in local pull-up."))
static cl::opt< bool > EnableHVXLocalPullup ("enable-hvx-local-pullup", cl::Hidden, cl::init(true), cl::desc("Enable the HVX local pull-up pass."))
static cl::opt< bool > EnableHVXLocalPullupInnermost ("enable-hvx-local-pullup-innermost", cl::Hidden, cl::init(false), cl::desc("Enable the HVX local pull-up pass on single block innermost " "loops only."))
static cl::opt< bool > DisableHVXLocalPullupAndSuperblock ("disable-hvx-sched-superblock", cl::Hidden, cl::init(false), cl::desc("Disable single block loops in superblocks and the HVX local " "pull-up pass."))
static cl::opt< bool > EnableHVXLCGP ("enable-hvx-lcgp", cl::Hidden, cl::init(true), cl::desc("Enable the HVX last chance global pull-up pass."))
static cl::opt< bool > EnableHVXSuperblockHeuristic ("enable-hvx-superblock-heuristic", cl::Hidden, cl::init(true), cl::desc("Run HVX scheduling only on blocks whose ratio of HVX " "instructions exceeds -hvx-sched-profit-ratio."))
static cl::opt< float > HVXSchedProfitRatio ("hvx-sched-profit-ratio", cl::Hidden, cl::init(0.80), cl::desc("Ratio of HVX instruction/Total instructions " "for the profitability check."))
static cl::opt< bool > EnableHLXLoadStorePullup ("enable-hlx-load-store-pullup", cl::Hidden, cl::init(true), cl::desc("Pull up HLX .tmp load uses and .new HLX stores to remove the " "copies inserted by HLX load/store expansion"))
static cl::opt< bool > EnableSparsePullup ("enable-sparse-pullup", cl::Hidden, cl::init(true), cl::desc("Enable pullup to/from sparse packets"))
static cl::opt< bool > EnableClusterPullup ("enable-cluster-pullup", cl::Hidden, cl::init(true), cl::desc("Enable pullup for dependent instruction groups"))
 Enable cluster pullup optimization.
cl::opt< bool > EnableDefUseSamePacket
cl::opt< bool > OneFloatPerPacket
cl::opt< bool > OneComplexPerPacket

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "global_schedV2"

Definition at line 206 of file HexagonGlobalSchedulerV2.cpp.

Function Documentation

◆ checkIfSameBundle()

◆ collectRegmaskMOs()

std::vector< const MachineOperand * > collectRegmaskMOs ( const MachineBasicBlock & MBB)
static

Definition at line 1040 of file HexagonGlobalSchedulerV2.cpp.

References llvm::End, II, and MBB.

◆ endloopAfterMI()

bool endloopAfterMI ( MachineBasicBlock::instr_iterator MII,
MachineBasicBlock * MBB )
inline

Definition at line 1156 of file HexagonGlobalSchedulerV2.cpp.

References MBB.

◆ getParentBundle()

std::pair< MIInstIterType, MIInstIterType > getParentBundle ( MachineInstr * MI)
static

Definition at line 1100 of file HexagonGlobalSchedulerV2.cpp.

References llvm::getBundleEnd(), llvm::getBundleStart(), and MI.

Referenced by getSpeculationBeginPoint().

◆ getSpeculationBeginPoint()

MIRIterType getSpeculationBeginPoint ( MachineInstr * SrcMI,
MachineBasicBlock * DstBB )
static

◆ inBetweenBarriers()

bool inBetweenBarriers ( MICIterType Iter,
const MachineBasicBlock * DstBB )
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( HexagonGlobalSchedulerV2 ,
"global-schedV2" ,
"Hexagon Global Scheduler V2" ,
false ,
false  ) const

Definition at line 913 of file HexagonGlobalSchedulerV2.cpp.

References const, inline, isSchedBarrier(), and MI.

◆ isEmptyBlock()

bool isEmptyBlock ( MachineBasicBlock * MBB)
static

Definition at line 1202 of file HexagonGlobalSchedulerV2.cpp.

References MBB, and MBBI.

◆ removeMI()

MachineInstr * removeMI ( MachineInstr * MI,
const HexagonInstrInfo * QII,
SmallVectorImpl< MachineInstr * > * SpecPacketOpp = nullptr,
MachineInstr ** singleInstr = nullptr )
static

Definition at line 1136 of file HexagonGlobalSchedulerV2.cpp.

References llvm::getBundleStart(), MI, and updateBundle().

◆ ShouldSplitCriticalEdge()

◆ STATISTIC() [1/2]

STATISTIC ( HexagonGSGlobalPullups ,
"Number of instructions pull-ups globally"  )

◆ STATISTIC() [2/2]

STATISTIC ( HexagonGSLocalPullups ,
"Number of instructions pull-ups locally"  )

◆ transferLiveIns()

◆ updateBundle()

Variable Documentation

◆ DisableHVXLocalPullupAndSuperblock

cl::opt< bool > DisableHVXLocalPullupAndSuperblock("disable-hvx-sched-superblock", cl::Hidden, cl::init(false), cl::desc("Disable single block loops in superblocks and the HVX local " "pull-up pass.")) ( "disable-hvx-sched-superblock" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Disable single block loops in superblocks and the HVX local " "pull-up pass.")  )
static

◆ EnableClusterPullup

cl::opt< bool > EnableClusterPullup("enable-cluster-pullup", cl::Hidden, cl::init(true), cl::desc("Enable pullup for dependent instruction groups")) ( "enable-cluster-pullup" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable pullup for dependent instruction groups")  )
static

Enable cluster pullup optimization.

Cluster pullup allows pulling up groups of dependent instructions together, rather than just individual instructions. This is particularly important for HVX/HLX instructions where .tmp and .cur dependencies create instruction chains that must be moved atomically to maintain correctness.

◆ EnableDefUseSamePacket

cl::opt<bool> EnableDefUseSamePacket
extern

◆ EnableGlobalSched

cl::opt< bool > EnableGlobalSched("enable-global-sched", cl::Hidden, cl::init(false), cl::desc("Enable global scheduler optimizer")) ( "enable-global-sched" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Enable global scheduler optimizer")  )
static

◆ EnableHLXLoadStorePullup

cl::opt< bool > EnableHLXLoadStorePullup("enable-hlx-load-store-pullup", cl::Hidden, cl::init(true), cl::desc("Pull up HLX .tmp load uses and .new HLX stores to remove the " "copies inserted by HLX load/store expansion")) ( "enable-hlx-load-store-pullup" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Pull up HLX .tmp load uses and .new HLX stores to remove the " "copies inserted by HLX load/store expansion")  )
static

◆ EnableHVXLCGP

cl::opt< bool > EnableHVXLCGP("enable-hvx-lcgp", cl::Hidden, cl::init(true), cl::desc("Enable the HVX last chance global pull-up pass.")) ( "enable-hvx-lcgp" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable the HVX last chance global pull-up pass.")  )
static

◆ EnableHVXLocalPullup

cl::opt< bool > EnableHVXLocalPullup("enable-hvx-local-pullup", cl::Hidden, cl::init(true), cl::desc("Enable the HVX local pull-up pass.")) ( "enable-hvx-local-pullup" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable the HVX local pull-up pass.")  )
static

◆ EnableHVXLocalPullupInnermost

cl::opt< bool > EnableHVXLocalPullupInnermost("enable-hvx-local-pullup-innermost", cl::Hidden, cl::init(false), cl::desc("Enable the HVX local pull-up pass on single block innermost " "loops only.")) ( "enable-hvx-local-pullup-innermost" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Enable the HVX local pull-up pass on single block innermost " "loops only.")  )
static

◆ EnableHVXLocalPullupLB

cl::opt< bool > EnableHVXLocalPullupLB("enable-hvx-local-pullup-load-bypass", cl::Hidden, cl::init(true), cl::desc("Enable the HVX local pull-up pass (load bypass only).")) ( "enable-hvx-local-pullup-load-bypass" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable the HVX local pull-up pass (load bypass only).")  )
static

◆ EnableHVXSuperblockHeuristic

cl::opt< bool > EnableHVXSuperblockHeuristic("enable-hvx-superblock-heuristic", cl::Hidden, cl::init(true), cl::desc("Run HVX scheduling only on blocks whose ratio of HVX " "instructions exceeds -hvx-sched-profit-ratio.")) ( "enable-hvx-superblock-heuristic" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Run HVX scheduling only on blocks whose ratio of HVX " "instructions exceeds -hvx-sched-profit-ratio.")  )
static

◆ EnableHVXTwoLoadCurBypass

cl::opt< bool > EnableHVXTwoLoadCurBypass("enable-hvx-two-load-cur-bypass", cl::Hidden, cl::init(false), cl::desc("Enable the two-load .cur load-bypass case in local pull-up.")) ( "enable-hvx-two-load-cur-bypass" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Enable the two-load .cur load-bypass case in local pull-up.")  )
static

◆ EnableLCGPForLoadBypassOnly

cl::opt< bool > EnableLCGPForLoadBypassOnly("enable-lcgp-for-load-bypass-only", cl::Hidden, cl::init(true), cl::desc("Enable the HVX last chance global pull-up for load-bypass-only")) ( "enable-lcgp-for-load-bypass-only" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable the HVX last chance global pull-up for load-bypass-only")  )
static

◆ EnableLocalMergePackets

cl::opt< bool > EnableLocalMergePackets("enable-local-merge-packets", cl::Hidden, cl::init(true), cl::desc("Push down local MIs into the next packet")) ( "enable-local-merge-packets" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Push down local MIs into the next packet")  )
static

◆ EnableLocalPullup

cl::opt< bool > EnableLocalPullup("enable-local-pullup", cl::Hidden, cl::init(true), cl::desc("Speculate local MIs in parent BUNDLEs")) ( "enable-local-pullup" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Speculate local MIs in parent BUNDLEs")  )
static

◆ EnablePullupPred

cl::opt< bool > EnablePullupPred("enable-pullup-pred", cl::Hidden, cl::init(true), cl::desc("Use pullup predication")) ( "enable-pullup-pred" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Use pullup predication")  )
static

◆ EnableSingleLoopSuperblock

cl::opt< bool > EnableSingleLoopSuperblock("enable-single-loop-superblock", cl::Hidden, cl::init(true), cl::desc("Enable superblocks consisting of single block loops.")) ( "enable-single-loop-superblock" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable superblocks consisting of single block loops.")  )
static

◆ EnableSparsePullup

cl::opt< bool > EnableSparsePullup("enable-sparse-pullup", cl::Hidden, cl::init(true), cl::desc("Enable pullup to/from sparse packets")) ( "enable-sparse-pullup" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Enable pullup to/from sparse packets")  )
static

◆ EnableSqueeze

cl::opt< bool > EnableSqueeze("try-squeeze-bundle", cl::Hidden, cl::init(true), cl::desc("Try putting 5 instructions in bundle")) ( "try-squeeze-bundle" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Try putting 5 instructions in bundle")  )
static

◆ HVXSchedProfitRatio

cl::opt< float > HVXSchedProfitRatio("hvx-sched-profit-ratio", cl::Hidden, cl::init(0.80), cl::desc("Ratio of HVX instruction/Total instructions " "for the profitability check.")) ( "hvx-sched-profit-ratio" ,
cl::Hidden ,
cl::init(0.80) ,
cl::desc("Ratio of HVX instruction/Total instructions " "for the profitability check.")  )
static

◆ MaxPUBundles

cl::opt< unsigned > MaxPUBundles("hexagon-pullup-distance", cl::Hidden, cl::init(10), cl::desc("Maximum number of bundles to check for local pull-up")) ( "hexagon-pullup-distance" ,
cl::Hidden ,
cl::init(10) ,
cl::desc("Maximum number of bundles to check for local pull-up")  )
static

◆ NoPredInBundle

cl::opt< bool > NoPredInBundle("nopred-sched-bundle", cl::Hidden, cl::desc("Do not put predicated instructions in bundle")) ( "nopred-sched-bundle" ,
cl::Hidden ,
cl::desc("Do not put predicated instructions in bundle")  )
static

◆ NoSpecInBundle

cl::opt< bool > NoSpecInBundle("nospec-sched-bundle", cl::Hidden, cl::desc("Do not put speculated instructions in bundle")) ( "nospec-sched-bundle" ,
cl::Hidden ,
cl::desc("Do not put speculated instructions in bundle")  )
static

◆ OneComplexPerPacket

cl::opt<bool> OneComplexPerPacket
extern

◆ OneFloatPerPacket

cl::opt<bool> OneFloatPerPacket
extern

◆ PostSchedOpt

cl::opt< bool > PostSchedOpt("post-sched-opt", cl::Hidden, cl::init(true), cl::desc("Optimize after global scheduling")) ( "post-sched-opt" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Optimize after global scheduling")  )
static

◆ PostSchedPack

cl::opt< bool > PostSchedPack("post-sched-packet", cl::Hidden, cl::init(true), cl::desc("Packetize unbundled MIs after global scheduling")) ( "post-sched-packet" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Packetize unbundled MIs after global scheduling")  )
static

◆ PredicateAllInst

cl::opt< bool > PredicateAllInst("predicate-all-inst", cl::Hidden, cl::desc("Try predicating all possible instructions.")) ( "predicate-all-inst" ,
cl::Hidden ,
cl::desc("Try predicating all possible instructions.")  )
static

◆ PreventDuplexSep

cl::opt< bool > PreventDuplexSep("prevent-duplex-sep-v2", cl::Hidden, cl::init(true), cl::desc( "Prevent separation of duplex while pullup in global scheduler V2")) ( "prevent-duplex-sep-v2" ,
cl::Hidden ,
cl::init(true) ,
cl::desc( "Prevent separation of duplex while pullup in global scheduler V2")  )
static

◆ PullUnsafeMemops

cl::opt< bool > PullUnsafeMemops("pull-unsafe-memops", cl::Hidden, cl::init(true), cl::desc("Pull up loads which have no memoperands")) ( "pull-unsafe-memops" ,
cl::Hidden ,
cl::init(true) ,
cl::desc("Pull up loads which have no memoperands")  )
static

◆ SpeculateAllInst

cl::opt< bool > SpeculateAllInst("speculate-all-inst", cl::Hidden, cl::desc("Try speculating all possible instructions.")) ( "speculate-all-inst" ,
cl::Hidden ,
cl::desc("Try speculating all possible instructions.")  )
static

◆ VerifyGlobalSched

cl::opt< bool > VerifyGlobalSched("verify-global-sched", cl::Hidden, cl::init(false), cl::desc("Run the machine verifier at several stages of global scheduler")) ( "verify-global-sched" ,
cl::Hidden ,
cl::init(false) ,
cl::desc("Run the machine verifier at several stages of global scheduler")  )
static