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

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Mon Mar 30 11:27:35 PDT 2015



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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-align-extern
Type: application/octet-stream
Size: 1748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150330/f6020d8e/attachment.obj>


More information about the cfe-commits mailing list