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

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 08:40:59 PDT 2023


tejohnson marked 2 inline comments as done.
tejohnson added inline comments.


================
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.
----------------
aeubanks wrote:
> we should also have a test where both loops are cold and both are hot
PGO-nontrivial-unswitch.ll was already testing a cold loop in a cold function, but given that we are not looking for function coldness anymore, I changed that to be a version of this test case with a cold loop in a cold loop nest. I also added PGO-nontrivial-unswitch3.ll to test a non-cold loop in a non-cold loop nest.


================
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_
----------------
aeubanks wrote:
> can some of these attributes (and the test case in general) be cleaned up?
I removed these attributes and tried to remove a bit more unneeded detail from the IR and metadata (had already had removed some unneeded metadata).


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