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

Dan Gohman dan433584 at gmail.com
Mon Nov 19 11:17:40 PST 2012


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.

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121119/b20665b4/attachment.html>


More information about the llvm-commits mailing list