AMD EPYC 9xx5-Series Processors Compiler Options Quick Reference - AMD EPYC 9xx5-Series Processors Compiler Options Quick Reference - 63857

AOCC Quick Reference Guide

Document ID
63857
Release Date
2026-05-12
Revision
5.2 English

AOCC compiler (C/C++/Fortran)

Latest release: 5.2, May 2026

https://www.amd.com/en/developer/aocc.html

Action Command
Architecture
Generate instructions that run on AMD 5th Gen EPYC™ and AMD 5th Gen Ryzen™
-march=znver5
Generate instructions supported in the given machine
-march=native
Optimization Levels
Disable all optimizations
-O0
Enable minimal level optimizations
-O1
Enable moderate level optimizations (Default from AOCC 4.1)
-O2/-O
Enable all optimizations that attempt to make programs run faster
-O3
Enable O3 with other aggressive optimizations that may violate strict compliance and precisions
-Ofast
Enable link time optimization
-flto
Enable advanced optimizations - improved variants of various scalar, vector, and loop transformations
-zopt
Enable advanced vector transformations
-fvector-transform
-mllvm -enable-strided-vectorization
Enable loop transformations
-floop-transform
Enable advanced loop transformations
-faggressive-loop-transform
Enable memory layout optimizations
-flto -fremap-arrays
-mllvm -reduce-array-computations=3
Enable function level optimizations
-flto -fitodcalls 
-mllvm -function-specialize
-flto -finline-recursion={1..4}
Profile guided optimizations
-fprofile-instr-generate

(1st invocation)

-fprofile-instr-use

(2nd invocation)

Enable use of OpenMP® directives
-fopenmp
Enable streaming stores to optimize memory bandwidth usage
-fnt-store
Other Options
Enable faster, less precise math operations (part of Ofast)
-ffast-math
-freciprocal-math
OpenMP® threads and affinity (N number of cores)
export OMP_NUM_THREADS=N
export GOMP_CPU_AFFINITY="0-{N-1}"
Link to AMD library
-L/libm-install-dir/lib -lamdlibm -lm
Enable vector library
-fveclib=AMDLIBM -lamdlibm -lm
Enable faster library
-Ofast -ffastlib=AMDLIBM -lamdlibmfast -lamdlibm -lm
For Fortran Workloads
Compile Fortran free form layout
-ffree-form

AMD Optimized Libraries

Latest release: 5.3, May 2026

https://www.amd.com/en/developer/aocl.html

AMD uProf (Performance & Power Profiler)

Latest release: 5.3, May 2026

https://www.amd.com/en/developer/uprof.html

GNU Compiler Collection

Recommended version: GCC 14.1 or later

Latest release: GCC 16.1, April 2026

http://gcc.gnu.org

glibC

Latest release: 2.43, January 2026

Recommendation: 2.38 or later

https://www.gnu.org/software/libc/

Binutils

Latest release: 2.46.0, February 2026

Recommendation: 2.42 or later

https://www.gnu.org/software/binutils/

Action Command
Architecture
Generate instructions that run on AMD 5th Gen EPYC™ and AMD 5th Gen Ryzen™
-march=znver5
Generate instructions supported in the given machine
-march=native
Optimization Levels
Disable all optimizations (default)
-O0
Enable minimal level optimizations
-O1/ -O
Enable moderate level optimizations
-O2
Enable all optimizations that attempt to make programs run faster
-O3
Enable O3 with other aggressive optimizations that may violate strict compliance and precisions
-Ofast
Additional Optimizations
Enable link time optimizations
-flto
Enable unrolling
-funroll-all-loops
Generate memory preload instructions
-fprefetch-loop-arrays
Enable profile-guided optimizations
-fprofile-generate

(1st invocation)

-fprofile-use

(2nd invocation)

Enable use of OpenMP® directives
-fopenmp
Other Options
Enable compiler to use IEEE FP comparisons
-mieee-fp
Enable faster, less precise math operations
-ffast-math
Compile Fortran free form layout
-ffree-form
OpenMP® threads and affinity (N number of cores)
export OMP_NUM_THREADS=N
export GOMP_CPU_AFFINITY="0-{N-1}"
Link to AMD library
-L/libm-install-dir/lib -lamdlibm -lm

Microsoft® Visual Studio 2026

https://visualstudio.microsoft.com/downloads/

Action Command
Architecture  
Generate instructions that run on AMD 5th Gen EPYC™ and AMD 5th Gen Ryzen™
/arch:[AVX|AVX2|AVX512]
Optimize for 64-bit AMD processors
/favor:AMD64
Optimization Levels
Disable optimizations
/Od
Maximum optimizations (favor space)
/O1

includes

/Ob2
Maximum optimizations (favor speed)
/O2

includes

/Ob2
Enable inline expansion
/Ob

(0/1/2/3)

[link.exe] Eliminate unreferenced function and/or data
/OPT:REF
[link.exe] Perform identical COMDAT folding
/OPT:ICF
Output an informational message for loops that are auto-vectorized
/Qvec-report:[1|2]
Enable automatic parallelization of loops, used with #pragma loop() directive
/Qpar
Output an informational message for loops that are auto-parallelized
/Qpar-report:[1|2]
Additional Optimizations
Maintain the precision for floating-point operations through proper rounding
/fp:precise
Optimize floating-point code for speed at the expense of floating point accuracy and correctness
/fp:fast
Whole Program Optimization (link-time code generation)
/GL
Enable Profile-guided optimizations
/LTCG /GENPROFILE

(1st invocation)

/LTCG /USERPROFILE

(2nd invocation)

Enable OpenMP® Support
/openmp:experimental
/openmp:llvm

Intel® oneAPI DPC++/C++ Compiler

Latest release: 2025.3.3, March 2026

http://software.intel.com

Action Command
Architecture
Generate instructions that run on AMD 5th Gen EPYC™ and AMD 5th Gen Ryzen™
-axCORE-AVX512
Optimization Levels
Disable all optimizations
-O0
Speed optimization without code growth
-O1
Enable optimization for speed including vectorization
-O2
Enable O2 and aggressive loop transformations
-O3
Enable set of aggressive options to improve speed
-Ofast
Additional Optimizations
Set function inline level
-inline-level=<value>
Set maximum number of times to unroll loops
-unroll[=n]
Disable improved precision floating divides
-no-prec-div
Enable vectorization
-vec
Enable inter procedural optimizations (alias for -flto)
-ipo
Enable whole program link time optimization (LTO)
-flto[=arg];
arg: full (default), thin
Enable use of OpenMP® directives
-qopenmp
Enable profile generated optimization
-prof-gen

and

-prof-use
Other Options
Enable floating point accuracy tunings
-fp-model
Compile Fortran free form layout
-free