Skip to content

Conversation

@kpyzhov
Copy link
Contributor

@kpyzhov kpyzhov commented Apr 6, 2025

No description provided.

@kpyzhov kpyzhov marked this pull request as draft April 6, 2025 02:43
@llvmbot
Copy link
Member

llvmbot commented Apr 6, 2025

@llvm/pr-subscribers-debuginfo

@llvm/pr-subscribers-backend-amdgpu

Author: None (kpyzhov)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134518.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp (+6)
diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index 57ae7d63218dd..8ae134a7b8091 100644
--- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -1300,6 +1300,12 @@ void SIWholeQuadMode::processBlock(MachineBasicBlock &MBB, BlockInfo &BI,
 
   for (unsigned Idx = 0;; ++Idx) {
     MachineBasicBlock::iterator Next = II;
+
+    if (II != IE && II->isDebugInstr()) {
+      II = ++Next;
+      continue;
+    }
+
     char Needs = StateExact | StateWQM; // Strict mode is disabled by default.
     char OutNeeds = 0;
 

@kpyzhov kpyzhov changed the title Skip debug machine instructions in AMDGPU SIWholeQuadMode pass. [AMDGPU] Skip debug machine instructions in AMDGPU SIWholeQuadMode pass. Apr 6, 2025
@kpyzhov kpyzhov requested a review from jayfoad April 6, 2025 03:43
@kpyzhov kpyzhov marked this pull request as ready for review April 6, 2025 03:43
Copy link
Contributor

@Pierre-vh Pierre-vh left a comment

Choose a reason for hiding this comment

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

Missing test?

for (unsigned Idx = 0;; ++Idx) {
MachineBasicBlock::iterator Next = II;

if (II != IE && II->isDebugInstr()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not all meta instructions? Also testcase?

@jayfoad jayfoad requested review from perlfu and piotrAMD April 7, 2025 13:56
bb.0:
successors: %bb.1(0x40000000), %bb.2(0x40000000); %bb.1(50.00%), %bb.2(50.00%)
liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $sgpr5, $sgpr6, $sgpr7, $sgpr8, $sgpr9, $sgpr10, $sgpr11, $sgpr12, $sgpr13, $sgpr14, $sgpr15, $sgpr16, $sgpr17, $sgpr18, $sgpr19, $vgpr8, $vgpr9, $vgpr12, $vgpr51, $vgpr52, $vgpr53, $vgpr54, $vgpr55, $vgpr56, $vgpr57, $vgpr58, $vgpr59, $vgpr60, $vgpr61
%126:vgpr_32 = COPY $vgpr60, debug-instr-number 754
Copy link
Contributor

Choose a reason for hiding this comment

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

-run-pass=none to compact the register numbers

Comment on lines +7 to +25
declare void @test() #0

!0 = !DILocalVariable(name: "rayPayload", arg: 1, scope: !661, file: !106, line: 232, type: !304)
!36 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
!106 = !DIFile(filename: "./RaytracingShaderHelper.hlsli", directory: "")
!153 = !DIDerivedType(tag: DW_TAG_typedef, name: "UINT", file: !106, line: 20, baseType: !154)
!154 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint", file: !106, line: 57, baseType: !36)
!182 = !DIDerivedType(tag: DW_TAG_typedef, name: "XMFLOAT4", file: !106, line: 17, baseType: !36)
!304 = !DICompositeType(tag: DW_TAG_structure_type, name: "RayPayload", file: !106, line: 60, size: 160, align: 32, elements: !305)
!305 = !{!306, !307}
!306 = !DIDerivedType(tag: DW_TAG_member, name: "color", scope: !304, file: !106, line: 62, baseType: !182, size: 128, align: 32)
!307 = !DIDerivedType(tag: DW_TAG_member, name: "recursionDepth", scope: !304, file: !106, line: 63, baseType: !153, size: 32, align: 32, offset: 128)
!325 = distinct !DISubprogram(name: "HitWorldPosition", linkageName: "\01?HitWorldPosition@@YA?AV?$vector@M$02@@XZ", scope: !106, file: !106, line: 89, type: !326, scopeLine: 90, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition)
!326 = !DISubroutineType(types: !327)
!327 = !{}
!661 = !DILocation(line: 0, scope: !325, inlinedAt: !662)
!662 = distinct !DILocation(line: 249, column: 34, scope: !325)
!665 = !DILocation(line: 91, column: 12, scope: !325, inlinedAt: !666)
!666 = distinct !DILocation(line: 239, column: 26, scope: !325)
Copy link
Contributor

Choose a reason for hiding this comment

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

Compact these numbers?

@@ -0,0 +1,109 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

@@ -0,0 +1,109 @@

# RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1150 -run-pass=si-wqm -o - %s
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing check of output

@perlfu
Copy link
Contributor

perlfu commented Apr 14, 2025

Can you elaborate on the purpose of this change as there is no description?
Specifically does this fix a bug or is this just a performance improvement (avoiding processing meta instructions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants