Using LLVM not in function

I was looking into using llvm in a slightly unusual way where I don’t really want to compile functions, I want to compile maybe a couple blocks where I know that the inputs must be a couple registers and locations and the outputs must go in a couple registers and locations which are not standard function call abi locations. The goal is to eventually patch these blocks into a larger routine which I don’t really have control over what it does.
Is this at all possible?