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

John Regehr via llvm-dev llvm-dev at lists.llvm.org
Sat Apr 4 21:12:02 PDT 2020


I'm not sure that I've captured what you mean here, but you can explore 
these sorts of things using Alive2:

   http://volta.cs.utah.edu:8080/z/b7Yj7j

John



On 4/4/20 6:29 PM, Stefanos Baziotis via llvm-dev wrote:
> 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
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 


More information about the llvm-dev mailing list