I would like to know the following about LLVM's Compiler-RT project: from what program is it invoked. To my understanding, Compiler-RT is a collection of functions that handle instructions in LLVM that don't really have hardware counterparts (is there more to it than this?). So if I use division in LLVM, it should be replaced by an appropriate Compiler-RT function. First, if this is not correct, please correct me!
Second, I am curious as to who generates the Compiler-RT usage. Is it Clang or is it LLVM directly. Could I write a different front-end to LLVM and would LLVM automatically handle the use of Compiler-RT when appropriate?
Both your assertions are correct. A LLVM backend has to map LLVM IR to native target-specific instructions. If an instruction is not supported natively, it has to be replaced (legalized). You can see this taking place in TargetLowering, which directly maps to runtime functions in the Compiler RT.
The front end is not involved.