Skip checking preferred alignment of GVs defined in other translation units all together.

llvm-svn: 100133
This commit is contained in:
Evan Cheng 2010-04-01 20:13:28 +00:00
parent d9929f03cf
commit 8563ee4ed4
1 changed files with 1 additions and 1 deletions

View File

@ -6152,7 +6152,7 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const {
unsigned Align = GV->getAlignment();
if (!Align) {
if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
if (GV->getType()->getElementType()->isSized()) {
if (GVar->hasInitializer()) {
const TargetData *TD = TLI.getTargetData();
Align = TD->getPreferredAlignment(GVar);
}