[LLVMbugs] [Bug 18676] New: [TableGen] Default template argument does not have the same behavior as passing the same argument explicitly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 30 12:04:59 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18676

            Bug ID: 18676
           Summary: [TableGen] Default template argument does not have the
                    same behavior as passing the same argument explicitly
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: qcolombet at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11980
  --> http://llvm.org/bugs/attachment.cgi?id=11980&action=edit
File to reproduce the error

I have attached two td files:
- ko.td uses the default initializer of an argument of a template.
- ok.td specifies the same argument via an explicit value (which is the same as
the default one).

llvm-tblgen <ok|ko>.td -gen-subtarget -I <llvmsrc>/include/

* RESULTS
ko.td:
ko.td:44:1: error: Record `Testrm', field `SchedRW' list is not entirely
DefInit!
defm Test : SS48I_binop_rm;
^
ko.td:40:3: note: instantiated from multiclass
def rm : Instruction, Sched<[itins.Sched.Folded]>;

ok.td:
Works!

The only difference between ok.td and ko.td is:
$ diff ok.td ko.td
44c44
< defm Test : SS48I_binop_rm<SSE_ALU_F32S>;
---
> defm Test : SS48I_binop_rm;

I would expect both files to produce the same output since SS48I_binop_rm
specifies the default argument like this:
multiclass SS48I_binop_rm<OpndItins itins = SSE_ALU_F32S> {

* NOTES
If I replace itins.Sched.Folded by itins.Sched (i.e., one less indirection), it
works for ko.td too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140130/3f0dcd8f/attachment.html>


More information about the llvm-bugs mailing list