[llvm-commits] [pr1225] Fix using instcombine instead of instsimplify

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Apr 4 05:52:03 PDT 2012

> why do you zap the Mask argument to ComputeMaskedBits?

To get the information about all the bits.

>From the email in the thread:

It was not working because of the '& ~RHSKnownZero'.  The RHS was 1,
so we would ask for information about the lsb bit and fail to see that
all the other bits where known to be zero.

It is very important that we pass the reduced mask to
SimplifyDemandedBits since it enables it to do optimizations that are
not valid for the other bits, so we cannot just drop the and.

I tried adding a second call to ComputeMaskedBits with the original
mask just after the calls to SimplifyDemandedBits. This worked, but
still had a noticeable performance impact.

What worked in the end was changing ComputeMaskedBits to always
compute information for all the bits.

> Ciao, Duncan.


More information about the llvm-commits mailing list