[llvm-dev] opt: how to invoke optimizations manually?

HwJ via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 16 06:15:16 PDT 2018


Hello,

I'd like to measure the impact of optimizations.
Trying this (for DCE):

* clang -S -emit-llvm test.c
* opt -S test.ll > without_dce.ll
* opt -S -dce test.ll > with_dce.ll

gives without_dce.ll and with_dce.ll having the same content.

How can you apply certain optimizations in a specified order?

Best,
HwJ

---

$ cat test.c
> int dce(int n) {
>     if ((n < 0) || (n >= 0))
>         return 1;
> 
>     return 0;
> }


More information about the llvm-dev mailing list