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

Victor Hernandez vhernandez at apple.com
Thu Oct 29 15:22:30 PDT 2009


On Oct 29, 2009, at 2:25 PM, Chris Lattner wrote:

> 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.
>

I am looking now at rewriting this to avoid the doubles.

Victor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091029/36426d1c/attachment.html>


More information about the llvm-commits mailing list