Hello,
I have not done what you are asking, but here is how I'd approach the problem.
1. Assuming you already have some Core, you'd have to figure out how to include it with the rest of the GHC pipeline:
* A lot of the code that glues everything together is in `compiler/main`. Modules of interest seem to be `DriverPipeline`, `HscMain`, and `PipelineMoand`
* A quick looks suggests that maybe you want to call `hscGenHardCode` in `HscMain`, with your core program inside the `CgGuts` argument.
* Exactly how you setup things probably depends on how much of the rest of the Haskell ecosystem you are trying to integrate with (separate compilation, avoiding recompilation, support for packages, etc.)
2. The syntax for Core is in `compiler/coreSyn`, with the basic AST being in module `CoreSyn`. Module `MkCore` has a lot of helpers for working with core syntax.
3. The "desugarer" (in `compiler/deSugar`) is the GHC phase that translates the front end syntax (hsSyn) into core, so that should have lots of examples of how to generate core.
Cheers,
-Iavor