Lines Matching refs:SI

355   void fixupSelect(SelectInst *SI, CHRScope *Scope, IRBuilder<> &IRB,
661 SelectInst *SI, Region *R, in checkBiasedSelect() argument
666 if (!extractBranchProbabilities(SI, TrueProb, FalseProb)) in checkBiasedSelect()
668 CHR_DEBUG(dbgs() << "SI " << *SI << " "); in checkBiasedSelect()
671 return checkBias(SI, TrueProb, FalseProb, in checkBiasedSelect()
685 for (SelectInst *SI : RI.Selects) { in getBranchInsertPoint()
686 if (SI->getParent() == EntryBB) { in getBranchInsertPoint()
689 HoistPoint = SI; in getBranchInsertPoint()
698 for (SelectInst *SI : RI.Selects) { in getBranchInsertPoint()
699 if (SI->getParent() == EntryBB) { in getBranchInsertPoint()
700 EntryBlockSelectSet.insert(SI); in getBranchInsertPoint()
812 if (auto *SI = dyn_cast<SelectInst>(&I)) { in findScope() local
813 Selects.push_back(SI); in findScope()
820 for (auto *SI : Selects) in findScope() local
821 if (checkBiasedSelect(SI, RI.R, in findScope()
825 RI.Selects.push_back(SI); in findScope()
828 return OptimizationRemarkMissed(DEBUG_TYPE, "SelectNotBiased", SI) in findScope()
888 for (SelectInst *SI : Selects) { in checkScopeHoistable()
889 Unhoistables.insert(SI); in checkScopeHoistable()
893 SelectInst *SI = *it; in checkScopeHoistable() local
894 if (SI == InsertPoint) { in checkScopeHoistable()
899 bool IsHoistable = checkHoistValue(SI->getCondition(), InsertPoint, in checkScopeHoistable()
902 CHR_DEBUG(dbgs() << "Dropping select " << *SI << "\n"); in checkScopeHoistable()
905 "DropUnhoistableSelect", SI) in checkScopeHoistable()
911 Unhoistables.erase(SI); in checkScopeHoistable()
929 for (SelectInst *SI : Selects) { in checkScopeHoistable()
930 dbgs() << "SI " << *SI << "\n"; in checkScopeHoistable()
932 for (SelectInst *SI : Selects) { in checkScopeHoistable()
935 "DropSelectUnhoistableBranch", SI) in checkScopeHoistable()
939 llvm::erase_if(Selects, [EntryBB](SelectInst *SI) { in checkScopeHoistable() argument
940 return SI->getParent() == EntryBB; in checkScopeHoistable()
956 for (auto *SI : Selects) { in checkScopeHoistable() local
957 assert(!DT.dominates(SI, InsertPoint) && in checkScopeHoistable()
960 assert(checkHoistValue(SI->getCondition(), InsertPoint, DT, in checkScopeHoistable()
968 for (auto *SI : Selects) { in checkScopeHoistable() local
969 CHR_DEBUG(dbgs() << "SI " << *SI << "\n"); in checkScopeHoistable()
1031 for (SelectInst *SI : RI.Selects) { in getCHRConditionValuesForRegion()
1032 ConditionValues.insert(SI->getCondition()); in getCHRConditionValuesForRegion()
1109 for (SelectInst *SI : RI.Selects) in getSelectsInScope()
1110 Output.insert(SI); in getSelectsInScope()
1278 for (SelectInst *SI : Scope->TrueBiasedSelects) { in classifyBiasedScopes()
1279 dbgs() << *SI << ", "; in classifyBiasedScopes()
1283 for (SelectInst *SI : Scope->FalseBiasedSelects) { in classifyBiasedScopes()
1284 dbgs() << *SI << ", "; in classifyBiasedScopes()
1301 for (SelectInst *SI : RI.Selects) { in classifyBiasedScopes()
1302 if (TrueBiasedSelectsGlobal.contains(SI)) in classifyBiasedScopes()
1303 OutermostScope->TrueBiasedSelects.insert(SI); in classifyBiasedScopes()
1304 else if (FalseBiasedSelectsGlobal.contains(SI)) in classifyBiasedScopes()
1305 OutermostScope->FalseBiasedSelects.insert(SI); in classifyBiasedScopes()
1377 for (SelectInst *SI : RI.Selects) { in setCHRRegions()
1378 Unhoistables.insert(SI); in setCHRRegions()
1399 for (SelectInst *SI : RI.Selects) { in setCHRRegions()
1400 assert((OutermostScope->TrueBiasedSelects.contains(SI) || in setCHRRegions()
1401 OutermostScope->FalseBiasedSelects.contains(SI)) && in setCHRRegions()
1405 bool IsHoistable = checkHoistValue(SI->getCondition(), InsertPoint, DT, in setCHRRegions()
1494 for (SelectInst *SI : RI.Selects) { in hoistScopeConditions()
1495 bool IsTrueBiased = Scope->TrueBiasedSelects.count(SI); in hoistScopeConditions()
1496 bool IsFalseBiased = Scope->FalseBiasedSelects.count(SI); in hoistScopeConditions()
1499 hoistValue(SI->getCondition(), HoistPoint, R, Scope->HoistStopMap, in hoistScopeConditions()
1532 if (auto *SI = dyn_cast<SelectInst>(U)) { in negateICmpIfUsedByBranchOrSelectOnly() local
1534 SI->swapValues(); in negateICmpIfUsedByBranchOrSelectOnly()
1535 SI->swapProfMetadata(); in negateICmpIfUsedByBranchOrSelectOnly()
1536 if (Scope->TrueBiasedSelects.count(SI)) { in negateICmpIfUsedByBranchOrSelectOnly()
1537 assert(!Scope->FalseBiasedSelects.contains(SI) && in negateICmpIfUsedByBranchOrSelectOnly()
1539 Scope->FalseBiasedSelects.insert(SI); in negateICmpIfUsedByBranchOrSelectOnly()
1540 } else if (Scope->FalseBiasedSelects.count(SI)) { in negateICmpIfUsedByBranchOrSelectOnly()
1541 assert(!Scope->TrueBiasedSelects.contains(SI) && in negateICmpIfUsedByBranchOrSelectOnly()
1543 Scope->TrueBiasedSelects.insert(SI); in negateICmpIfUsedByBranchOrSelectOnly()
1625 for (SelectInst *SI : RI.Selects) in assertCHRRegionsHaveBiasedBranchOrSelect()
1626 if (Scope->TrueBiasedSelects.count(SI) || in assertCHRRegionsHaveBiasedBranchOrSelect()
1627 Scope->FalseBiasedSelects.count(SI)) in assertCHRRegionsHaveBiasedBranchOrSelect()
1658 for (SelectInst *SI : RI.Selects) { in assertBranchOrSelectConditionHoisted()
1659 bool IsTrueBiased = Scope->TrueBiasedSelects.count(SI); in assertBranchOrSelectConditionHoisted()
1660 bool IsFalseBiased = Scope->FalseBiasedSelects.count(SI); in assertBranchOrSelectConditionHoisted()
1663 Value *V = SI->getCondition(); in assertBranchOrSelectConditionHoisted()
1862 for (SelectInst *SI : RI.Selects) { in fixupBranchesAndSelects()
1863 fixupSelect(SI, Scope, IRB, MergedCondition, CHRBranchBias); in fixupBranchesAndSelects()
1932 void CHR::fixupSelect(SelectInst *SI, CHRScope *Scope, in fixupSelect() argument
1936 bool IsTrueBiased = Scope->TrueBiasedSelects.count(SI); in fixupSelect()
1938 Scope->FalseBiasedSelects.count(SI)) && "Must be biased"); in fixupSelect()
1939 assert(SelectBiasMap.contains(SI) && "Must be in the bias map"); in fixupSelect()
1940 BranchProbability Bias = SelectBiasMap[SI]; in fixupSelect()
1945 Value *Cond = SI->getCondition(); in fixupSelect()
1946 addToMergedCondition(IsTrueBiased, Cond, SI, Scope, IRB, in fixupSelect()
1951 SI->setCondition(NewCondition); in fixupSelect()