[PATCH] ComputeKnownBits: be a bit smarter about ADDs

hfinkel at anl.gov hfinkel at anl.gov
Sun Jun 28 02:35:40 PDT 2015


In http://reviews.llvm.org/D10512#196063, @escha wrote:

> I really can't think of anything without going into x86-specific backend hacks (or other larger-scale changes in the constant optimization bits of the backend) :-/
>
> LLVM tries to aggressively shrink constants in the general case, and unfortunately it hurts here... but I imagine it already hurts in a lot of other cases, this optimization just exposes one more.


I agree, and we should fix this. The code that generates 'andq    $-16, %rax' should more-generally match  $34359738352 too as -16 by checking that the upper bits of the incoming value are known to be zero.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10512

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list