[llvm] 23be732 - AMDGPU: Add an argument to DS_Real_gfx12 to disable alias, NFC (#84717)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 11:35:01 PDT 2024


Author: Changpeng Fang
Date: 2024-03-11T11:34:58-07:00
New Revision: 23be73208d63898611b81d4b93a0c254a40c879c

URL: https://github.com/llvm/llvm-project/commit/23be73208d63898611b81d4b93a0c254a40c879c
DIFF: https://github.com/llvm/llvm-project/commit/23be73208d63898611b81d4b93a0c254a40c879c.diff

LOG: AMDGPU: Add an argument to DS_Real_gfx12 to disable alias, NFC (#84717)

This is for cased that we simply want to rename from ps.Mnemonic, but
ps.Mnemonic itself is not supported as an alias.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/DSInstructions.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td
index a84227ebf506fe..cc763df5a4760b 100644
--- a/llvm/lib/Target/AMDGPU/DSInstructions.td
+++ b/llvm/lib/Target/AMDGPU/DSInstructions.td
@@ -1210,13 +1210,13 @@ class Base_DS_Real_gfx6_gfx7_gfx10_gfx11_gfx12<bits<8> op, DS_Pseudo ps, int ef,
 // GFX12.
 //===----------------------------------------------------------------------===//
 
-multiclass DS_Real_gfx12<bits<8> op, string name = !tolower(NAME)> {
+multiclass DS_Real_gfx12<bits<8> op, string name = !tolower(NAME), bit needAlias = true> {
   defvar ps = !cast<DS_Pseudo>(NAME);
   let AssemblerPredicate = isGFX12Plus, DecoderNamespace = "GFX12" in
     def _gfx12 :
       Base_DS_Real_gfx6_gfx7_gfx10_gfx11_gfx12<op, ps, SIEncodingFamily.GFX12,
                                                name, /*hasGDS=*/false>;
-  if !ne(ps.Mnemonic, name) then
+  if !and(needAlias, !ne(ps.Mnemonic, name)) then
     def : MnemonicAlias<ps.Mnemonic, name>, Requires<[isGFX12Plus]>;
 }
 


        


More information about the llvm-commits mailing list