[InstCombine] Inefficient pattern for high-bits checking 2 (PR38708)
It is sometimes important to check that some newly-computed value
is non-negative and only n bits wide (where n is a variable.)
There are many ways to check that:
The last variant seems best?
(I'm sure there are some other variations i haven't thought of..)
More complicated, canonical pattern:
We do need to have two switch()'es like this,
to not mismatch the swappable predicates.
Reviewers: spatel, craig.topper, RKSimon
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D52001