[PATCH] D17432: [NVPTX] Nix hack used to emit '{' and '}' for NVPTX calls.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 18:07:53 PST 2016


jlebar created this revision.
jlebar added a reviewer: jholewinski.
jlebar added subscribers: tra, llvm-commits.
Herald added a subscriber: jholewinski.

Tablegen understands backslash as an escape char; that's sufficient.

http://reviews.llvm.org/D17432

Files:
  lib/Target/NVPTX/NVPTXInstrInfo.td

Index: lib/Target/NVPTX/NVPTXInstrInfo.td
===================================================================
--- lib/Target/NVPTX/NVPTXInstrInfo.td
+++ lib/Target/NVPTX/NVPTXInstrInfo.td
@@ -2658,20 +2658,14 @@
 class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern>
    : NVPTXInst<outs, ins, asmstr, pattern>;
 
-// @TODO: We use some tricks here to emit curly braces.  Can we clean this up
-// a bit without TableGen modifications?
 def Callseq_Start :
   NVPTXInst<(outs), (ins i32imm:$amt),
-            "// Callseq Start $amt\n"
-            "\t{{\n"
-            "\t.reg .b32 temp_param_reg;\n"
-            "\t// <end>}}",
+            "\\{ // callseq $amt\n"
+            "\t.reg .b32 temp_param_reg;",
            [(callseq_start timm:$amt)]>;
 def Callseq_End :
   NVPTXInst<(outs), (ins i32imm:$amt1, i32imm:$amt2),
-            "\n"
-            "\t//{{\n"
-            "\t}}// Callseq End $amt1",
+            "\\} // callseq $amt1",
             [(callseq_end timm:$amt1, timm:$amt2)]>;
 
 // trap instruction


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17432.48443.patch
Type: text/x-patch
Size: 1037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160219/d471c92c/attachment.bin>


More information about the llvm-commits mailing list