[llvm-commits] [llvm] r92943 - in /llvm/trunk: lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/Generic/2009-04-28-i128-cmp-crash.ll

Evan Cheng evan.cheng at apple.com
Fri Jan 8 16:31:07 PST 2010


On Jan 7, 2010, at 10:11 PM, Duncan Sands wrote:

> Hi Evan,
> 
>> -      unsigned ShAmt = cast<ConstantSDNode>(N0.getOperand(1))->getZExtValue();
>> +      const APInt &ShAmt
>> +        = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue();
> 
> if the shift amount is too big to fit in unsigned, then I guess the shift is
> undefined, even on arbitrary precision integers.  So how about using going back
> to unsigned but with getLimitedValue instead of getZExtValue?

Does it actually matters though? (That is, would this actually cause codegen difference?) I'd prefer for the whole function to be consistent by using APInt.

Evan

> 
> Ciao,
> 
> Duncan,





More information about the llvm-commits mailing list