[PATCH] D112341: [AMDGPU] Run SIShrinkInstructions before post-RA scheduling
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 22 12:18:53 PDT 2021
foad created this revision.
foad added reviewers: arsenm, rampitec, Joe_Nash, kerbowa.
Herald added subscribers: hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Run post-RA SIShrinkInstructions just before post-RA scheduling, instead
of afterwards. After the fixes in D112305 <https://reviews.llvm.org/D112305> and D112317 <https://reviews.llvm.org/D112317> this seems to make
no difference, but it paves the way for scheduler tweaks that are
sensitive to the e32 vs e64 encoding of VALU instructions.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D112341
Files:
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
Index: llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
+++ llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
@@ -367,6 +367,7 @@
; GCN-O1-NEXT: Tail Duplication
; GCN-O1-NEXT: Machine Copy Propagation Pass
; GCN-O1-NEXT: Post-RA pseudo instruction expansion pass
+; GCN-O1-NEXT: SI Shrink Instructions
; GCN-O1-NEXT: SI post-RA bundler
; GCN-O1-NEXT: MachineDominator Tree Construction
; GCN-O1-NEXT: Machine Natural Loop Construction
@@ -379,7 +380,6 @@
; GCN-O1-NEXT: SI Memory Legalizer
; GCN-O1-NEXT: MachinePostDominator Tree Construction
; GCN-O1-NEXT: SI insert wait instructions
-; GCN-O1-NEXT: SI Shrink Instructions
; GCN-O1-NEXT: Insert required mode register values
; GCN-O1-NEXT: SI Insert Hard Clauses
; GCN-O1-NEXT: MachineDominator Tree Construction
@@ -651,6 +651,7 @@
; GCN-O1-OPTS-NEXT: Tail Duplication
; GCN-O1-OPTS-NEXT: Machine Copy Propagation Pass
; GCN-O1-OPTS-NEXT: Post-RA pseudo instruction expansion pass
+; GCN-O1-OPTS-NEXT: SI Shrink Instructions
; GCN-O1-OPTS-NEXT: SI post-RA bundler
; GCN-O1-OPTS-NEXT: MachineDominator Tree Construction
; GCN-O1-OPTS-NEXT: Machine Natural Loop Construction
@@ -663,7 +664,6 @@
; GCN-O1-OPTS-NEXT: SI Memory Legalizer
; GCN-O1-OPTS-NEXT: MachinePostDominator Tree Construction
; GCN-O1-OPTS-NEXT: SI insert wait instructions
-; GCN-O1-OPTS-NEXT: SI Shrink Instructions
; GCN-O1-OPTS-NEXT: Insert required mode register values
; GCN-O1-OPTS-NEXT: SI Insert Hard Clauses
; GCN-O1-OPTS-NEXT: MachineDominator Tree Construction
@@ -937,6 +937,7 @@
; GCN-O2-NEXT: Tail Duplication
; GCN-O2-NEXT: Machine Copy Propagation Pass
; GCN-O2-NEXT: Post-RA pseudo instruction expansion pass
+; GCN-O2-NEXT: SI Shrink Instructions
; GCN-O2-NEXT: SI post-RA bundler
; GCN-O2-NEXT: MachineDominator Tree Construction
; GCN-O2-NEXT: Machine Natural Loop Construction
@@ -949,7 +950,6 @@
; GCN-O2-NEXT: SI Memory Legalizer
; GCN-O2-NEXT: MachinePostDominator Tree Construction
; GCN-O2-NEXT: SI insert wait instructions
-; GCN-O2-NEXT: SI Shrink Instructions
; GCN-O2-NEXT: Insert required mode register values
; GCN-O2-NEXT: SI Insert Hard Clauses
; GCN-O2-NEXT: MachineDominator Tree Construction
@@ -1236,6 +1236,7 @@
; GCN-O3-NEXT: Tail Duplication
; GCN-O3-NEXT: Machine Copy Propagation Pass
; GCN-O3-NEXT: Post-RA pseudo instruction expansion pass
+; GCN-O3-NEXT: SI Shrink Instructions
; GCN-O3-NEXT: SI post-RA bundler
; GCN-O3-NEXT: MachineDominator Tree Construction
; GCN-O3-NEXT: Machine Natural Loop Construction
@@ -1248,7 +1249,6 @@
; GCN-O3-NEXT: SI Memory Legalizer
; GCN-O3-NEXT: MachinePostDominator Tree Construction
; GCN-O3-NEXT: SI insert wait instructions
-; GCN-O3-NEXT: SI Shrink Instructions
; GCN-O3-NEXT: Insert required mode register values
; GCN-O3-NEXT: SI Insert Hard Clauses
; GCN-O3-NEXT: MachineDominator Tree Construction
Index: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -1327,6 +1327,8 @@
}
void GCNPassConfig::addPreSched2() {
+ if (TM->getOptLevel() > CodeGenOpt::None)
+ addPass(createSIShrinkInstructionsPass());
addPass(&SIPostRABundlerID);
}
@@ -1334,9 +1336,6 @@
addPass(createSIMemoryLegalizerPass());
addPass(createSIInsertWaitcntsPass());
- if (TM->getOptLevel() > CodeGenOpt::None)
- addPass(createSIShrinkInstructionsPass());
-
addPass(createSIModeRegisterPass());
if (getOptLevel() > CodeGenOpt::None)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112341.381630.patch
Type: text/x-patch
Size: 4054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211022/b37935ef/attachment.bin>
More information about the llvm-commits
mailing list