aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorSjoerd Meijer <smeijer@nvidia.com>2025-02-07 10:31:24 +0000
committerGitHub <noreply@github.com>2025-02-07 10:31:24 +0000
commit612df14c0058572c876f59d41ec56c89710cee15 (patch)
tree410009b9d9c9f96a06e84175d6e0d8fa719576b1 /clang/lib/CodeGen/BackendUtil.cpp
parent52db30ec4154b0ef21db546ed9b5a9bfe47859cd (diff)
downloadllvm-612df14c0058572c876f59d41ec56c89710cee15.zip
llvm-612df14c0058572c876f59d41ec56c89710cee15.tar.gz
llvm-612df14c0058572c876f59d41ec56c89710cee15.tar.bz2
[Clang][Driver] Add an option to control loop-interchange (#125830)
This introduces options `-floop-interchange` and `-fno-loop-interchange` to enable/disable the loop-interchange pass. This is part of the work that tries to get that pass enabled by default (#124911), where it was remarked that a user facing option to control this would be convenient to have. The option name is the same as GCC's.
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 97e9bbc..57106e4 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -890,6 +890,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
PipelineTuningOptions PTO;
PTO.LoopUnrolling = CodeGenOpts.UnrollLoops;
+ PTO.LoopInterchange = CodeGenOpts.InterchangeLoops;
// For historical reasons, loop interleaving is set to mirror setting for loop
// unrolling.
PTO.LoopInterleaving = CodeGenOpts.UnrollLoops;
@@ -1314,6 +1315,7 @@ runThinLTOBackend(CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex,
initTargetOptions(CI, Diags, Conf.Options);
Conf.SampleProfile = std::move(SampleProfile);
Conf.PTO.LoopUnrolling = CGOpts.UnrollLoops;
+ Conf.PTO.LoopInterchange = CGOpts.InterchangeLoops;
// For historical reasons, loop interleaving is set to mirror setting for loop
// unrolling.
Conf.PTO.LoopInterleaving = CGOpts.UnrollLoops;