[llvm-commits] [llvm] r85478 - /llvm/trunk/lib/Analysis/MemoryBuiltins.cpp

Chris Lattner clattner at apple.com
Thu Oct 29 14:25:13 PDT 2009


On Oct 29, 2009, at 1:26 AM, Duncan Sands wrote:
> Hi,
>
>>       ConstantInt* Op1Int = dyn_cast<ConstantInt>(Op1);
>>       if (!Op1Int) return NULL;
>>       Value* Op1Pow = ConstantInt::get(Op1->getType(),
>> -                                       pow(2, Op1Int- 
>> >getZExtValue()));
>> +                                       pow((double) 2, (double)  
>> Op1Int->getZExtValue()));
>
> this is an integer power: 2 to the power of Op1Int.  This shouldn't  
> be done like
> this at all!  It's just a shift left for heavens sake - why the  
> doubles?!  It
> can other be done in uint64_t, or using the APInt shift methods.
>
> /me makes note to self to audit this code for other monstrosities.

Victor, please take a look at this.

-Chris



More information about the llvm-commits mailing list