[llvm] [AMDGPU] Remove dom tree requirements from SIWholeQuadMode pass (PR #71012)
Carl Ritson via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 20:27:59 PDT 2023
https://github.com/perlfu created https://github.com/llvm/llvm-project/pull/71012
SIWholeQuadMode preserves dominator and post dominator trees, but does not require them.
>From ea7387f41b807d11c382dd7eb401cbd2f2c38d2a Mon Sep 17 00:00:00 2001
From: Carl Ritson <carl.ritson at amd.com>
Date: Thu, 2 Nov 2023 12:24:19 +0900
Subject: [PATCH] [AMDGPU] Remove dom tree requirements from SIWholeQuadMode
pass
SIWholeQuadMode preserves dominator and post dominator trees,
but does not requirement.
---
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp | 6 ++----
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll | 5 -----
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index 3143d437e37091b..d1d828bfbdb70da 100644
--- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -238,9 +238,7 @@ class SIWholeQuadMode : public MachineFunctionPass {
AU.addRequired<LiveIntervals>();
AU.addPreserved<SlotIndexes>();
AU.addPreserved<LiveIntervals>();
- AU.addRequired<MachineDominatorTree>();
AU.addPreserved<MachineDominatorTree>();
- AU.addRequired<MachinePostDominatorTree>();
AU.addPreserved<MachinePostDominatorTree>();
MachineFunctionPass::getAnalysisUsage(AU);
}
@@ -1594,8 +1592,8 @@ bool SIWholeQuadMode::runOnMachineFunction(MachineFunction &MF) {
TRI = &TII->getRegisterInfo();
MRI = &MF.getRegInfo();
LIS = &getAnalysis<LiveIntervals>();
- MDT = &getAnalysis<MachineDominatorTree>();
- PDT = &getAnalysis<MachinePostDominatorTree>();
+ MDT = getAnalysisIfAvailable<MachineDominatorTree>();
+ PDT = getAnalysisIfAvailable<MachinePostDominatorTree>();
if (ST->isWave32()) {
AndOpc = AMDGPU::S_AND_B32;
diff --git a/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll b/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
index bf2f6e983b529f8..5e922f608c1daa7 100644
--- a/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
+++ b/llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
@@ -105,7 +105,6 @@
; GCN-O0-NEXT: MachineDominator Tree Construction
; GCN-O0-NEXT: Slot index numbering
; GCN-O0-NEXT: Live Interval Analysis
-; GCN-O0-NEXT: MachinePostDominator Tree Construction
; GCN-O0-NEXT: SI Whole Quad Mode
; GCN-O0-NEXT: Virtual Register Map
; GCN-O0-NEXT: Live Register Matrix
@@ -334,7 +333,6 @@
; GCN-O1-NEXT: Register Coalescer
; GCN-O1-NEXT: Rename Disconnected Subregister Components
; GCN-O1-NEXT: Machine Instruction Scheduler
-; GCN-O1-NEXT: MachinePostDominator Tree Construction
; GCN-O1-NEXT: SI Whole Quad Mode
; GCN-O1-NEXT: Virtual Register Map
; GCN-O1-NEXT: Live Register Matrix
@@ -626,7 +624,6 @@
; GCN-O1-OPTS-NEXT: Rename Disconnected Subregister Components
; GCN-O1-OPTS-NEXT: AMDGPU Pre-RA optimizations
; GCN-O1-OPTS-NEXT: Machine Instruction Scheduler
-; GCN-O1-OPTS-NEXT: MachinePostDominator Tree Construction
; GCN-O1-OPTS-NEXT: SI Whole Quad Mode
; GCN-O1-OPTS-NEXT: Virtual Register Map
; GCN-O1-OPTS-NEXT: Live Register Matrix
@@ -929,7 +926,6 @@
; GCN-O2-NEXT: Rename Disconnected Subregister Components
; GCN-O2-NEXT: AMDGPU Pre-RA optimizations
; GCN-O2-NEXT: Machine Instruction Scheduler
-; GCN-O2-NEXT: MachinePostDominator Tree Construction
; GCN-O2-NEXT: SI Whole Quad Mode
; GCN-O2-NEXT: Virtual Register Map
; GCN-O2-NEXT: Live Register Matrix
@@ -1245,7 +1241,6 @@
; GCN-O3-NEXT: Rename Disconnected Subregister Components
; GCN-O3-NEXT: AMDGPU Pre-RA optimizations
; GCN-O3-NEXT: Machine Instruction Scheduler
-; GCN-O3-NEXT: MachinePostDominator Tree Construction
; GCN-O3-NEXT: SI Whole Quad Mode
; GCN-O3-NEXT: Virtual Register Map
; GCN-O3-NEXT: Live Register Matrix
More information about the llvm-commits
mailing list