[PATCH] [tablegen] Resolve complex def identifiers when instanciating multiclass

Hal Finkel hfinkel at anl.gov
Mon Jun 30 11:39:38 PDT 2014


----- Original Message -----
> From: "deadal nix" <deadalnix at gmail.com>
> To: llvm-commits at cs.uiuc.edu
> Sent: Monday, June 30, 2014 1:24:44 PM
> Subject: Re: [PATCH] [tablegen] Resolve complex def identifiers when	instanciating multiclass
> 
> 
> 
> PING ?
> 

Please wait 1 week in between pings for non-urgent patches. That having been said, thanks for working on this.

+    DefName = CurRec->getNameInit();
+    DefNameString = dyn_cast<StringInit>(DefName);
+
+    // OK the pattern is more complex than simply using NAME.
+    // Let's use the heavy weaponery.
+    if (!DefNameString) {
+      ResolveMulticlassDefArgs(MC, CurRec, DefmPrefixRange.Start, Lex.getLoc(),
+                               TArgs, TemplateVals, false/*Delete args*/);
+
+      DefName = CurRec->getNameInit();
+      DefNameString = dyn_cast<StringInit>(DefName);

Why are we only calling ResolveMulticlassDefArgs when we can't resolve the name? It seems somewhat funny to have the argument resolution state depend on the kind of name that is used. Does something break if you always call this?


+      if (!DefNameString) {
+        DefName = DefName->convertInitializerTo(StringRecTy::get());
+      }

Remove the {} here.

Thanks,
Hal

> 
> 
> 
> 2014-06-26 23:27 GMT-07:00 deadal nix < deadalnix at gmail.com > :
> 
> 
> 
> ping !!?!
> 
> 
> 
> 
> 2014-06-24 16:02 GMT-07:00 deadal nix < deadalnix at gmail.com > :
> 
> 
> 
> 
> ping \o/
> 
> 
> 
> 
> 2014-06-23 0:22 GMT-07:00 deadal nix < deadalnix at gmail.com > :
> 
> 
> 
> 
> As per title. I ran into tablegen limitations that are annoying,
> namely that I couldn't generate custom name for def inside
> multiclass. So here is the fix.
> 
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list