Skip to content

Commit

Permalink
[Matrix] Bail out early if there are no matrix intrinsics.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fhahn committed May 22, 2021
1 parent 02918f1 commit a6de8d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit a6de8d9

Please sign in to comment.