Skip to content

[AMDGPU][SDAG] Add test for ISD::PTRADD handling in SelectionDAGAddressAnalysis #142777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ritter-x2a
Copy link
Member

Pre-committing test to show improvements in a follow-up PR.

@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Fabian Ritter (ritter-x2a)

Changes

Pre-committing test to show improvements in a follow-up PR.


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

1 Files Affected:

  • (modified) llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll (+29)
diff --git a/llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll b/llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll
index 656003f45c54b..bce59307446ce 100644
--- a/llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll
+++ b/llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll
@@ -132,3 +132,32 @@ declare noalias ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
 declare i64 @llvm.amdgcn.dispatch.id()
 declare noalias ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
 
+
+; Taken from memcpy-param-combinations.ll, tests PTRADD handling in
+; SelectionDAGAddressAnalysis.
+define void @memcpy_p1_p4_sz16_align_1_1(ptr addrspace(1) align 1 %dst, ptr addrspace(4) align 1 readonly %src) {
+; GFX942_PTRADD-LABEL: memcpy_p1_p4_sz16_align_1_1:
+; GFX942_PTRADD:       ; %bb.0: ; %entry
+; GFX942_PTRADD-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX942_PTRADD-NEXT:    global_load_dwordx2 v[4:5], v[2:3], off
+; GFX942_PTRADD-NEXT:    s_waitcnt vmcnt(0)
+; GFX942_PTRADD-NEXT:    global_store_dwordx2 v[0:1], v[4:5], off
+; GFX942_PTRADD-NEXT:    global_load_dwordx2 v[2:3], v[2:3], off offset:8
+; GFX942_PTRADD-NEXT:    s_waitcnt vmcnt(0)
+; GFX942_PTRADD-NEXT:    global_store_dwordx2 v[0:1], v[2:3], off offset:8
+; GFX942_PTRADD-NEXT:    s_waitcnt vmcnt(0)
+; GFX942_PTRADD-NEXT:    s_setpc_b64 s[30:31]
+;
+; GFX942_LEGACY-LABEL: memcpy_p1_p4_sz16_align_1_1:
+; GFX942_LEGACY:       ; %bb.0: ; %entry
+; GFX942_LEGACY-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX942_LEGACY-NEXT:    global_load_dwordx4 v[2:5], v[2:3], off
+; GFX942_LEGACY-NEXT:    s_waitcnt vmcnt(0)
+; GFX942_LEGACY-NEXT:    global_store_dwordx4 v[0:1], v[2:5], off
+; GFX942_LEGACY-NEXT:    s_waitcnt vmcnt(0)
+; GFX942_LEGACY-NEXT:    s_setpc_b64 s[30:31]
+entry:
+  tail call void @llvm.memcpy.p1.p4.i64(ptr addrspace(1) noundef nonnull align 1 %dst, ptr addrspace(4) noundef nonnull align 1 %src, i64 16, i1 false)
+  ret void
+}
+

@ritter-x2a ritter-x2a marked this pull request as ready for review June 4, 2025 13:54
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from 1fe91cb to b1fc342 Compare June 5, 2025 09:36
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch from efdaf03 to 80a86ba Compare June 5, 2025 09:36
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch 2 times, most recently from 5537fe6 to 14a92fd Compare June 10, 2025 10:01
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from 14a92fd to df620d7 Compare June 13, 2025 09:02
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch from df4a8d1 to 3764eec Compare June 13, 2025 09:02
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from df620d7 to c0eab93 Compare June 13, 2025 12:06
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch 2 times, most recently from 3f911ac to fd680df Compare June 13, 2025 12:12
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch 2 times, most recently from 5df6cfa to a7d0f6b Compare June 13, 2025 13:28
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch from 760e22e to 554316b Compare June 13, 2025 14:02
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from a7d0f6b to e8eccce Compare June 13, 2025 14:03
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from e8eccce to 510b307 Compare June 23, 2025 13:37
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch from 554316b to 00afb5a Compare June 23, 2025 13:37
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch from 00afb5a to 506c77e Compare June 24, 2025 06:45
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from 510b307 to ade6820 Compare June 24, 2025 06:46
Copy link
Member Author

ritter-x2a commented Jun 26, 2025

Merge activity

  • Jun 26, 7:27 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 26, 7:41 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 26, 7:43 AM UTC: @ritter-x2a merged this pull request with Graphite.

@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines branch 3 times, most recently from 2c35c97 to 61ad2a3 Compare June 26, 2025 07:36
Base automatically changed from users/ritter-x2a/06-04-_amdgpu_sdag_add_isd_ptradd_dag_combines to main June 26, 2025 07:40
…ssAnalysis

Pre-committing test to show improvements in a follow-up PR.
@ritter-x2a ritter-x2a force-pushed the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch from ade6820 to a83dc2c Compare June 26, 2025 07:40
@ritter-x2a ritter-x2a merged commit 6168164 into main Jun 26, 2025
5 of 7 checks passed
@ritter-x2a ritter-x2a deleted the users/ritter-x2a/06-04-_amdgpu_sdag_add_test_for_isd_ptradd_handling_in_selectiondagaddressanalysis branch June 26, 2025 07:43
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.

4 participants