Skip to content

Commit eecdcd6

Browse files
committed
Add MFPropsModifier and apply suggestions
1 parent 59d603d commit eecdcd6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,9 @@ bool GCNDPPCombine::combineDPPMov(MachineInstr &MovMI) const {
754754
}
755755

756756
bool GCNDPPCombineLegacy::runOnMachineFunction(MachineFunction &MF) {
757-
if (skipFunction(MF.getFunction())) {
757+
if (skipFunction(MF.getFunction()))
758758
return false;
759-
}
759+
760760
return GCNDPPCombine().run(MF);
761761
}
762762

@@ -795,10 +795,15 @@ bool GCNDPPCombine::run(MachineFunction &MF) {
795795

796796
PreservedAnalyses GCNDPPCombinePass::run(MachineFunction &MF,
797797
MachineFunctionAnalysisManager &) {
798+
if (MF.getFunction().hasOptNone())
799+
return PreservedAnalyses::all();
800+
801+
MFPropsModifier _(*this, MF);
802+
798803
bool Changed = GCNDPPCombine().run(MF);
799-
if (!Changed) {
804+
if (!Changed)
800805
return PreservedAnalyses::all();
801-
}
806+
802807
auto PA = getMachineFunctionPassPreservedAnalyses();
803808
PA.preserveSet<CFGAnalyses>();
804809
return PA;

llvm/lib/Target/AMDGPU/GCNDPPCombine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ class GCNDPPCombinePass : public PassInfoMixin<GCNDPPCombinePass> {
2525

2626
} // end namespace llvm
2727

28-
#endif
28+
#endif // LLVM_LIB_TARGET_AMDGPU_GCNDPPCOMBINE_H

0 commit comments

Comments
 (0)