Yes, this would be a much clearer separation. I’d go further and say that any dialect that converts “some” operations to LLVM must convert “all”. This would make it much easier for users of those dialects to trust the dialect will work as expected in all cases wrt. LLVM lowering.
It becomes much simpler then, to only implement LLVM lowering of the things in “my dialect” that I can’t find in any other existing dialect “that lowers to LLVM”.
Of course, this would only make sense if we split the standard dialect in the first place.
As a “user” of those dialects, to me they are the same thing. Ie. the only reason why I would want to use the LLVM dialect is to get LLVM IR at the end. I think it would be a serious break of contract if individual dialects had to lower to LLVM IR directly.
From the tutorials and examples I have seen so far, the further I’d need to go is to lower concepts that don’t exist in any other dialect directly to LLVM dialect, and that would be a “full conversion”. The lowering to LLVM IR would be 1:1 from the LLVM dialect.
This may not be entirely true in the current implementation (I really don’t know, and would hope it was), but it’s something that I think would make it much easier for dialect writers to separate concerns and only do what’s minimally necessary.
Perhaps a list of dialects somewhere in the interfaces that can be used by user dialects to load all necessary ones.
Optimally, no dialect creator would have to load any dialect by hand.
A simple way would list all of the things it needs, which will themselves have lists of all dialects they need, and there would be a simple loop on the intersection to load each dialect.
A more elaborate way would register dialects onto a set argument to each constructor (dialects, interfaces, etc), which would then insert (or ignore) all their needed dialects. Then a wrapper function loadAllDialects would make sure they’re all loaded.