This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Inefficient pattern for high-bits checking (PR38708)
ClosedPublic

Authored by lebedev.ri on Sep 12 2018, 7:21 AM.

Details

Summary

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:
https://godbolt.org/z/o4RB8D
The last variant seems best?
(I'm sure there are some other variations i haven't thought of..)

Let's handle the second variant first, since it is much simpler.
https://rise4fun.com/Alive/LYjY

https://bugs.llvm.org/show_bug.cgi?id=38708

Diff Detail

Repository
rL LLVM