<p dir="ltr">Thanks! </p>
<div class="gmail_quote">On Aug 7, 2015 7:00 AM, "John Brawn" <<a href="mailto:John.Brawn@arm.com">John.Brawn@arm.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> I think we should revert it form trunk and 3.7 for now.<br>
<br>
Reverted from trunk, I've checked and it's not present on 3.7.<br>
<br>
John<br>
<br>
> -----Original Message-----<br>
> From: Rafael Espíndola [mailto:<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>]<br>
> Sent: 06 August 2015 20:24<br>
> To: John Brawn<br>
> Cc: Hans Wennborg; <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> Subject: Re: [llvm] r242520 - Make global aliases have symbol size equal to their type<br>
><br>
> This caused pr24379.<br>
><br>
> I think we should revert it form trunk and 3.7 for now.<br>
><br>
> On 17 July 2015 at 08:12, John Brawn <<a href="mailto:john.brawn@arm.com">john.brawn@arm.com</a>> wrote:<br>
> > Author: john.brawn<br>
> > Date: Fri Jul 17 07:12:03 2015<br>
> > New Revision: 242520<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=242520&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=242520&view=rev</a><br>
> > Log:<br>
> > Make global aliases have symbol size equal to their type<br>
> ><br>
> > This is mainly for the benefit of GlobalMerge, so that an alias into a<br>
> > MergedGlobals variable has the same size as the original non-merged<br>
> > variable.<br>
> ><br>
> > Differential Revision: <a href="http://reviews.llvm.org/D10837" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10837</a><br>
> ><br>
> > Modified:<br>
> > llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
> > llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll<br>
> > llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll<br>
> > llvm/trunk/test/CodeGen/ARM/aliases.ll<br>
> ><br>
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=242520&r1=242519&r2=242520&vi<br>
> ew=diff<br>
> > ==============================================================================<br>
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)<br>
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Jul 17 07:12:03 2015<br>
> > @@ -1111,6 +1111,16 @@ bool AsmPrinter::doFinalization(Module &<br>
> ><br>
> > // Emit the directives as assignments aka .set:<br>
> > OutStreamer->EmitAssignment(Name, lowerConstant(Alias.getAliasee()));<br>
> > +<br>
> > + // Set the size of the alias symbol if we can, as otherwise the alias gets<br>
> > + // the size of the aliasee which may not be correct e.g. if the alias is of<br>
> > + // a member of a struct.<br>
> > + if (MAI->hasDotTypeDotSizeDirective() && Alias.getValueType()->isSized()) {<br>
> > + const DataLayout &DL = M.getDataLayout();<br>
> > + uint64_t Size = DL.getTypeAllocSize(Alias.getValueType());<br>
> > + OutStreamer->emitELFSize(cast<MCSymbolELF>(Name),<br>
> > + MCConstantExpr::create(Size, OutContext));<br>
> > + }<br>
> > }<br>
> ><br>
> > GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();<br>
> ><br>
> > Modified: llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/global-merge-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/global-merge-</a><br>
> 2.ll?rev=242520&r1=242519&r2=242520&view=diff<br>
> > ==============================================================================<br>
> > --- llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll (original)<br>
> > +++ llvm/trunk/test/CodeGen/AArch64/global-merge-2.ll Fri Jul 17 07:12:03 2015<br>
> > @@ -35,10 +35,13 @@ define void @g1(i32 %a1, i32 %a2) {<br>
> ><br>
> > ;CHECK: .globl x<br>
> > ;CHECK: x = _MergedGlobals_x<br>
> > +;CHECK: .size x, 4<br>
> > ;CHECK: .globl y<br>
> > ;CHECK: y = _MergedGlobals_x+4<br>
> > +;CHECK: .size y, 4<br>
> > ;CHECK: .globl z<br>
> > ;CHECK: z = _MergedGlobals_x+8<br>
> > +;CHECK: .size z, 4<br>
> ><br>
> > ;CHECK-APPLE-IOS: .globl __MergedGlobals_x ; @_MergedGlobals_x<br>
> > ;CHECK-APPLE-IOS: .zerofill __DATA,__common,__MergedGlobals_x,12,3<br>
> ><br>
> > Modified: llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/global-merge-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/global-merge-</a><br>
> 3.ll?rev=242520&r1=242519&r2=242520&view=diff<br>
> > ==============================================================================<br>
> > --- llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll (original)<br>
> > +++ llvm/trunk/test/CodeGen/AArch64/global-merge-3.ll Fri Jul 17 07:12:03 2015<br>
> > @@ -42,8 +42,10 @@ define void @f1(i32 %a1, i32 %a2, i32 %a<br>
> ><br>
> > ;CHECK: .globl x<br>
> > ;CHECK: x = _MergedGlobals_x+4<br>
> > +;CHECK: .size x, 4000<br>
> > ;CHECK: .globl y<br>
> > ;CHECK: y = _MergedGlobals_y<br>
> > +;CHECK: .size y, 4000<br>
> ><br>
> > ;CHECK-APPLE-IOS:.globl _x<br>
> > ;CHECK-APPLE-IOS: _x = __MergedGlobals_x+4<br>
> ><br>
> > Modified: llvm/trunk/test/CodeGen/ARM/aliases.ll<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/test/CodeGen/ARM/aliases.ll?rev=242520&r1=242519&r2=242520&view=diff<br>
> > ==============================================================================<br>
> > --- llvm/trunk/test/CodeGen/ARM/aliases.ll (original)<br>
> > +++ llvm/trunk/test/CodeGen/ARM/aliases.ll Fri Jul 17 07:12:03 2015<br>
> > @@ -2,19 +2,34 @@<br>
> ><br>
> > ; CHECK: .globl test<br>
> ><br>
> > +; CHECK: .globl structvar<br>
> > +; CHECK: .size structvar, 8<br>
> > +<br>
> > ; CHECK: .globl foo1<br>
> > ; CHECK: foo1 = bar<br>
> > +; CHECK: .size foo1, 4<br>
> ><br>
> > ; CHECK: .globl foo2<br>
> > ; CHECK: foo2 = bar<br>
> > +; CHECK: .size foo2, 4<br>
> ><br>
> > ; CHECK: .weak bar_f<br>
> > ; CHECK: bar_f = foo_f<br>
> ><br>
> > ; CHECK: bar_i = bar<br>
> > +; CHECK: .size bar_i, 4<br>
> ><br>
> > ; CHECK: .globl A<br>
> > ; CHECK: A = bar<br>
> > +; CHECK: .size A, 8<br>
> > +<br>
> > +; CHECK: .globl elem0<br>
> > +; CHECK: elem0 = structvar<br>
> > +; CHECK: .size elem0, 4<br>
> > +<br>
> > +; CHECK: .globl elem1<br>
> > +; CHECK: elem1 = structvar+4<br>
> > +; CHECK: .size elem1, 4<br>
> ><br>
> > @bar = global i32 42<br>
> > @foo1 = alias i32* @bar<br>
> > @@ -31,6 +46,10 @@ define i32 @foo_f() {<br>
> ><br>
> > @A = alias bitcast (i32* @bar to i64*)<br>
> ><br>
> > +@structvar = global {i32, i32} {i32 1, i32 2}<br>
> > +@elem0 = alias getelementptr({i32, i32}, {i32, i32}* @structvar, i32 0, i32 0)<br>
> > +@elem1 = alias getelementptr({i32, i32}, {i32, i32}* @structvar, i32 0, i32 1)<br>
> > +<br>
> > define i32 @test() {<br>
> > entry:<br>
> > %tmp = load i32, i32* @foo1<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
<br>
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br>
<br>
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590<br>
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782<br>
</blockquote></div>