From 3d35b45f8e709316142cd469c9e16e29b214c2a6 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sun, 18 Nov 2012 05:39:39 +0000 Subject: Don't try to calculate the alignment of an unsigned type. Fixes PR14371! llvm-svn: 168280 --- llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/InstCombine') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 4ab5b6e4a04..4d106fc1885 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -164,7 +164,8 @@ static unsigned getPointeeAlignment(Value *V, const DataLayout &TD) { return TD.getPreferredAlignment(GV); if (PointerType *PT = dyn_cast(V->getType())) - return TD.getABITypeAlignment(PT->getElementType()); + if (PT->getElementType()->isSized()) + return TD.getABITypeAlignment(PT->getElementType()); return 0; } -- cgit v1.2.3