[llvm] 9ecc72f - [AMDGPU] Simplify definition of FLAT segment bits. NFC.

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 09:47:41 PDT 2024


Author: Jay Foad
Date: 2024-03-15T16:47:35Z
New Revision: 9ecc72f39918d157a46ff1ea816a8756a9bbf75b

URL: https://github.com/llvm/llvm-project/commit/9ecc72f39918d157a46ff1ea816a8756a9bbf75b
DIFF: https://github.com/llvm/llvm-project/commit/9ecc72f39918d157a46ff1ea816a8756a9bbf75b.diff

LOG: [AMDGPU] Simplify definition of FLAT segment bits. NFC.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/FLATInstructions.td b/llvm/lib/Target/AMDGPU/FLATInstructions.td
index 548bbfde408782..cc03ee6c35462d 100644
--- a/llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ b/llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -115,8 +115,7 @@ class FLAT_Real <bits<7> op, FLAT_Pseudo ps, string opName = ps.Mnemonic> :
   bits<1> lds = ps.lds; // LDS DMA for global and scratch
 
   // Segment, 00=flat, 01=scratch, 10=global, 11=reserved
-  bits<2> seg = !if(ps.is_flat_global, 0b10,
-                  !if(ps.is_flat_scratch, 0b01, 0));
+  bits<2> seg = {ps.is_flat_global, ps.is_flat_scratch};
 
   // Signed offset. Highest bit ignored for flat and treated as 12-bit
   // unsigned for flat accesses.
@@ -2562,8 +2561,7 @@ class VFLAT_Real_gfx12 <bits<8> op, FLAT_Pseudo ps,
   let AssemblerPredicate = isGFX12Plus;
   let DecoderNamespace = "GFX12";
 
-  let Inst{25-24} = !if(ps.is_flat_scratch, 0b01,
-                        !if(ps.is_flat_global, 0b10, 0b00));
+  let Inst{25-24} = {ps.is_flat_global, ps.is_flat_scratch};
 }
 
 multiclass VFLAT_Aliases_gfx12<string ps, string opName, int renamed, string alias> {


        


More information about the llvm-commits mailing list