I’m currently working on a project that JIT compiles traces of C++ functions to new functions optimized for the particular input. I have IR generation mostly working, except: these functions take complicated C++ types (specifically
std::vector<double>, a struct containing fields with
std::vector types, and
Eigen::Transform from Eigen: Eigen::Transform< Scalar_, Dim_, Mode_, Options_ > Class Template Reference) as arguments, and I don’t know how to generate a function type that includes these types.
I’ve tried looking at the IR
clang++ generates for a similar function, and it appears to include a long hierarchy of types corresponding to the
std::vector argument types. However, I’m not sure if I can safely include the same hierarchy in my code, as I don’t know if it’s machine specific, etc.
I’m thinking of avoiding the complexity of generating the calls necessary to access elements from these types by providing a runtime library with a simplified interface, but I still need to figure out how to express these types correctly in IR for that approach to work.
Is there an easy way around this, e.g. by using an opaque structure type or something? Thanks!