Lines Matching defs:BI
844 BranchInst *BI = dyn_cast<BranchInst>(NonConstBB->getTerminator());
845 if (!BI || !BI->isUnconditional()) return nullptr;
2082 Instruction *InstCombiner::visitBranchInst(BranchInst &BI) {
2087 if (match(&BI, m_Br(m_Not(m_Value(X)), TrueDest, FalseDest)) &&
2090 BI.setCondition(X);
2091 BI.swapSuccessors();
2092 return &BI;
2097 if (BI.isConditional() &&
2098 BI.getSuccessor(0) == BI.getSuccessor(1) &&
2099 !isa<UndefValue>(BI.getCondition())) {
2100 BI.setCondition(UndefValue::get(BI.getCondition()->getType()));
2101 return &BI;
2106 if (match(&BI, m_Br(m_FCmp(FPred, m_Value(X), m_Value(Y)),
2108 BI.getCondition()->hasOneUse())
2111 FCmpInst *Cond = cast<FCmpInst>(BI.getCondition());
2115 BI.swapSuccessors();
2117 return &BI;
2122 if (match(&BI, m_Br(m_ICmp(IPred, m_Value(X), m_Value(Y)),
2124 BI.getCondition()->hasOneUse())
2128 ICmpInst *Cond = cast<ICmpInst>(BI.getCondition());
2131 BI.swapSuccessors();
2133 return &BI;
2954 if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
2955 if (BI->isConditional() && isa<ConstantInt>(BI->getCondition())) {
2956 bool CondVal = cast<ConstantInt>(BI->getCondition())->getZExtValue();
2957 BasicBlock *ReachableBB = BI->getSuccessor(!CondVal);