The pass should help to close a functional gap when it comes to
reasoning about related conditions in a relatively general way.
It addresses multiple existing issues (linked below) and the need for a
more powerful reasoning system was also discussed recently in
https://discourse.llvm.org/t/rfc-alternative-approach-of-dealing-with-implications-from-comparisons-through-pos-analysis/65601/7
On AArch64, the new pass performs ~2000 simplifications on
MultiSource,SPEC2006,SPEC2017 with -O3.
Compile-time impact:
NewPM-O3: +0.20%
NewPM-ReleaseThinLTO: +0.32%
NewPM-ReleaseLTO-g: +0.28%
Fixes #49344.
Fixes #47888.
Fixes #48253.
Fixes #49229.
Fixes #58074.
Land this change separately?
Also, looking at the position of ConstraintElimination in the normal pipeline, did you experiment with different pipeline positions? The current scheduling looks too early to me, it runs directly after SROA/EarlyCSE at the start of the function simplification pipeline. I would expect that running ConstraintElimination at least after the first InstCombine pass would be beneficial, to ensure that IR is in canonical form.