[PATCH] TableGen: AsmMatcherEmitter: Don't use custom converters for instruction aliases

Tom Stellard thomas.stellard at amd.com
Fri Apr 17 10:57:00 PDT 2015


If there was an InstAlias defined for an instruction that had a custom converter, then when the alias was matched, the custom converter was used rather than the converted supplied with the alias.

This is required for some future improvements to the R600 assembler.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9083

Files:
  utils/TableGen/AsmMatcherEmitter.cpp

Index: utils/TableGen/AsmMatcherEmitter.cpp
===================================================================
--- utils/TableGen/AsmMatcherEmitter.cpp
+++ utils/TableGen/AsmMatcherEmitter.cpp
@@ -438,12 +438,17 @@
   /// If this instruction is deprecated in some form.
   bool HasDeprecation;
 
+  /// If this matchable was generated from and InstAlias.
+  bool IsInstAlias;
+
   MatchableInfo(const CodeGenInstruction &CGI)
-    : AsmVariantID(0), AsmString(CGI.AsmString), TheDef(CGI.TheDef), DefRec(&CGI) {
+    : AsmVariantID(0), AsmString(CGI.AsmString), TheDef(CGI.TheDef), DefRec(&CGI),
+      IsInstAlias(false) {
   }
 
   MatchableInfo(std::unique_ptr<const CodeGenInstAlias> Alias)
-    : AsmVariantID(0), AsmString(Alias->AsmString), TheDef(Alias->TheDef), DefRec(Alias.release()) {
+    : AsmVariantID(0), AsmString(Alias->AsmString), TheDef(Alias->TheDef),
+      DefRec(Alias.release()), IsInstAlias(true) {
   }
 
   ~MatchableInfo() {
@@ -1749,7 +1754,7 @@
     // Check if we have a custom match function.
     std::string AsmMatchConverter =
       II->getResultInst()->TheDef->getValueAsString("AsmMatchConverter");
-    if (!AsmMatchConverter.empty()) {
+    if (!AsmMatchConverter.empty() && !II->IsInstAlias) {
       std::string Signature = "ConvertCustom_" + AsmMatchConverter;
       II->ConversionFnKind = Signature;

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9083.23949.patch
Type: text/x-patch
Size: 1348 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150417/aca3131f/attachment.bin>


More information about the llvm-commits mailing list