[llvm-dev] Branch is not optimized because of right shift

Stefanos Baziotis via llvm-dev llvm-dev at lists.llvm.org
Sat Apr 4 17:29:37 PDT 2020


Hi everyone,

In a twitch chat someone redirected me to an example that is not optimized:
https://godbolt.org/z/BL-4jL

I included the original source code and this is after -O2. We both thought
that the -8 branch could be optimized out. I added a nuw in the subtraction
and it actually does it.

Any thoughts on why that doesn't happen already?

Best,
Stefanos Baziotis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200405/f5b27e28/attachment.html>


More information about the llvm-dev mailing list