[LLVMdev] Why can't comparisons with negative zero be simplified? (original) (raw)

Matt Arsenault Matthew.Arsenault at amd.com
Mon Jul 6 15:48:58 PDT 2015


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