[llvm] 4e89e71 - [CodeGenPrepare][NPM] Remove incorrect LoopAnalysis preservation in CodeGenPrepare (#172418)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 18 21:38:35 PST 2025
Author: Teja Alaghari
Date: 2025-12-19T11:08:31+05:30
New Revision: 4e89e710d971791cca98c367d7ae5d5444953cbc
URL: https://github.com/llvm/llvm-project/commit/4e89e710d971791cca98c367d7ae5d5444953cbc
DIFF: https://github.com/llvm/llvm-project/commit/4e89e710d971791cca98c367d7ae5d5444953cbc.diff
LOG: [CodeGenPrepare][NPM] Remove incorrect LoopAnalysis preservation in CodeGenPrepare (#172418)
CodeGenPrepare modifies and restructures loops & control flow. So, it
shouldn't preserve LoopAnalysis.
The test `llvm/test/CodeGen/AMDGPU/cf-loop-on-constant.ll` shows
CodeGenPrepare modifying loop structure, hence we cannot preserve
LoopAnalysis.
Added:
Modified:
llvm/lib/CodeGen/CodeGenPrepare.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 587c1372b19cb..01f49b8ecccff 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -556,7 +556,6 @@ PreservedAnalyses CodeGenPreparePass::run(Function &F,
PreservedAnalyses PA;
PA.preserve<TargetLibraryAnalysis>();
PA.preserve<TargetIRAnalysis>();
- PA.preserve<LoopAnalysis>();
return PA;
}
More information about the llvm-commits
mailing list