<div dir="ltr">Hi, <div><br><div>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.</div><div>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 similar approach. </div><div>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).</div><div><br></div><div>In order to run what opt passes I select, I split the compilation process in:</div><div><br></div><div>

clang  CLANG_FLAGS -emit-llvm  mysource1.c  -c -o 

mysource1.bc

</div><div>opt  OPT_FLAGS 

mysource1.bc -o mysource1.ll</div><div>llc LLC_FLAGS mysource1.ll -filetype=obj -o mysource1.o</div><div><br></div><div>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 passes options? </div><div><br></div><div>Now, my general direction questions are:</div><div><br></div><div>Am I on the right track with this? <br></div><div>Do you have any pointers or advice on this? </div><div><br></div><div>Thank you, </div></div><div>Robert </div></div>