To echo with both Machineko and Dan's perspective:
I have worked on another project called Terra, which is a very small DSL built on top of Lua which utilizes LLVM to generate very efficient computation kernels on GPUs. Obviously Lua does not have any GPU codegen, but the combination of a DSL and Lua creates a very powerful GPU language currently powering many big HPC applications. Note that this is more like a hybrid of having a codegen and not having one - we are not lowering LuaJIT bitcode, but generating scheduled LLVM bc that is then compiled by calling the CUDA libs.
One key difference here with Swift is that we are dealing with a compiled language, with no run-time access to the AST. Thus, I don't know if it is possible to create a DSL in Swift that can both act as real Swift code (which executes on CPU) and can be lowered to MLIR/bitcode. I believe @GeorgeL (in LLVM discourse) is working on MLIR bindings for Swift, so that may be of great interest to everyone here.
Oh, I just realized that this ^ all have already been covered by the amazing (but suspended) Swift as Syntactic Sugar for MLIR by @burmako .