How can I see which compiler options are enabled with optimization?

To see which compiler options are enabled with a particular optimization level, you need to:

  1. Create an (empty) test.c file.

  2. Call the compiler driver with the verbose flag, which will output the calls of the individual toolchain components with all the options including the default ones:
    clang -v -O<optimization level> -march=tc162 -c test.c.

  3. If you require further information, use the following command to get a list of individual optimization passes and compiler options associated with them.
    clang -mllvm -debug-pass=Structure -O<optimization level> -march=tc162 -c test.c.