[llvm] [AMDGPU] Port AMDGPURewriteUndefForPHI to new pass manager (PR #66008)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 15:17:15 PDT 2023
================
@@ -177,6 +177,20 @@ bool AMDGPURewriteUndefForPHI::runOnFunction(Function &F) {
return rewritePHIs(F, UA, DT);
}
+PreservedAnalyses
+AMDGPURewriteUndefForPHIPass::run(Function &F, FunctionAnalysisManager &AM) {
+ UniformityInfo &UA = AM.getResult<UniformityInfoAnalysis>(F);
+ DominatorTree *DT = &AM.getResult<DominatorTreeAnalysis>(F);
+ bool Changed = rewritePHIs(F, UA, DT);
+ if (Changed) {
+ PreservedAnalyses PA;
+ PA.preserveSet<CFGAnalyses>();
+ return PA;
+ }
+
+ return PreservedAnalyses::all();
+}
+
FunctionPass *llvm::createAMDGPURewriteUndefForPHIPass() {
----------------
jwanggit86 wrote:
Should the class "AMDGPURewriteUndefForPHI" be renamed "AMDGPURewriteUndefForPHILegacy" or "AMDGPURewriteUndefForPHILegacyPass"? If the latter, we will end up with a function named "initializeAMDGPURewriteUndefForPHILegacyPassPass".
https://github.com/llvm/llvm-project/pull/66008
More information about the llvm-commits
mailing list