[llvm-commits] [llvm] r61119 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp test/CodeGen/X86/2008-12-16-BadShift.ll

Dan Gohman gohman at apple.com
Tue Dec 16 20:50:26 PST 2008


On Wed, 2008-12-17 at 03:35 +0000, Eli Friedman wrote:
> Author: efriedma
> Date: Tue Dec 16 21:35:17 2008
> New Revision: 61119
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=61119&view=rev
> Log:
> Fix for PR3225: disable a broken optimization in
> DAGTypeLegalizer::ExpandShiftWithKnownAmountBit.
> 
> In terms of restoring the optimization, the best fix here isn't 
> obvious... any ideas?

>    // If we know that all of the high bits of the shift amount are zero, then we
>    // can do this as a couple of simple shifts.
>    if ((KnownZero & HighBitMask) == HighBitMask) {

It might be possible to rescue the optimization in some cases by
adding a check for known ones, with something like this:

  (KnownOne & ~HighBitMask) != 0

Dan





More information about the llvm-commits mailing list