From: Chris Lattner Date: Sun, 5 Feb 2006 01:30:45 +0000 (+0000) Subject: Use the asmprinter to find out what the preferred alignment of a global is. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7d8d5a522fb6d9d83f5d89f30fe1badf68832efd;p=oota-llvm.git Use the asmprinter to find out what the preferred alignment of a global is. This patch speeds up 172.mgrid from 31.81s to 11.39s on darwin/ppc. Many many thanks to Nate for tracking down the root cause of the issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25979 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index ccd7fc46702..1a786291f0f 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -527,7 +527,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); unsigned Size = TD.getTypeSize(C->getType()); - unsigned Align = TD.getTypeAlignmentShift(C->getType()); + unsigned Align = getPreferredAlignmentLog(I); if (C->isNullValue() && /* FIXME: Verify correct */ (I->hasInternalLinkage() || I->hasWeakLinkage() ||