[ConstraintElim] Unify no-wrap queries. (#223537)
Unify no-wrap queries in new isKnownNoWrap helper, which checks both
wrap flags on instructions and query-based reasoning in a single place.
Checks signed/unsigned wrap depending on a flag.
Update both decompose and tryToStrengthenFlags to use shared helper.
This improves results in a number of cases, because some rules were only
implemented for tryToStrengthenFlags and others in decompose:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1313
Note that there are 2-3 small regressions due added flags/removed
branches pessimizing other parts of the pipeline.
Compile-time impact in the noise for geomean. Notable individual changes
is mafft -0.05% in stage1-ReleaseThinLTO, and lencod +0.05% for
stage2-O3.
https://llvm-compile-time-tracker.com/compare.php?from=54005dacf264d79e403808a704b18bcf1cbe956f&to=507624eb897062648a907245c46885d8af15359d&stat=instructions:u
PR: https://github.com/llvm/llvm-project/pull/223537