[PATCH] D146383: [SimpleLoopUnswitch] Skip non-trivial unswitching of cold loop nests

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 19 13:12:44 PDT 2023


aeubanks added a comment.

seems reasonable, just some nits



================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:3506
+    }
+    // Next check all loops nested withing L.
+    SmallVector<const Loop *, 4> Worklist;
----------------
within


================
Comment at: llvm/test/Transforms/SimpleLoopUnswitch/PGO-nontrivial-unswitch2.ll:8
 
-; Check loops will be applied non-trivial loop unswitch in a non-cold function,
-; even loop headers are cold
+;; IR was generated from the following loop nest, profiled when called
+;; with M=1000 and N=0.
----------------
we should also have a test where both loops are cold and both are hot


================
Comment at: llvm/test/Transforms/SimpleLoopUnswitch/PGO-nontrivial-unswitch2.ll:24
+; Function Attrs: mustprogress uwtable
+define dso_local void @_Z11hotFunctionbiiPiS_S_(i1 noundef zeroext %cond, i32 noundef %M, i32 noundef %N, ptr nocapture noundef writeonly %A, ptr nocapture noundef readonly %B, ptr nocapture noundef readonly %C) local_unnamed_addr !prof !36 {
+; CHECK-LABEL: define dso_local void @_Z11hotFunctionbiiPiS_S_
----------------
can some of these attributes (and the test case in general) be cleaned up?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146383/new/

https://reviews.llvm.org/D146383



More information about the llvm-commits mailing list