[llvm-branch-commits] [llvm-branch] r119217 - in /llvm/branches/Apple/whitney: docs/TableGenFundamentals.html lib/Target/ARM/ARMInstrFormats.td lib/Target/X86/X86InstrFormats.td utils/TableGen/AsmMatcherEmitter.cpp utils/TableGen/TGParser.cpp

Daniel Dunbar daniel at zuster.org
Mon Nov 15 13:44:11 PST 2010


Author: ddunbar
Date: Mon Nov 15 15:44:10 2010
New Revision: 119217

URL: http://llvm.org/viewvc/llvm-project?rev=119217&view=rev
Log:
Merge r117862:
--
Author: Chris Lattner <clattner at apple.com>
Date:   Sun Oct 31 19:22:57 2010 +0000

    fix the !eq operator in tblgen to return a bit instead of an int.

    Use this to make the X86 and ARM targets set isCodeGenOnly=1
    automatically for their instructions that have Format=Pseudo,
    resolving a hack in tblgen.

Modified:
    llvm/branches/Apple/whitney/docs/TableGenFundamentals.html
    llvm/branches/Apple/whitney/lib/Target/ARM/ARMInstrFormats.td
    llvm/branches/Apple/whitney/lib/Target/X86/X86InstrFormats.td
    llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp
    llvm/branches/Apple/whitney/utils/TableGen/TGParser.cpp

Modified: llvm/branches/Apple/whitney/docs/TableGenFundamentals.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/docs/TableGenFundamentals.html?rev=119217&r1=119216&r2=119217&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/docs/TableGenFundamentals.html (original)
+++ llvm/branches/Apple/whitney/docs/TableGenFundamentals.html Mon Nov 15 15:44:10 2010
@@ -422,7 +422,7 @@
   <dd>'b' if the result of 'int' or 'bit' operator 'a' is nonzero,
       'c' otherwise.</dd>
 <dt><tt>!eq(a,b)</tt></dt>
-  <dd>Integer one if string a is equal to string b, zero otherwise.  This
+  <dd>'bit 1' if string a is equal to string b, 0 otherwise.  This
       only operates on string, int and bit objects.  Use !cast<string> to
       compare other types of objects.</dd>
 </dl>

Modified: llvm/branches/Apple/whitney/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/ARM/ARMInstrFormats.td?rev=119217&r1=119216&r2=119217&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/branches/Apple/whitney/lib/Target/ARM/ARMInstrFormats.td Mon Nov 15 15:44:10 2010
@@ -203,6 +203,9 @@
   Domain D = d;
   bit isUnaryDataProc = 0;
   bit canXformTo16Bit = 0;
+  
+  // If this is a pseudo instruction, mark it isCodeGenOnly.
+  let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo");
 
   // The layout of TSFlags should be kept in sync with ARMBaseInstrInfo.h.
   let TSFlags{4-0}   = AM.Value;

Modified: llvm/branches/Apple/whitney/lib/Target/X86/X86InstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/X86InstrFormats.td?rev=119217&r1=119216&r2=119217&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/X86InstrFormats.td (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/X86InstrFormats.td Mon Nov 15 15:44:10 2010
@@ -125,6 +125,9 @@
   dag InOperandList = ins;
   string AsmString = AsmStr;
 
+  // If this is a pseudo instruction, mark it isCodeGenOnly.
+  let isCodeGenOnly = !eq(!cast<string>(f), "Pseudo");
+
   //
   // Attributes specific to X86 instructions...
   //

Modified: llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp?rev=119217&r1=119216&r2=119217&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp Mon Nov 15 15:44:10 2010
@@ -223,21 +223,6 @@
   if (CGI.TheDef->getValueAsBit("isCodeGenOnly"))
     return false;
 
-  // Ignore pseudo ops.
-  //
-  // FIXME: This is a hack [for X86]; can we convert these instructions to set
-  // the "codegen only" bit instead?
-  if (const RecordVal *Form = CGI.TheDef->getValue("Form"))
-    if (Form->getValue()->getAsString() == "Pseudo")
-      return false;
-  
-  // FIXME: This is a hack [for ARM]; can we convert these instructions to set
-  // the "codegen only" bit instead?
-  if (const RecordVal *Form = CGI.TheDef->getValue("F"))
-    if (Form->getValue()->getAsString() == "Pseudo")
-      return false;
-  
-
   // Ignore "Int_*" and "*_Int" instructions, which are internal aliases.
   //
   // FIXME: This is a total hack.

Modified: llvm/branches/Apple/whitney/utils/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/utils/TableGen/TGParser.cpp?rev=119217&r1=119216&r2=119217&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/utils/TableGen/TGParser.cpp (original)
+++ llvm/branches/Apple/whitney/utils/TableGen/TGParser.cpp Mon Nov 15 15:44:10 2010
@@ -812,7 +812,7 @@
     case tgtok::XSRA:    Code = BinOpInit::SRA;    Type = new IntRecTy(); break;
     case tgtok::XSRL:    Code = BinOpInit::SRL;    Type = new IntRecTy(); break;
     case tgtok::XSHL:    Code = BinOpInit::SHL;    Type = new IntRecTy(); break;
-    case tgtok::XEq:     Code = BinOpInit::EQ;     Type = new IntRecTy(); break;
+    case tgtok::XEq:     Code = BinOpInit::EQ;     Type = new BitRecTy(); break;
     case tgtok::XStrConcat:
       Code = BinOpInit::STRCONCAT;
       Type = new StringRecTy();





More information about the llvm-branch-commits mailing list