While preparing a talk about CodeGen I looked at the TargetMachine/LLVMTargetMachine classes; reading the doxygen comments it seems that the intention is that TargetMachine is a general interface to be used by all targets, while LLVMTargetMachine is a specialization for targets using code from lib/CodeGen.
In practice some methods that were only useful for lib/CodeGen based targets sneaked into TargetMachine anyway. The problem as it turns out is that most of the time we only had a reference to TargetMachine instead of LLVMTargetMachine at hand.
This commit:
- Changes most reference in CodeGen from TargetMachine to LLVMTargetMachine
- Moves some methods from TargetMachine to LLVMTargetMachine: getSubtarget, targetSchedulesPostRAScheduling, usesPhysRegsForPEI, useIPRA
- Add two new methods into TargetMachine for the two cases where non-CodeGen code was directly accessing CodeGen interfaces: useAA(), getTargetLowering()