abadams wrote: Our actual need is for a stable and user-friendly way to write fragments of mostly-target-agnostic llvm IR.
We concat these with other fragments and give it an actual target triple later. This lets us assemble a target-specific Halide runtime dynamically by mixing and matching some number of these fragments. Compiling these fragments for all possible target triples we support instead of a generic one would multiply our code size and compile time by the (large) number of possible target triples we can emit. Not using fragments at all and compiling a runtime in a more conventional way would be a combinatorial amount of code, because there are a lot of combinations. Writing generic .ll directly is possible, and we do a little of that for very low-level things, but writing in C++ and compiling via clang to le64/32 is more stable and much more pleasant due to the abstractions that C++ provides. We just have to be careful to not do things like have structs that would have different layouts on different platforms. If there's a better way to do all this, let us know. Does no other project have a need for "generic" llvm IR without any target-specific annotations on it yet? https://github.com/llvm/llvm-project/pull/98497 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits