RiverDave wrote:

Thanks everyone for the discussion, I'm a little late to the party. This was 
really helpful.

> Just for context (David correct me if I am wrong) we have had this discussion 
> at the beginning of the GSOC and we thought the tool is probably a better 
> choice so that we have a code base that is "independent" from the primary CIR 
> deliverable. There was no technical limitation for CC1 merging

@koparasy that matches my memory too. We went with a separate tool early in 
GSoC mainly to keep the work independent from the main CIR codebase. Nothing 
technically stopped us from doing it in cc1.

> David needs to decide whether HE is ok with a potential rm to the tool and 
> moving it to something larger

I'm fine with the tool being removed later if it ends up as part of something 
larger. LLVM has generally favored small tools that each do one thing 
(specially in the offload ecosystem), so a separate tool makes sense to me 
here, and it's easy to deprecate if something more general replaces it. Most of 
what matters is the container and the passes that will run on it, and those can 
move wherever that ends up, a linker or a cc1 option.

> We seem to be making an implicit assumption that the modules we are merging 
> were produced by the same compiler, probably from a single driver invocation, 
> and that we can therefor count on the modules being coherent and compatible. 
> That's a reasonable assumption for where we are, but once you expose this as 
> a standalone tool, it's no longer a robust assumption and we should have a 
> plan for doing something about that.

@andykaylor fair point on compatibility. For now the tool assumes the inputs 
come from the same driver invocation, and I could correct this somewhere in the 
description. The only checks today are the ones on `cir.lowering_options` (one 
host, CUDA/HIP TU's not mixed). Checking that the boundaries line up (kernels 
and their host stubs, shared types and globals) is something the cross-boundary 
analysis needs anyway, so I'd like to add that verification there as a 
follow-up once we get there and face that kind of limitation.

I also added checks in the test that the lowering options are kept, per your 
earlier comment.

> I think I'd lean towards `cir-offload-merge` with the understanding that 
> we'll probably have to `rm` it someday in favor of a different tool, instead 
> of locking us into this being part of a 'wrong' tool.

@erichkeane sounds good, thanks for taking a look!

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

Reply via email to