Lines Matching defs:CHR

53                                 cl::desc("Disable CHR for all functions"));
56 cl::desc("Apply CHR for all functions"));
60 cl::desc("CHR considers a branch bias greater than this ratio as biased"));
64 cl::desc("CHR merges a group of N branches/selects where N >= this value"));
68 cl::desc("Specify file to retrieve the list of modules to apply CHR to"));
72 cl::desc("Specify file to retrieve the list of functions to apply CHR to"));
76 cl::desc("Max number of duplications by CHR for a region"));
126 // paths due to CHR.
143 // CHRScope - a sequence of regions to CHR together. It corresponds to a
261 // The instruction at which to insert the CHR conditional branch (and hoist
288 class CHR {
290 CHR(Function &Fin, BlockFrequencyInfo &BFIin, DominatorTree &DTin,
295 ~CHR() {
304 // See the comments in CHR::run() for the high level flow of the algorithm and
436 CHR_DEBUG(dbgs() << "CHR IR dump " << Label << " " << ModuleName << " "
469 // Return true if the given instruction type can be hoisted by CHR.
478 // Return true if the given instruction can be hoisted by CHR.
518 // after CHR.
677 // insert the CHR branch for a region. This is the terminator branch in the
714 // Find a CHR scope in the given region.
715 CHRScope * CHR::findScope(Region *R) {
748 // excluded, it can prevent CHR from merging adjacent regions into bigger
852 // hoisted above the the CHR branch insert point (the most dominating of
873 void CHR::checkScopeHoistable(CHRScope *Scope) {
976 CHRScope * CHR::findScopes(Region *R, Region *NextRegion, Region *ParentRegion,
1115 void CHR::splitScopes(SmallVectorImpl<CHRScope *> &Input,
1131 SmallVector<CHRScope *, 8> CHR::splitScope(
1261 void CHR::classifyBiasedScopes(SmallVectorImpl<CHRScope *> &Scopes) {
1290 void CHR::classifyBiasedScopes(CHRScope *Scope, CHRScope *OutermostScope) {
1323 void CHR::filterScopes(SmallVectorImpl<CHRScope *> &Input,
1348 void CHR::setCHRRegions(SmallVectorImpl<CHRScope *> &Input,
1371 void CHR::setCHRRegions(CHRScope *Scope, CHRScope *OutermostScope) {
1374 // are and constant-folded after CHR (in case one biased select or a branch
1424 void CHR::sortScopes(SmallVectorImpl<CHRScope *> &Input,
1448 // The trivial phi inserted by the previous CHR scope could replace a
1450 // previous CHR scope, which dominates this scope, it's safe to stop
1617 // Assert that all the CHR regions of the scope have a biased branch or select.
1675 void CHR::transformScopes(CHRScope *Scope, DenseSet<PHINode *> &TrivialPHIs) {
1707 // Insert a trivial phi at the exit block (where the CHR hot path and the
1710 // incoming values for the CHR cold paths to it below. Without this, we'd
1718 // insert the CHR branch into. Note DT gets updated. Since DT gets updated
1763 void CHR::cloneScopeBlocks(CHRScope *Scope,
1769 // CHR-optimized code and the cloned blocks will be the original unoptimized
1772 // which CHR should apply to.
1822 BranchInst *CHR::createMergedBranch(BasicBlock *PreEntryBlock,
1848 void CHR::fixupBranchesAndSelects(CHRScope *Scope,
1871 "CHR",
1883 CHR_DEBUG(dbgs() << "CHR branch bias " << Weights[0] << ":" << Weights[1]
1889 void CHR::fixupBranch(Region *R, CHRScope *Scope,
1932 void CHR::fixupSelect(SelectInst *SI, CHRScope *Scope,
1956 void CHR::addToMergedCondition(bool IsTrueBiased, Value *Cond,
1977 void CHR::transformScopes(SmallVectorImpl<CHRScope *> &CHRScopes) {
1998 bool CHR::run() {
2030 // Filter out the scopes that has only one biased region or select (CHR
2036 // Set the regions to be CHR'ed and their hoist stops for each scope.
2039 CHR_DEBUG(dumpScopes(SetScopes, "Set CHR regions"));
2042 // ones. We need to apply CHR from outer to inner so that we apply CHR only
2052 // Apply the CHR transformation.
2086 // If there is no profile summary, we should not do CHR.
2094 bool Changed = CHR(F, BFI, DT, PSI, RI, ORE).run();