Skip to content

AMDGPU: Fix broken broken negative test for gfx950 assembler #129667

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

arsenm
Copy link
Contributor

@arsenm arsenm commented Mar 4, 2025

Fix's not rejecting global_load_lds_dwordx3 and x4 on other targets.
The encoded versions of instructions should not touch SubtargetPredicate,
and only AssemblerPredicate.

Copy link
Contributor Author

arsenm commented Mar 4, 2025

@arsenm arsenm marked this pull request as ready for review March 4, 2025 08:16
@llvmbot
Copy link
Member

llvmbot commented Mar 4, 2025

@llvm/pr-subscribers-mc

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

Fix's not rejecting global_load_lds_dwordx3 and x4 on other targets.
The encoded versions of instructions should not touch SubtargetPredicate,
and only AssemblerPredicate.


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

2 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/FLATInstructions.td (+1-1)
  • (modified) llvm/test/MC/AMDGPU/gfx950_asm_features.s (+3-4)
diff --git a/llvm/lib/Target/AMDGPU/FLATInstructions.td b/llvm/lib/Target/AMDGPU/FLATInstructions.td
index f48d1d8c011da..2625b44e7e8b5 100644
--- a/llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ b/llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -2093,7 +2093,7 @@ multiclass FLAT_Real_AllAddr_LDS<bits<7> op, bits<7> pre_gfx940_op,
     }
   }
 
-  let SubtargetPredicate = isGFX940Plus in {
+  let AssemblerPredicate = isGFX940Plus in {
     def _gfx940 : FLAT_Real_gfx940<op, !cast<FLAT_Pseudo>(NAME)>;
     def _SADDR_gfx940 : FLAT_Real_gfx940<op, !cast<FLAT_Pseudo>(NAME#"_SADDR")>;
   }
diff --git a/llvm/test/MC/AMDGPU/gfx950_asm_features.s b/llvm/test/MC/AMDGPU/gfx950_asm_features.s
index 5d6adc4095277..7bc47914f40b7 100644
--- a/llvm/test/MC/AMDGPU/gfx950_asm_features.s
+++ b/llvm/test/MC/AMDGPU/gfx950_asm_features.s
@@ -1,11 +1,10 @@
 // RUN: llvm-mc -triple=amdgcn -mcpu=gfx950 -show-encoding %s | FileCheck --check-prefix=GFX950 --strict-whitespace %s
-// xUN: not llvm-mc -triple=amdgcn -mcpu=gfx942 %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950,GFX942 --implicit-check-not=error: %s
-// xUN: not llvm-mc -triple=amdgcn -mcpu=gfx90a %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950,GFX90A --implicit-check-not=error: %s
-// xUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950,GFX10 --implicit-check-not=error: %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx942 %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950 --implicit-check-not=error: %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx90a %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950 --implicit-check-not=error: %s
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950 --implicit-check-not=error: %s
 
 // NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU
 // GFX950: global_load_lds_dwordx3 v[2:3], off     ; encoding: [0x00,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00]
-
 global_load_lds_dwordx3 v[2:3], off
 
 // NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error:

Copy link
Contributor

@pravinjagtap pravinjagtap left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor Author

arsenm commented Mar 4, 2025

Merge activity

  • Mar 4, 4:46 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Mar 4, 4:48 AM EST: Graphite rebased this pull request as part of a merge.
  • Mar 4, 4:51 AM EST: Graphite rebased this pull request as part of a merge.
  • Mar 4, 4:54 AM EST: Graphite rebased this pull request as part of a merge.
  • Mar 4, 4:56 AM EST: A user merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/amdgpu/gfx950/restore-broken-negative-assembler-tests branch 2 times, most recently from cbe7e77 to 38c27e2 Compare March 4, 2025 09:51
Fix's not rejecting global_load_lds_dwordx3 and x4 on other targets.
The encoded versions of instructions should not touch SubtargetPredicate,
and only AssemblerPredicate.
@arsenm arsenm force-pushed the users/arsenm/amdgpu/gfx950/restore-broken-negative-assembler-tests branch from 38c27e2 to 63fbf44 Compare March 4, 2025 09:54
@arsenm arsenm merged commit f319a65 into main Mar 4, 2025
6 of 11 checks passed
@arsenm arsenm deleted the users/arsenm/amdgpu/gfx950/restore-broken-negative-assembler-tests branch March 4, 2025 09:56
@arsenm arsenm added this to the LLVM 20.X Release milestone Mar 4, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Mar 4, 2025
@arsenm
Copy link
Contributor Author

arsenm commented Mar 4, 2025

/cherry-pick f319a65

@llvmbot
Copy link
Member

llvmbot commented Mar 4, 2025

Failed to cherry-pick: f319a65

https://github.com/llvm/llvm-project/actions/runs/13651038707

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

arsenm added a commit to arsenm/llvm-project that referenced this pull request Mar 4, 2025
…9667)

Fix's not rejecting global_load_lds_dwordx3 and x4 on other targets.
The encoded versions of instructions should not touch SubtargetPredicate,
and only AssemblerPredicate.

(cherry picked from commit f319a65)
@arsenm
Copy link
Contributor Author

arsenm commented Mar 4, 2025

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

Manual PR #129686

@tstellar tstellar moved this from Needs Triage to Done in LLVM Release Status Mar 11, 2025
tstellar pushed a commit that referenced this pull request Mar 17, 2025
… (#129686)

Fix's not rejecting global_load_lds_dwordx3 and x4 on other targets.
The encoded versions of instructions should not touch
SubtargetPredicate,
and only AssemblerPredicate.
    
(cherry picked from commit f319a65)
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
…9667)

Fix's not rejecting global_load_lds_dwordx3 and x4 on other targets.
The encoded versions of instructions should not touch SubtargetPredicate,
and only AssemblerPredicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants