[LLVMdev] Possible bug in ExpandShiftWithUnknownAmountBit
javier at jmartinez.org
Fri Dec 4 13:59:42 PST 2009
I don't know if the optimization would help us much. Our architecture
performs integer shifts and subtractions at the same speed. I think the
optimization is limited to the case where NVBits is a power of two. That is
the case for all current value types but there's a separate thread where
someone is proposing adding i20 as a native type.
In your previous email you mentioned some comments added to check-in 90564.
In our architecture shifting by 0 doesn't cause any problems but the
comment might be valid for others.
On Fri, 04 Dec 2009 21:42:36 +0100, Duncan Sands <baldrick at free.fr> wrote:
> PS: For a small optimization, in the case where Amt is bigger than 32
> (or whatever NVTBits is) you might want to use an "and" to mask off
> the top bits of Amt rather than subtracting 32 (if Amt is 64 or greater
> then the result of the shift was undefined anyway, so it is ok to mask
> off all the upper bits).
More information about the llvm-dev