[LLVMdev] [RFC/PATCH][3/4] New SystemZ backend:Clang changes

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Sun Apr 14 11:00:33 PDT 2013


Hello,

this set of patches adds Clang support for SystemZ.

The first patch adds a new common code feature that allows platform code to
request minimum alignment of global symbols.  The background for this is
that on System Z, the most efficient way to load addresses of global symbol
is the LOAD ADDRESS RELATIVE LONG (LARL) instruction.  This instruction
provides PC-relative addressing, but only to *even* addresses.  For this
reason, existing compilers will guarantee that global symbols are always
aligned to at least 2.  [ Since symbols would otherwise already use a
default alignment based on their type, this will usually only affect global
objects of character type or character arrays. ]  GCC also allows creating
symbols without that extra alignment by using explicit "aligned" attributes
(which then need to be used on both definition and each use of the symbol).

To enable support for this with Clang, the first patch adds a
TargetInfo::MinGlobalAlign variable that provides a global minimum for the
alignment of every global object (unless overridden via explicit alignment
attribute), and adds code to respect this setting.  Within this patch, no
platform actually sets the value to anything but the default 1, resulting
in no change in behaviour on any existing target.  This patch probably
ought to be applied simultaneous with the second patch, but is provided
separately to simplify review.

The second patch then adds all the usual platform-specific pieces for
SystemZ: driver support, basic target info, register names and constraints,
ABI info and vararg support.  It also adds new tests to verify pre-defined
macros, and updates a test for the minimum alignment change.

[See also LLVMdev for the full set of SystemZ patches and discussion.]

Bye,
Ulrich

(See attached file: diff-systemz-clang-minglobalalign)(See attached file:
diff-systemz-clang)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-systemz-clang-minglobalalign
Type: application/octet-stream
Size: 7346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130414/ab18b4ce/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-systemz-clang
Type: application/octet-stream
Size: 34447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130414/ab18b4ce/attachment-0001.obj>


More information about the llvm-dev mailing list