[llvm-dev] Measuring memory usage of opt passes. (original) (raw)

Anmol Paralkar (anmparal) via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 1 16:03:51 PDT 2017


Hi,

I need to measure the memory usage of opt passes and have some questions in this regard.

First off, this does not really do anything; is it a bug?

$ clang -mllvm -time-passes -mllvm -track-memory -c -O3 ./p0.c

So, instead, I do:

$ clang -emit-llvm -O3 -c ./p0.c

$ opt -time-passes -track-memory ./p0.bc -O3 -o p0.O3.bc 2> p0.O3.txt

Which gets me the report I am looking for, however, I do not understand why there are negative numbers in the Mem column.

===-------------------------------------------------------------------------===

                  ... Pass execution timing report ...

===-------------------------------------------------------------------------===

---User Time--- --User+System-- ---Wall Time--- ---Mem--- --- Name ---

0.0010 ( 33.3%) 0.0010 ( 33.3%) 0.0012 ( 41.2%) 324576 Simplify the CFG

0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.4%) -7184 Scalar Evolution Analysis

Also, what are the units for the numbers in the Mem column?

I found the -ftime-report option to clang; is there a similar way to request memory usage tracking of opt passes from clang?

Thank you, Anmol. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170901/cc50b31f/attachment.html>



More information about the llvm-dev mailing list