OSDN Git Service

[opt-viewer] Treat remarks with different attributes as different
authorAdam Nemet <anemet@apple.com>
Thu, 2 Mar 2017 17:00:56 +0000 (17:00 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 2 Mar 2017 17:00:56 +0000 (17:00 +0000)
We used to exclude arguments but for a diffed YAML file, it's interesting to
show these as changes.

Turns out this also affects gvn/LoadClobbered because we used to squash
multiple entries of this on the same line even if they reported clobbers
by *different* instructions.  This increases the number of unique entries now
and the share of gvn/LoadClobbered.

Total number of remarks      902287

Top 10 remarks by pass:
  inline                         43%
  gvn                            37%
  licm                           11%
  loop-vectorize                  4%
  asm-printer                     3%
  regalloc                        1%
  loop-unroll                     1%
  inline-cost                     0%
  slp-vectorizer                  0%
  loop-delete                     0%

Top 10 remarks:
  gvn/LoadClobbered              33%
  inline/Inlined                 16%
  inline/CanBeInlined            14%
  inline/NoDefinition             7%
  licm/Hoisted                    6%
  licm/LoadWithLoopInvariantAddressInvalidated  5%
  gvn/LoadElim                    3%
  asm-printer/InstructionCount    3%
  inline/TooCostly                2%
  loop-vectorize/MissedDetails    2%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296766 91177308-0d34-0410-b5e6-96231b3b80d8

utils/opt-viewer/optrecord.py

index 4a5733d..8b33c0a 100644 (file)
@@ -103,7 +103,22 @@ class Remark(yaml.YAMLObject):
 
     @property
     def key(self):
-        return (self.__class__, self.Pass, self.Name, self.File, self.Line, self.Column, self.Function)
+        k = (self.__class__, self.Pass, self.Name, self.File, self.Line, self.Column, self.Function)
+        for arg in self.Args:
+            for (key, value) in arg.iteritems():
+                if type(value) is dict:
+                    value = tuple(value.items())
+                k += (key, value)
+        return k
+
+    def __hash__(self):
+        return hash(self.key)
+
+    def __eq__(self, other):
+        return self.key == other.key
+
+    def __repr__(self):
+        return str(self.key)
 
 
 class Analysis(Remark):