[llvm] r244313 - Revert "Make global aliases have symbol size equal to their type"

John Brawn via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 03:56:22 PDT 2015


Author: john.brawn
Date: Fri Aug  7 05:56:21 2015
New Revision: 244313

URL: http://llvm.org/viewvc/llvm-project?rev=244313&view=rev
Log:
Revert "Make global aliases have symbol size equal to their type"

This reverts r242520, as it caused pr24379. Also removes part of the test added
by r243874 that checks the size of alias symbols.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll
    llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll
    llvm/trunk/test/CodeGen/ARM/aliases.ll
    llvm/trunk/test/CodeGen/ARM/global-merge-external.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=244313&r1=244312&r2=244313&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Aug  7 05:56:21 2015
@@ -1184,16 +1184,6 @@ bool AsmPrinter::doFinalization(Module &
 
     // Emit the directives as assignments aka .set:
     OutStreamer->EmitAssignment(Name, lowerConstant(Alias.getAliasee()));
-
-    // Set the size of the alias symbol if we can, as otherwise the alias gets
-    // the size of the aliasee which may not be correct e.g. if the alias is of
-    // a member of a struct.
-    if (MAI->hasDotTypeDotSizeDirective() && Alias.getValueType()->isSized()) {
-      const DataLayout &DL = M.getDataLayout();
-      uint64_t Size = DL.getTypeAllocSize(Alias.getValueType());
-      OutStreamer->emitELFSize(cast<MCSymbolELF>(Name),
-                               MCConstantExpr::create(Size, OutContext));
-    }
   }
 
   GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();

Modified: llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll?rev=244313&r1=244312&r2=244313&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll Fri Aug  7 05:56:21 2015
@@ -35,13 +35,10 @@ define void @g1(i32 %a1, i32 %a2) {
 
 ;CHECK:	.globl	x
 ;CHECK: x = _MergedGlobals_x
-;CHECK: .size x, 4
 ;CHECK:	.globl	y
 ;CHECK: y = _MergedGlobals_x+4
-;CHECK: .size y, 4
 ;CHECK:	.globl	z
 ;CHECK: z = _MergedGlobals_x+8
-;CHECK: .size z, 4
 
 ;CHECK-APPLE-IOS: .globl	__MergedGlobals_x       ; @_MergedGlobals_x
 ;CHECK-APPLE-IOS: .zerofill __DATA,__common,__MergedGlobals_x,12,3

Modified: llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll?rev=244313&r1=244312&r2=244313&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll Fri Aug  7 05:56:21 2015
@@ -42,10 +42,8 @@ define void @f1(i32 %a1, i32 %a2, i32 %a
 
 ;CHECK:	.globl	x
 ;CHECK: x = _MergedGlobals_x+4
-;CHECK: .size x, 4000
 ;CHECK:	.globl	y
 ;CHECK: y = _MergedGlobals_y
-;CHECK: .size y, 4000
 
 ;CHECK-APPLE-IOS:.globl	_x
 ;CHECK-APPLE-IOS: _x = __MergedGlobals_x+4

Modified: llvm/trunk/test/CodeGen/ARM/aliases.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/aliases.ll?rev=244313&r1=244312&r2=244313&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/aliases.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/aliases.ll Fri Aug  7 05:56:21 2015
@@ -2,34 +2,19 @@
 
 ; CHECK: .globl	test
 
-; CHECK: .globl structvar
-; CHECK: .size structvar, 8
-
 ; CHECK: .globl	foo1
 ; CHECK: foo1 = bar
-; CHECK: .size foo1, 4
 
 ; CHECK: .globl	foo2
 ; CHECK: foo2 = bar
-; CHECK: .size foo2, 4
 
 ; CHECK: .weak	bar_f
 ; CHECK: bar_f = foo_f
 
 ; CHECK: bar_i = bar
-; CHECK: .size bar_i, 4
 
 ; CHECK: .globl	A
 ; CHECK: A = bar
-; CHECK: .size A, 8
-
-; CHECK: .globl elem0
-; CHECK: elem0 = structvar
-; CHECK: .size elem0, 4
-
-; CHECK: .globl elem1
-; CHECK: elem1 = structvar+4
-; CHECK: .size elem1, 4
 
 @bar = global i32 42
 @foo1 = alias i32* @bar
@@ -46,10 +31,6 @@ define i32 @foo_f() {
 
 @A = alias bitcast (i32* @bar to i64*)
 
- at structvar = global {i32, i32} {i32 1, i32 2}
- at elem0 = alias getelementptr({i32, i32}, {i32, i32}*  @structvar, i32 0, i32 0)
- at elem1 = alias getelementptr({i32, i32}, {i32, i32}*  @structvar, i32 0, i32 1)
-
 define i32 @test() {
 entry:
    %tmp = load i32, i32* @foo1

Modified: llvm/trunk/test/CodeGen/ARM/global-merge-external.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/global-merge-external.ll?rev=244313&r1=244312&r2=244313&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/global-merge-external.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/global-merge-external.ll Fri Aug  7 05:56:21 2015
@@ -39,10 +39,7 @@ define void @g1(i32 %a1, i32 %a2) {
 
 ;CHECK-MERGE:	.globl	x
 ;CHECK-MERGE: x = _MergedGlobals_x
-;CHECK-MERGE: .size x, 4
 ;CHECK-MERGE:	.globl	y
 ;CHECK-MERGE: y = _MergedGlobals_x+4
-;CHECK-MERGE: .size y, 4
 ;CHECK-MERGE:	.globl	z
 ;CHECK-MERGE: z = _MergedGlobals_x+8
-;CHECK-MERGE: .size z, 4




More information about the llvm-commits mailing list