[PATCH][RFC] Provide alignment info on LLVM external symbols

Rafael Espíndola rafael.espindola at gmail.com
Mon Mar 30 13:47:52 PDT 2015


LGTM.

Fixing the FIXME would be better, but a fix with a testcase is also OK.

On 30 March 2015 at 14:27, Ulrich Weigand <Ulrich.Weigand at de.ibm.com> wrote:
>
>
> Hello,
>
> code in CodeGenModule::GetOrCreateLLVMGlobal that sets up GlobalValue
> object for LLVM external symbols has this comment:
>
>     // FIXME: This code is overly simple and should be merged with other
> global
>     // handling.
>
> One part does seems to be "overly simple" currently is that this code
> never sets any alignment info on the GlobalValue, so that the emitted
> IR does not have any align attribute on external globals.  This can
> lead to unnecessarily inefficient code generation.
>
> The following patch adds a GV->setAlignment call to set alignment info.
>
> (See attached file: clang-align-extern)
>
>
> Mit freundlichen Gruessen / Best Regards
>
> Ulrich Weigand
>
> --
>   Dr. Ulrich Weigand | Phone: +49-7031/16-3727
>   STSM, GNU/Linux compilers and toolchain
>   IBM Deutschland Research & Development GmbH
>   Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung: Dirk
> Wittkopp
>   Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
> Stuttgart, HRB 243294
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list