Move the remaing of FIR types to TableGen type definition. This follow suggestion in D96422.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
410 ms | x64 windows > Clang.CodeGen::aarch64-poly-add.c |
Event Timeline
flang/include/flang/Optimizer/Dialect/FIRTypes.td | ||
---|---|---|
356 | I'd prefer that the printers for these are defined with the parser. Can you move these to C++ as well? | |
362 | Remove the extra newline here. | |
375 | You don't need to define a parser/printer for types with no parameters. | |
415–417 | ||
501 | Use the builders field instead: https://mlir.llvm.org/docs/OpDefinitions/#custom-type-builder-methods |
Do the parsers/printers here have any test coverage?
flang/include/flang/Optimizer/Dialect/FIRTypes.td | ||
---|---|---|
86 | You can use CArg to provided a default value for the map param. | |
517 | Renaming the parameter to elementType would remove the need for this. | |
flang/lib/Optimizer/Dialect/FIRType.cpp | ||
309 | You should be able to do: isa<BoxType, BoxCharType, ...>() | |
337 | This error message should be redundant, an error is already emitted for most of these cases. This seems to point to a lack of test coverage. We also try to avoid double error messages in general. | |
338 | nit: You should be able to just stream this in: printer << ", " << map; | |
761 | i = rows? The initialization here looks really weird, |
Round trip tests in flang/test/Fir/fir-types.fir. I'm gonna upstream some "invalid" tests in a follow up patch as well to check the diagnostics.
flang/include/flang/Optimizer/Dialect/FIRTypes.td | ||
---|---|---|
517 | It's not needed anymore so I just removed it. | |
flang/lib/Optimizer/Dialect/FIRType.cpp | ||
309 | Right. It's not new code so I didn't double checked it. Works fine with your suggestion. Thx! | |
761 | It's also a code that was just moved around. I updated the initialization in the new patch version. |
You can use CArg to provided a default value for the map param.