[PATCH] D16384: [GlobalISel] Move generic opcodes description to their own file.

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 17:26:03 PST 2016


qcolombet created this revision.
qcolombet added a reviewer: echristo.
qcolombet added a subscriber: llvm-commits.
qcolombet set the repository for this revision to rL LLVM.
Herald added subscribers: vkalintiris, joker.eph.

Hi Eric,

Does this patch match what you had in mind?

Moreover, the generic opcodes still appear in TargetOpcodes.h and I was thinking that we may want to do something similar. We could move them into their own include, but
- we don't have precedence for this kind of split (usually we do the .inc, but those are generated by TableGen).
- we set the values explicitly in the enum.

Ideas for a follow-up patch?

Thanks,
-Quentin

Repository:
  rL LLVM

http://reviews.llvm.org/D16384

Files:
  include/llvm/Target/GenericOpcodes.td
  include/llvm/Target/Target.td

Index: include/llvm/Target/Target.td
===================================================================
--- include/llvm/Target/Target.td
+++ include/llvm/Target/Target.td
@@ -914,16 +914,9 @@
   let mayLoad = 1;
 }
 
-// Generic opcode used by the IRTranslator.
-// After ISel, this opcode should not appear.
-def G_ADD : Instruction {
-  let OutOperandList = (outs unknown:$dst);
-  let InOperandList = (ins unknown:$src1, unknown:$src2);
-  let AsmString = "";
-  let hasSideEffects = 0;
-  let isCommutable = 1;
-}
-// TODO: Add the other generic opcodes.
+// Generic opcodes used in GlobalISel.
+include "llvm/Target/GenericOpcodes.td"
+
 }
 
 //===----------------------------------------------------------------------===//
Index: include/llvm/Target/GenericOpcodes.td
===================================================================
--- include/llvm/Target/GenericOpcodes.td
+++ include/llvm/Target/GenericOpcodes.td
@@ -0,0 +1,23 @@
+//===-- GenericOpcodes.td - Opcodes used with GlobalISel ---*- tablegen -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the generic opcodes used with GlobalISel.
+// After instruction selection, these opcodes should not appear.
+//
+//===----------------------------------------------------------------------===//
+
+// Generic addition.
+def G_ADD : Instruction {
+  let OutOperandList = (outs unknown:$dst);
+  let InOperandList = (ins unknown:$src1, unknown:$src2);
+  let AsmString = "";
+  let hasSideEffects = 0;
+  let isCommutable = 1;
+}
+// TODO: Add the other generic opcodes.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16384.45469.patch
Type: text/x-patch
Size: 1788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/1b97142b/attachment.bin>


More information about the llvm-commits mailing list