Use the asmprinter to find out what the preferred alignment of a global is.
authorChris Lattner <sabre@nondot.org>
Sun, 5 Feb 2006 01:30:45 +0000 (01:30 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 5 Feb 2006 01:30:45 +0000 (01:30 +0000)
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

lib/Target/PowerPC/PPCAsmPrinter.cpp

index ccd7fc46702c4f8121d00dafb900c1f290994107..1a786291f0ff7a3df6ec022f91e225056acca32f 100644 (file)
@@ -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() ||