[llvm-commits] [llvm] r168280 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp test/Transforms/InstCombine/alloca.ll

Eli Friedman eli.friedman at gmail.com
Mon Nov 26 15:06:47 PST 2012


On Mon, Nov 19, 2012 at 11:17 AM, Dan Gohman <dan433584 at gmail.com> wrote:
> On Sat, Nov 17, 2012 at 9:39 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
>>
>> Modified:
>> llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=168280&r1=168279&r2=168280&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
>> (original)
>> +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
>> Sat Nov 17 23:39:39 2012
>> @@ -164,7 +164,8 @@
>>        return TD.getPreferredAlignment(GV);
>>
>>    if (PointerType *PT = dyn_cast<PointerType>(V->getType()))
>> -    return TD.getABITypeAlignment(PT->getElementType());
>> +    if (PT->getElementType()->isSized())
>> +      return TD.getABITypeAlignment(PT->getElementType());
>
>
> Actually, this code is still buggy. It's not safe to rely on the ElementType
> of a pointer type to indicate alignment at all. This code should just be
> removed altogether.

Done in r168629.

-Eli



More information about the llvm-commits mailing list