[PATCH] D17126: Add convergent property to CodeMetrics.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 13:05:54 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL260728: Add convergent property to CodeMetrics. (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D17126?vs=47593&id=47840#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17126

Files:
  llvm/trunk/include/llvm/Analysis/CodeMetrics.h
  llvm/trunk/lib/Analysis/CodeMetrics.cpp

Index: llvm/trunk/include/llvm/Analysis/CodeMetrics.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/CodeMetrics.h
+++ llvm/trunk/include/llvm/Analysis/CodeMetrics.h
@@ -53,6 +53,9 @@
   /// one or more 'noduplicate' instructions.
   bool notDuplicatable = false;
 
+  /// \brief True if this function contains a call to a convergent function.
+  bool convergent = false;
+
   /// \brief True if this function calls alloca (in the C sense).
   bool usesDynamicAlloca = false;
 
Index: llvm/trunk/lib/Analysis/CodeMetrics.cpp
===================================================================
--- llvm/trunk/lib/Analysis/CodeMetrics.cpp
+++ llvm/trunk/lib/Analysis/CodeMetrics.cpp
@@ -152,9 +152,12 @@
     if (II->getType()->isTokenTy() && II->isUsedOutsideOfBlock(BB))
       notDuplicatable = true;
 
-    if (const CallInst *CI = dyn_cast<CallInst>(II))
+    if (const CallInst *CI = dyn_cast<CallInst>(II)) {
       if (CI->cannotDuplicate())
         notDuplicatable = true;
+      if (CI->isConvergent())
+        convergent = true;
+    }
 
     if (const InvokeInst *InvI = dyn_cast<InvokeInst>(II))
       if (InvI->cannotDuplicate())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17126.47840.patch
Type: text/x-patch
Size: 1203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160212/2eb3b270/attachment.bin>


More information about the llvm-commits mailing list