[llvm] r249892 - Generalize convergent check to handle invokes as well as calls.

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 13:17:47 PDT 2015


Author: resistor
Date: Fri Oct  9 15:17:46 2015
New Revision: 249892

URL: http://llvm.org/viewvc/llvm-project?rev=249892&view=rev
Log:
Generalize convergent check to handle invokes as well as calls.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=249892&r1=249891&r2=249892&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Fri Oct  9 15:17:46 2015
@@ -506,10 +506,10 @@ bool LoopUnswitch::processCurrentLoop()
   // FIXME: This could be refined to only bail if the convergent operation is
   // not already control-dependent on the unswitch value.
   for (const auto BB : currentLoop->blocks()) {
-    for (const auto &I : *BB) {
-      const auto CI = dyn_cast<CallInst>(&I);
-      if (!CI) continue;
-      if (CI->isConvergent())
+    for (auto &I : *BB) {
+      auto CS = CallSite(&I);
+      if (!CS) continue;
+      if (CS.hasFnAttr(Attribute::Convergent))
         return false;
     }
   }




More information about the llvm-commits mailing list