[llvm] [InstCombine] Fold comparisons contradicted by dominating expression conditions (PR #227030)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 13:57:10 PDT 2026


================

----------------
andjo403 wrote:

can this not be simplified by moving in the new code in handleDomCond?
```
auto handleDomCond = [&](bool TrueEdge, ICmpInst::Predicate DomPred, const Value *DomX
                           const APInt *DomC) -> Instruction * {
if(DomX != X){
//new fold
}

...
    if (!match(BI->getCondition(),
               m_ICmp(DomPred, m_Value(DomX), m_APInt(DomC))) || !(Cmp.isEquality() || DomX = X)) {
```


https://github.com/llvm/llvm-project/pull/227030


More information about the llvm-commits mailing list