[cfe-dev] Question on flags/ passes selection to improve code size
Robert Petrut Dumitru via cfe-dev
cfe-dev at lists.llvm.org
Thu Dec 12 07:41:33 PST 2019
I am looking at obtaining smaller code sizes for ARM cores. So far, I am
trying a genetic algorithm to find the best option for the opt passes and
clang/ llc flags.
I am looking at what flags and passes -Oz and the other optimization levels
enable and use. Having done something similar for gcc, I was looking for a
However, I was not able to find many optimization flags for clang or llc,
which made me think that in clang/llvm the optimization changes are done
mostly by selecting/removing the opt passes(flags).
In order to run what opt passes I select, I split the compilation process
clang CLANG_FLAGS -emit-llvm mysource1.c -c -o mysource1.bc
opt OPT_FLAGS mysource1.bc -o mysource1.ll
llc LLC_FLAGS mysource1.ll -filetype=obj -o mysource1.o
I have also seen that for -Oz for example, the Pass Arguments appears
multiple time, does this mean that opt is run multiple times with different
Now, my general direction questions are:
Am I on the right track with this?
Do you have any pointers or advice on this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev