[llvm] r363384 - AMDGPU: Fix printing trailing whitespace after s_endpgm

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 06:26:30 PDT 2019


Author: arsenm
Date: Fri Jun 14 06:26:29 2019
New Revision: 363384

URL: http://llvm.org/viewvc/llvm-project?rev=363384&view=rev
Log:
AMDGPU: Fix printing trailing whitespace after s_endpgm

Modified:
    llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
    llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td
    llvm/trunk/test/MC/AMDGPU/s_endpgm.s

Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp?rev=363384&r1=363383&r2=363384&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp Fri Jun 14 06:26:29 2019
@@ -1439,7 +1439,7 @@ void AMDGPUInstPrinter::printEndpgm(cons
     return;
   }
 
-  O << formatDec(Imm);
+  O << ' ' << formatDec(Imm);
 }
 
 #include "AMDGPUGenAsmWriter.inc"

Modified: llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td?rev=363384&r1=363383&r2=363384&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td Fri Jun 14 06:26:29 2019
@@ -937,7 +937,7 @@ def S_NOP : SOPP <0x00000000, (ins i16im
 
 let isTerminator = 1 in {
 
-def S_ENDPGM : SOPP <0x00000001, (ins EndpgmImm:$simm16), "s_endpgm $simm16"> {
+def S_ENDPGM : SOPP <0x00000001, (ins EndpgmImm:$simm16), "s_endpgm$simm16"> {
   let isBarrier = 1;
   let isReturn = 1;
 }

Modified: llvm/trunk/test/MC/AMDGPU/s_endpgm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/s_endpgm.s?rev=363384&r1=363383&r2=363384&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/s_endpgm.s (original)
+++ llvm/trunk/test/MC/AMDGPU/s_endpgm.s Fri Jun 14 06:26:29 2019
@@ -1,17 +1,18 @@
+// RUN: llvm-mc -arch=amdgcn %s | FileCheck -strict-whitespace %s -check-prefix=WHITESPACE
 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s --check-prefix=GCN
 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -filetype=obj %s | llvm-objcopy -S -K keep_symbol - | llvm-objdump -disassemble -mcpu=gfx900 - | FileCheck %s --check-prefix=BIN
 
+// WHITESPACE: s_endpgm{{$}}
 // GCN: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
 // BIN: s_endpgm    // 000000000000: BF810000
 s_endpgm
 
+// WHITESPACE: s_endpgm{{$}}
 // GCN: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
 // BIN: s_endpgm    // 000000000004: BF810000
 s_endpgm 0
 
-  
+// WHITESPACE: s_endpgm 1{{$}}
 // GCN: s_endpgm 1 ; encoding: [0x01,0x00,0x81,0xbf]
 // BIN: s_endpgm 1  // 000000000008: BF810001
 s_endpgm 1
-  
-  




More information about the llvm-commits mailing list