[llvm-commits] [llvm] r103347 - in /llvm/trunk: lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/2010-05-08-OneBit.ll

Chris Lattner clattner at apple.com
Sat May 8 13:19:27 PDT 2010


On May 8, 2010, at 1:10 PM, Duncan Sands wrote:

> Hi Chris,
> 
>> @@ -1132,8 +1132,8 @@
>>                                     Instruction *InsertPt, const TargetData&TD){
>>    LLVMContext&Ctx = SrcVal->getType()->getContext();
>> 
>> -  uint64_t StoreSize = TD.getTypeSizeInBits(SrcVal->getType())/8;
>> -  uint64_t LoadSize = TD.getTypeSizeInBits(LoadTy)/8;
>> +  uint64_t StoreSize = (TD.getTypeSizeInBits(SrcVal->getType()) + 7) / 8;
> 
> it looks like this should be
>   uint64_t StoreSize = TD.getTypeStoreSize(SrcVal->getType());
> 
>> +  uint64_t LoadSize = (TD.getTypeSizeInBits(LoadTy) + 7) / 8;
> 
> and this
>   uint64_t LoadSize = TD.getTypeStoreSize(LoadTy);

I wasn't comfortable changing that without a testcase.  LoadSize should be the non-memory size I think, as in the other case, which has a testcase.

-Chris



More information about the llvm-commits mailing list