]> granicus.if.org Git - llvm/commitdiff
AMDGPU: Fix printed format of SReg_96
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 15 Apr 2019 20:42:18 +0000 (20:42 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 15 Apr 2019 20:42:18 +0000 (20:42 +0000)
These are artificial, so I think this should only come up with inline
asm comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358446 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
test/CodeGen/AMDGPU/inline-asm.ll

index c1358f771b3278bda189b8fda5ab03da9467be1b..23bea351501619eb54125803df9144a497e3b4b1 100644 (file)
@@ -357,6 +357,9 @@ void AMDGPUInstPrinter::printRegOperand(unsigned RegNo, raw_ostream &O,
   } else if (MRI.getRegClass(AMDGPU::VReg_96RegClassID).contains(RegNo)) {
     O << 'v';
     NumRegs = 3;
+  } else if (MRI.getRegClass(AMDGPU::SReg_96RegClassID).contains(RegNo)) {
+    O << 's';
+    NumRegs = 3;
   } else if (MRI.getRegClass(AMDGPU::VReg_160RegClassID).contains(RegNo)) {
     O << 'v';
     NumRegs = 5;
index 9615efaaa938703b2ba4f30049a9bd25c090a239..6a97626c7b0e66d7fcb997a797514feac5ceae6a 100644 (file)
@@ -267,3 +267,13 @@ entry:
   tail call void asm sideeffect "s_trap ${0:n}", "n"(i32 10) #1
   ret void
 }
+
+; Make sure tuples of 3 SGPRs are printed with the [] syntax instead
+; of the tablegen default.
+; CHECK-LABEL: {{^}}sgpr96_name_format:
+; CHECK: ; sgpr96 s[0:2]
+define amdgpu_kernel void @sgpr96_name_format()  {
+entry:
+  tail call void asm sideeffect "; sgpr96 $0", "s"(<3 x i32> <i32 10, i32 11, i32 12>) #1
+  ret void
+}