A question on opt command vs clang command

Hi all,

Is it a best practice to run clang -O2 -S after opt -O2 to generate the .s file?

Thank you,

You can also run llc to generate native assembly file


As far as I know, running clang -O2 -S after opt -O2 is doing more optimizations more than llc -O2. My problem is that will this cause to crash the code?