https://bugs.llvm.org/show_bug.cgi?id=50486

            Bug ID: 50486
           Summary: Deficiency in 'if' compared to 'foreach' with cast in
                    TableGen
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 24894
  --> https://bugs.llvm.org/attachment.cgi?id=24894&action=edit
reproducer and counterexamples

The Tablegen if statement introduced in https://reviews.llvm.org/D71474 seems
to have a deficiency compared to foreach, when using casts. The attached case
shows an example where this happens, and it is a reduced version of what
happens in the AMDGPU backend. 

The error message is "attempting to loop over
'!if(!cast<with_field>("instance").val, [1], [])', expected a list" which is
the code the 'if ... then' is expanded to in llvm/lib/TableGen/TGParser.cpp.
However,I could not figure out a fix while looking at this file.

The equivalent formation the statement using foreach works.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to