[PATCH] D64106: Summary:[Attributor] liveness analysis. This is only a first draft and should be modified heavily.

Stefan Stipanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 15:19:17 PDT 2019


sstefan1 created this revision.
sstefan1 added reviewers: jdoerfert, uenoku.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64106

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp


Index: llvm/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Attributor.cpp
+++ llvm/lib/Transforms/IPO/Attributor.cpp
@@ -1372,15 +1372,19 @@
       continue;
     }
 
-    // LLVM_DEBUG(dbgs() << "NAKED\n");
-    // // For now we ignore naked and optnone functions.
-    // if (F.hasFnAttribute(Attribute::Naked) ||
-        // F.hasFnAttribute(Attribute::OptimizeNone))
-      // continue;
+    // For now we ignore naked and optnone functions.
+    if (F.hasFnAttribute(Attribute::Naked) ||
+        F.hasFnAttribute(Attribute::OptimizeNone))
+      continue;
+
+    LLVM_DEBUG(dbgs() << "NAKED\n");
+    // For now we ignore naked and optnone functions.
+    if (F.hasFnAttribute(Attribute::Naked) ||
+        F.hasFnAttribute(Attribute::OptimizeNone))
+      continue;
 
     NumFnWithExactDefinition++;
 
-    LLVM_DEBUG(dbgs() << "calling identify...\n");
     // Populate the Attributor with abstract attribute opportunities in the
     // function and the information cache with IR information.
     A.identifyDefaultAbstractAttributes(F, InfoCache);
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -702,21 +702,21 @@
 };
 
 struct AAIsAssumedDead : public AbstractAttribute {
-    /// An abstract interface for liveness abstract attribute.
-    AAIsAssumedDead(Value &V, InformationCache &InfoCache)
-        : AbstractAttribute(V, InfoCache) {}
+  /// An abstract interface for liveness abstract attribute.
+  AAIsAssumedDead(Value &V, InformationCache &InfoCache)
+      : AbstractAttribute(V, InfoCache) {}
 
-    /// See AbstractAttribute::getAttrKind()/
-    virtual Attribute::AttrKind getAttrKind() const override { return ID; }
+  /// See AbstractAttribute::getAttrKind()/
+  virtual Attribute::AttrKind getAttrKind() const override { return ID; }
 
-    static constexpr Attribute::AttrKind ID =
-        Attribute::AttrKind(Attribute::None + 1);
+  static constexpr Attribute::AttrKind ID =
+      Attribute::AttrKind(Attribute::None + 1);
 
-    /// Returns true if nounwind is assumed.
-    virtual bool isAssumedDead() const = 0;
+  /// Returns true if nounwind is assumed.
+  virtual bool isAssumedDead() const = 0;
 
-    /// Returns true if nounwind is known.
-    virtual bool isKnownDead() const = 0;
+  /// Returns true if nounwind is known.
+  virtual bool isKnownDead() const = 0;
 };
 
 } // end namespace llvm


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64106.207640.patch
Type: text/x-patch
Size: 2601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/b2fe6fe4/attachment-0001.bin>


More information about the llvm-commits mailing list