[LLVMdev] Why can't comparisons with negative zero be simplified?

Robison, Arch arch.robison at intel.com
Mon Jul 6 16:03:01 PDT 2015


Thanks for the info.  I'll patch the tests if necessary.

- Arch

-----Original Message-----
From: Matt Arsenault [mailto:Matthew.Arsenault at amd.com] 
Sent: Monday, July 6, 2015 5:49 PM
To: Sean Silva; Robison, Arch
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Why can't comparisons with negative zero be simplified?

On 07/06/2015 03:06 PM, Sean Silva wrote:
> +Matt who is the one that originally committed this (r225265).
>
> -- Sean Silva
I think it's fine, but I was being extremely conservative with what it allows. This really should work in a lot more cases. Before my patch, it only worked for smaller integer types instead of considering the values. 
When I was working on this, I had it checking if the constant being compared could be represented by the integer type (e.g. fcmp eq with a fractional value -> false and also allow the non-equality compares). I think it was just disturbingly hard to break and I was afraid of breaking some edge case when the only real world cases I really cared about was eq/ne 0.

-Matt




More information about the llvm-dev mailing list