Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ AMDGPUAnnotateUniformValuesPass::run(Function &F,
AMDGPUAnnotateUniformValues Impl(UI, MSSA, AA, F);
Impl.visit(F);

PreservedAnalyses PA = PreservedAnalyses::none();
if (!Impl.changed())
return PA;
return PreservedAnalyses::all();

PreservedAnalyses PA = PreservedAnalyses::none();
// TODO: Should preserve nearly everything
PA.preserveSet<CFGAnalyses>();
return PA;
Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2303,10 +2303,12 @@ PreservedAnalyses AMDGPUCodeGenPreparePass::run(Function &F,
SIModeRegisterDefaults Mode(F, *Impl.ST);
Impl.HasFP32DenormalFlush =
Mode.FP32Denormals == DenormalMode::getPreserveSign();
if (!Impl.run(F))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code was checking Impl.FlowChanged before calling Impl.run which seems completely wrong.

return PreservedAnalyses::all();
PreservedAnalyses PA = PreservedAnalyses::none();
if (!Impl.FlowChanged)
PA.preserveSet<CFGAnalyses>();
return Impl.run(F) ? PA : PreservedAnalyses::all();
return PA;
}

INITIALIZE_PASS_BEGIN(AMDGPUCodeGenPrepare, DEBUG_TYPE,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ AMDGPULateCodeGenPreparePass::run(Function &F, FunctionAnalysisManager &FAM) {

bool Changed = Impl.run(F);

PreservedAnalyses PA = PreservedAnalyses::none();
if (!Changed)
return PA;
return PreservedAnalyses::all();
PreservedAnalyses PA = PreservedAnalyses::none();
PA.preserveSet<CFGAnalyses>();
return PA;
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ PreservedAnalyses SIAnnotateControlFlowPass::run(Function &F,
// FIXME: We introduce dead declarations of intrinsics even if never used.
bool Changed = Impl.run(F);
if (!Changed)
return PreservedAnalyses::none();
return PreservedAnalyses::all();

// TODO: Is LoopInfo preserved?
PreservedAnalyses PA = PreservedAnalyses::none();
Expand Down