[clang] [llvm] Finish deleting the le32/le64 targets (PR #98497)

2024-07-15 Thread Andrew Adams via cfe-commits

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


[clang] [llvm] Finish deleting the le32/le64 targets (PR #98497)

2024-07-15 Thread Andrew Adams via cfe-commits

abadams wrote:

We were advised to use the pnacl targets at the time the code was written.  
We're trying wasm now.

The IR can be generic if you use a subset of C that excludes all the things 
that vary across the targets you care about. For cases we really can't avoid it 
(e.g. win32 calling convention stuff for direct3d), we compile that one 
fragment with a few different target triples.

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