AnyDSL/MimIR

Code generation for floating point casts

Closed this issue · 2 comments

Currently, floating point casts are not correctly resolved.
For instance,
.let acc_3187824: %math.F (52, 11) = %math.conv.f2f (52, 11) (52, 11) 0:(%math.F (52, 11));
generates the invalid code %acc_3187824 = fptrunc double 0x0000000000000000 to double.
Example:
Fork: NeuralCoder3
Branch: matrix_dialect
Command: ./build/bin/thorin -d matrix -d affine -d direct -d clos lit/matrix/print_const_prod.thorin --output-ll Tmp.ll -o - && clang lit/matrix/lib.c Tmp.ll -o Tmp.out && ./Tmp.out 2 3

Problem: The math dialect was not loaded properly.
Solution: Load it using -d math
Idea: Maybe allow auto-loading of dependent dialects.

Maybe we should file an enhancement issue to auto-load plugins. Specify -d plugin is kind of redundant.