I recently got to know the constraint elimination pass which solves simple ineqaulty constraints and implications.
But this passes accepts equality facts and view it as ule predicate, while ignores the equality checks in ConstraintInfo::getConstraintForSolving, here is a example Compiler Explorer
I look through some commit logs but still do not figure out the reasons. Is this somewhat compile-time concerns? If we indeed want to do similar implications, what will be the best practice?
Equalities need to be transferred into inequalities, so A == B is modeled as A >= B && A <= B. A the moment, the logic to collect facts supports equalities by simplify adding A >= B and A <= B as facts.
You don’t need to handle all possible cases in the initial patch. As for 1. yes that’s true, but there’s a bunch of logic to transfer signed facts to the unsigned system. Facts from equality predicates are added to the unsigned system, so initially it should be fine to just query the unsigned system.
As for 2), I think you should be able to just do CS.isConditionImplied(A >= B) && CS.isConditionImplied(A <=B)?