[llvm] [llvm][loop-rotate] Allow forcing loop-rotation (PR #82828)
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 23 14:06:29 PST 2024
================
@@ -39,8 +39,20 @@ static cl::opt<bool> PrepareForLTOOption(
cl::desc("Run loop-rotation in the prepare-for-lto stage. This option "
"should be used for testing only."));
+// Experimentally allow loop header duplication. This should allow for better
+// optimization at Oz, since loop-idiom recognition can then recognize things
+// like memcpy. If this ends up being profitable, we should drop this flag and
+// making a code gen option that can be controled independent of the opt level
+// and exposed through clang. See
+// https://github.com/llvm/llvm-project/issues/50308 for details.
+static cl::opt<bool>
+ ForceHeaderDuplication("force-loop-header-duplication", cl::init(false),
----------------
petrhosek wrote:
Looks like all other flags in [PassBuilderPipelines.cpp](https://github.com/llvm/llvm-project/pull/82828/files#diff-2b09f41dec5c9d1fbe844989c38f6bb7db588799b97b4bed7ad173ce7f348280) are called `enable-*` or `disable-*` so I'd actually go with `enable-loop-header-duplication` for consistency.
https://github.com/llvm/llvm-project/pull/82828
More information about the llvm-commits
mailing list