[llvm-commits] SHR Patch (For Review)

Chris Lattner clattner at apple.com
Tue Nov 7 21:28:44 PST 2006


On Nov 7, 2006, at 9:20 PM, Reid Spencer wrote:

>>           Op = InsertNewInstBefore(new CastInst(Op, I.getType(),
>> "tmp"), I);
>> -      return new ShiftInst(I.getOpcode(), Op,
>> +      ShiftInst* ShiftResult = new ShiftInst(I.getOpcode(), Op,
>>                              ConstantInt::get(Type::UByteTy, Amt));
>> +      if (I.getType() == ShiftResult->getType())
>> +        return ShiftResult;
>> +      InsertNewInstBefore(ShiftResult, I);
>> +      return new CastInst(ShiftResult, I.getType());
>>       }
>>
>> Why do you need the two casts?  If you don't, please remove them.
>
> That's the one that causes InstCombiner's replaceAllUsesWith call to
> assert because its the wrong type.  This is specifically the one I
> warned you about :)
>
> If you can see a way to eliminate it, please feel free after I commit
> it. We already tried and it breaks.

Fair enough.  Thanks,

-Chris



More information about the llvm-commits mailing list