[llvm] a6de8d9 - [Matrix] Bail out early if there are no matrix intrinsics.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat May 22 03:37:59 PDT 2021


Author: Florian Hahn
Date: 2021-05-22T11:37:25+01:00
New Revision: a6de8d95db484e07c7b1e2d86dfaeacf0d95e656

URL: https://github.com/llvm/llvm-project/commit/a6de8d95db484e07c7b1e2d86dfaeacf0d95e656
DIFF: https://github.com/llvm/llvm-project/commit/a6de8d95db484e07c7b1e2d86dfaeacf0d95e656.diff

LOG: [Matrix] Bail out early if there are no matrix intrinsics.

If there are no matrix intrinsics in a function, we can directly bail
out, as there's nothing left to do.

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D102931

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 9b33df0fbe96e..c88771b0b601d 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -677,6 +677,10 @@ class LowerMatrixIntrinsics {
         }
       }
 
+    // Avoid unnecessary work if there are no matrix intrinsics in the function.
+    if (WorkList.empty())
+      return false;
+
     // Propagate shapes until nothing changes any longer.
     while (!WorkList.empty()) {
       WorkList = propagateShapeForward(WorkList);


        


More information about the llvm-commits mailing list