hameeza ahmed via llvm-dev
2019-Aug-13 21:56 UTC
[llvm-dev] IR Optimization via Opt after clang
Hello, I want to perform optimizations available in opt on already optimized IR (via O1,O2,O3). when I used O3 with opt, i get different performance as compared to clang -O3. So, now i m first optimizing IR with clang O3 then using opt available optimizations as follows; $LLVM_BIN/opt -O3 wc-O3.ll -S -o wc-O3-op.ll $LLVM_BIN/opt -disable-loop-unrolling wc-O3-op.ll -S -o wc-O3-op2.ll Is this the right approach? Please help. Thank You Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190814/b65fdf49/attachment.html>
Michael Kruse via llvm-dev
2019-Aug-14 17:01 UTC
[llvm-dev] IR Optimization via Opt after clang
Clang applies different options to the pass manager builder than opt does, which may explain the difference in performance. If LoopUnrolling considered the IR worthy for unrolling, it will already have been unrolled in wc-O3.ll. It should never unroll an already unrolled loop again or unroll a loop it did not consider profitable in a previous run. That is, applying -disable-loop-unrolling retroactively will have no effect (in the majority of cases). Michael Am Di., 13. Aug. 2019 um 16:57 Uhr schrieb hameeza ahmed via llvm-dev <llvm-dev at lists.llvm.org>:> > Hello, > I want to perform optimizations available in opt on already optimized IR (via O1,O2,O3). > when I used O3 with opt, i get different performance as compared to clang -O3. > > So, now i m first optimizing IR with clang O3 then using opt available optimizations as follows; > > > $LLVM_BIN/opt -O3 wc-O3.ll -S -o wc-O3-op.ll > $LLVM_BIN/opt -disable-loop-unrolling wc-O3-op.ll -S -o wc-O3-op2.ll > > Is this the right approach? > > Please help. > > Thank You > Regards > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev