[llvm] r314537 - Display relative hotness with two decimal digits after the decimal point

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 09:56:54 PDT 2017


Author: anemet
Date: Fri Sep 29 09:56:54 2017
New Revision: 314537

URL: http://llvm.org/viewvc/llvm-project?rev=314537&view=rev
Log:
Display relative hotness with two decimal digits after the decimal point

I've seen cases where tiny inlined functions have such a high execution count
that most everything would show up with a relative of hotness of 0%.  Since
the inlined functions effectively disappear you need to tune in the lower
range, thus we need more precision.

Modified:
    llvm/trunk/tools/opt-viewer/optrecord.py

Modified: llvm/trunk/tools/opt-viewer/optrecord.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt-viewer/optrecord.py?rev=314537&r1=314536&r2=314537&view=diff
==============================================================================
--- llvm/trunk/tools/opt-viewer/optrecord.py (original)
+++ llvm/trunk/tools/opt-viewer/optrecord.py Fri Sep 29 09:56:54 2017
@@ -179,7 +179,7 @@ class Remark(yaml.YAMLObject):
     @property
     def RelativeHotness(self):
         if self.max_hotness:
-            return "{}%".format(int(round(self.Hotness * 100 / self.max_hotness)))
+            return "{0:.2f}%".format(self.Hotness * 100. / self.max_hotness)
         else:
             return ''
 




More information about the llvm-commits mailing list