Lines Matching refs:SI
354 void fixupSelect(SelectInst *SI, CHRScope *Scope, IRBuilder<> &IRB,
660 SelectInst *SI, Region *R, in checkBiasedSelect() argument
665 if (!extractBranchProbabilities(SI, TrueProb, FalseProb)) in checkBiasedSelect()
667 CHR_DEBUG(dbgs() << "SI " << *SI << " "); in checkBiasedSelect()
670 return checkBias(SI, TrueProb, FalseProb, in checkBiasedSelect()
684 for (SelectInst *SI : RI.Selects) { in getBranchInsertPoint()
685 if (SI->getParent() == EntryBB) { in getBranchInsertPoint()
688 HoistPoint = SI; in getBranchInsertPoint()
697 for (SelectInst *SI : RI.Selects) { in getBranchInsertPoint()
698 if (SI->getParent() == EntryBB) { in getBranchInsertPoint()
699 EntryBlockSelectSet.insert(SI); in getBranchInsertPoint()
811 if (auto *SI = dyn_cast<SelectInst>(&I)) { in findScope() local
812 Selects.push_back(SI); in findScope()
819 for (auto *SI : Selects) in findScope() local
820 if (checkBiasedSelect(SI, RI.R, in findScope()
824 RI.Selects.push_back(SI); in findScope()
827 return OptimizationRemarkMissed(DEBUG_TYPE, "SelectNotBiased", SI) in findScope()
887 for (SelectInst *SI : Selects) { in checkScopeHoistable()
888 Unhoistables.insert(SI); in checkScopeHoistable()
892 SelectInst *SI = *it; in checkScopeHoistable() local
893 if (SI == InsertPoint) { in checkScopeHoistable()
898 bool IsHoistable = checkHoistValue(SI->getCondition(), InsertPoint, in checkScopeHoistable()
901 CHR_DEBUG(dbgs() << "Dropping select " << *SI << "\n"); in checkScopeHoistable()
904 "DropUnhoistableSelect", SI) in checkScopeHoistable()
910 Unhoistables.erase(SI); in checkScopeHoistable()
928 for (SelectInst *SI : Selects) { in checkScopeHoistable()
929 dbgs() << "SI " << *SI << "\n"; in checkScopeHoistable()
931 for (SelectInst *SI : Selects) { in checkScopeHoistable()
934 "DropSelectUnhoistableBranch", SI) in checkScopeHoistable()
938 llvm::erase_if(Selects, [EntryBB](SelectInst *SI) { in checkScopeHoistable() argument
939 return SI->getParent() == EntryBB; in checkScopeHoistable()
955 for (auto *SI : Selects) { in checkScopeHoistable() local
956 assert(!DT.dominates(SI, InsertPoint) && in checkScopeHoistable()
959 assert(checkHoistValue(SI->getCondition(), InsertPoint, DT, in checkScopeHoistable()
967 for (auto *SI : Selects) { in checkScopeHoistable() local
968 CHR_DEBUG(dbgs() << "SI " << *SI << "\n"); in checkScopeHoistable()
1030 for (SelectInst *SI : RI.Selects) { in getCHRConditionValuesForRegion()
1031 ConditionValues.insert(SI->getCondition()); in getCHRConditionValuesForRegion()
1108 for (SelectInst *SI : RI.Selects) in getSelectsInScope()
1109 Output.insert(SI); in getSelectsInScope()
1277 for (SelectInst *SI : Scope->TrueBiasedSelects) { in classifyBiasedScopes()
1278 dbgs() << *SI << ", "; in classifyBiasedScopes()
1282 for (SelectInst *SI : Scope->FalseBiasedSelects) { in classifyBiasedScopes()
1283 dbgs() << *SI << ", "; in classifyBiasedScopes()
1300 for (SelectInst *SI : RI.Selects) { in classifyBiasedScopes()
1301 if (TrueBiasedSelectsGlobal.contains(SI)) in classifyBiasedScopes()
1302 OutermostScope->TrueBiasedSelects.insert(SI); in classifyBiasedScopes()
1303 else if (FalseBiasedSelectsGlobal.contains(SI)) in classifyBiasedScopes()
1304 OutermostScope->FalseBiasedSelects.insert(SI); in classifyBiasedScopes()
1376 for (SelectInst *SI : RI.Selects) { in setCHRRegions()
1377 Unhoistables.insert(SI); in setCHRRegions()
1398 for (SelectInst *SI : RI.Selects) { in setCHRRegions()
1399 assert((OutermostScope->TrueBiasedSelects.contains(SI) || in setCHRRegions()
1400 OutermostScope->FalseBiasedSelects.contains(SI)) && in setCHRRegions()
1404 bool IsHoistable = checkHoistValue(SI->getCondition(), InsertPoint, DT, in setCHRRegions()
1493 for (SelectInst *SI : RI.Selects) { in hoistScopeConditions()
1494 bool IsTrueBiased = Scope->TrueBiasedSelects.count(SI); in hoistScopeConditions()
1495 bool IsFalseBiased = Scope->FalseBiasedSelects.count(SI); in hoistScopeConditions()
1498 hoistValue(SI->getCondition(), HoistPoint, R, Scope->HoistStopMap, in hoistScopeConditions()
1531 if (auto *SI = dyn_cast<SelectInst>(U)) { in negateICmpIfUsedByBranchOrSelectOnly() local
1533 SI->swapValues(); in negateICmpIfUsedByBranchOrSelectOnly()
1534 SI->swapProfMetadata(); in negateICmpIfUsedByBranchOrSelectOnly()
1535 if (Scope->TrueBiasedSelects.count(SI)) { in negateICmpIfUsedByBranchOrSelectOnly()
1536 assert(!Scope->FalseBiasedSelects.contains(SI) && in negateICmpIfUsedByBranchOrSelectOnly()
1538 Scope->FalseBiasedSelects.insert(SI); in negateICmpIfUsedByBranchOrSelectOnly()
1539 } else if (Scope->FalseBiasedSelects.count(SI)) { in negateICmpIfUsedByBranchOrSelectOnly()
1540 assert(!Scope->TrueBiasedSelects.contains(SI) && in negateICmpIfUsedByBranchOrSelectOnly()
1542 Scope->TrueBiasedSelects.insert(SI); in negateICmpIfUsedByBranchOrSelectOnly()
1624 for (SelectInst *SI : RI.Selects) in assertCHRRegionsHaveBiasedBranchOrSelect()
1625 if (Scope->TrueBiasedSelects.count(SI) || in assertCHRRegionsHaveBiasedBranchOrSelect()
1626 Scope->FalseBiasedSelects.count(SI)) in assertCHRRegionsHaveBiasedBranchOrSelect()
1657 for (SelectInst *SI : RI.Selects) { in assertBranchOrSelectConditionHoisted()
1658 bool IsTrueBiased = Scope->TrueBiasedSelects.count(SI); in assertBranchOrSelectConditionHoisted()
1659 bool IsFalseBiased = Scope->FalseBiasedSelects.count(SI); in assertBranchOrSelectConditionHoisted()
1662 Value *V = SI->getCondition(); in assertBranchOrSelectConditionHoisted()
1861 for (SelectInst *SI : RI.Selects) { in fixupBranchesAndSelects()
1862 fixupSelect(SI, Scope, IRB, MergedCondition, CHRBranchBias); in fixupBranchesAndSelects()
1931 void CHR::fixupSelect(SelectInst *SI, CHRScope *Scope, in fixupSelect() argument
1935 bool IsTrueBiased = Scope->TrueBiasedSelects.count(SI); in fixupSelect()
1937 Scope->FalseBiasedSelects.count(SI)) && "Must be biased"); in fixupSelect()
1938 assert(SelectBiasMap.contains(SI) && "Must be in the bias map"); in fixupSelect()
1939 BranchProbability Bias = SelectBiasMap[SI]; in fixupSelect()
1944 Value *Cond = SI->getCondition(); in fixupSelect()
1945 addToMergedCondition(IsTrueBiased, Cond, SI, Scope, IRB, in fixupSelect()
1950 SI->setCondition(NewCondition); in fixupSelect()