From 6cdb7e22aaa229d2b2845d7e8a5a11a30eeaac99 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 1 Apr 2010 20:13:28 +0000 Subject: [PATCH] Skip checking preferred alignment of GVs defined in other translation units all together. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100133 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4fcfeecb49a..0ba65ab7f96 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -6152,7 +6152,7 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const { unsigned Align = GV->getAlignment(); if (!Align) { if (GlobalVariable *GVar = dyn_cast(GV)) { - if (GV->getType()->getElementType()->isSized()) { + if (GVar->hasInitializer()) { const TargetData *TD = TLI.getTargetData(); Align = TD->getPreferredAlignment(GVar); } -- 2.34.1