jeanPerier wrote:

> How we resolve this if we really needs different modules even for user 
> modules can be discussed separately. Options are to also emit it in a 
> subdirectory of -module-dir, i.e. amdgcn-amd-amdhsa/modfile.mod, or with 
> another file extention, i.e. modfile.amdgcn-amd-amdhsa.mod. Unfortunately 
> build systems do not expect additional files to appear other than the single 
> modfile.mod. And alternative is to put all variants into a single bundle, 
> like llvm-offload-binary puts all offload variants as fat binary with ELF 
> sections. We are in control of the .mod format, so we can just define 
> multi-sections within it.

Another solution could be to extend the module file representation to hold the 
several versions  in the same module file (or at least the differences, which 
would avoid artificially inflating the build size when building for many 
targets). This assumes the host and device compilations are "atomic" within the 
rest of the build, that is that no other compilation would start using the host 
module before it is updated with the target info (so that the hash of the new 
module file is stable).

This would leave flang deal with all the details instead of spilling it into 
the build/file system, but this may also have a lot of downside and be over 
complex. I agree this a topic that deserve its own disucssion.

https://github.com/llvm/llvm-project/pull/200863
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to