skatrak wrote:

> But eventually we actually may need different modules even for user-created 
> modules. This is because e.g. OpenMP allows definitions specific to a 
> particular device, i.e. `!$omp declare target` and even differentiate between 
> nvptx/amdgcn (metadirective/`!$omp declare variant`). Currently it seems just 
> everything is emitted, causing issues: #195188 #195468.

One comment on this, as I'm working on a solution to the issues you're 
referring to. In my opinion, we don't absolutely require different host/device 
module files for `declare target` support specifically, and I imagine we could 
implement similar filtering logic for `declare variant`. In fact, the host 
already needs visibility into `nohost` definitions, since it has to produce 
fallback implementations for failed target region launches on a device. What we 
do is we filter host-only operations from device compilation later in MLIR 
before translating to LLVM IR. The bugs you point to relate to some mishandling 
of `declare target` globals that I'm working to fix in MLIR.

This is not to say we should discard the idea of making multi-section module 
files or conceptually similar solutions if we want to, but it seems to me that 
the only thing we might not be able to handle without it are preprocessor-based 
differences in the Fortran source between host and device.

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