Starting with z/OS® V1R13
XL C compiler, the IPA option can be used with the METAL option. IPA
is an optimization option that enables the compiler to find more optimization
opportunities to improve your application performance. For more information
about IPA, see the Using the IPA option section in
z/OS XL C/C++ Programming Guide and
the IPA considerations section in
z/OS XL C/C++ User's Guide.
You need to be aware of the following adjustments when invoking
IPA for METAL.
- The LONGNAME option is in effect by default when IPA is specified.
- The IPA compile step only produces IPA object in the output file.
Only IPA(NOOBJECT) is allowed, which instructs IPA to stop the compile
process after the IPA object is produced. It does not produce HLASM
source code, so the GENASM option cannot be used.
- The output file from IPA link step is one single HLASM source
file for the whole program, and the GENASM option is required. There
could be multiple structures in the HLASM source program, one for
each partition. Under USS, the output HLASM source file resides in
the directory where the IPA link took place. The default output file
name for USS is a.s. In BATCH mode, the output HLASM source file goes
in the dataset allocated to DD SYSLIN in the IPA link step.
- At the IPA link phase, all external references must be resolved.
For Metal C, IPA does not attempt to convert external object modules
or load modules into object code for the inclusion in the IPA produced
program. You need to provide the same set of library data sets to
both IPA link and the binder for symbol resolution.
- If you specify the PROLOG and EPILOG compiler options to supply
your own prolog and epilog macros at compile time, the macros will
only be applied to the functions defined in the source file.
- If you have #pragma insert_asm in your source file, IPA will assume
the strong connection between the string provided by the pragma and
the functions in the source file. IPA will not move functions defined
in that source file to anywhere else.
- If you use global register variable or the RESERVE_REGS option
during your compile, IPA link will merge the registers specified in
the compile steps and apply the merged set of the originated compilation
units to a partition.
- If you use the DSAUSER option in any of your compile steps, IPA
link applies the option to the entire program.
The following compiler options are not supported by METAL with
IPA:
The following IPA suboptions are not supported with the METAL option:
- ATTRIBUTE
- GONUM
- PDF suboptions
The following IPA control file directives are not supported with
the METAL option:
Example
The
following example shows how to compile a Metal C program with IPA.
- IPA compile phase:
-
xlc -qmetal -qipa -c x.c
xlc -qmetal -qipa -c y.c
The
above commands produce x.o and y.o. Notes: - The -c option indicates compile.
- No HLASM output is generated.
- The objects are IPA objects, which can only be used for IPA link.
- LONGNAME is implicitly turned on.
- IPA link phase:
-
xlc -qmetal -qipa -S x.o y.o
This command
produces a.s.
The rest of the build process is similar to
building Metal C programs without IPA. You need to add the assembly
step to produce the object file from the IPA link generated HLASM
source file. You also need to supply the object file produced by the
assembler along with all other library data sets to the binder for
producing the final executable program.
- Assembly phase:
-
as -mgoff a.s
This command produces a.o. Note: The
HLASM GOFF option must be specified because of the LONGNAME compiler
option requirement with IPA.
- Bind/Link phase:
-
ld -b case=mixed -e main a.o
This command
produces a.out. Note: Because of the LONGNAME compiler option requirement
with IPA, you should use the -b case=mixed ld
utility option and the -e option with the entry
point in its original case.