[PATCH] D119342: [LoopRotate] Don't rotate loops when the minsize attribute is present

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 09:03:32 PST 2022


fhahn added a comment.



> Should we do this when the optsize function attribute is set, not just when the minsize function attribute is set?

I don't think so. Disabling rotation is a heavy hammer, as it will disable a lot of other loop optimizations implicitly due to most transforms requiring rotated form.



================
Comment at: llvm/lib/Transforms/Scalar/LoopRotation.cpp:54
+  int Threshold =
+      (EnableHeaderDuplication && !L.getHeader()->getParent()->hasMinSize()) ||
+              hasVectorizeTransformation(&L) == TM_ForcedByUser
----------------
I think we we add `minsize` handling here we should also drop the `EnableHeaderDuplication` flag set when instantiating the pass. This is more in line with what most other passes do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119342



More information about the llvm-commits mailing list