[PATCH] D38482: TargetMachine: Use LLVMTargetMachine in CodeGen
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 2 16:01:24 PDT 2017
MatzeB created this revision.
Herald added subscribers: JDevlieghere, fedor.sergeev, kbarton, javed.absar, nhaehnle, nemanjai, sdardis, mcrosier, mehdi_amini, jyknight, arsenm, jholewinski.
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()`
Repository:
rL LLVM
https://reviews.llvm.org/D38482
Files:
include/llvm/CodeGen/Analysis.h
include/llvm/CodeGen/AsmPrinter.h
include/llvm/CodeGen/BasicTTIImpl.h
include/llvm/CodeGen/FastISel.h
include/llvm/CodeGen/MachineFunction.h
include/llvm/CodeGen/MachineModuleInfo.h
include/llvm/CodeGen/RegisterUsageInfo.h
include/llvm/CodeGen/SelectionDAG.h
include/llvm/CodeGen/SelectionDAGISel.h
include/llvm/CodeGen/StackProtector.h
include/llvm/Support/TargetRegistry.h
include/llvm/Target/TargetLowering.h
include/llvm/Target/TargetMachine.h
lib/CodeGen/Analysis.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AtomicExpandPass.cpp
lib/CodeGen/BasicTargetTransformInfo.cpp
lib/CodeGen/CodeGenPrepare.cpp
lib/CodeGen/DwarfEHPrepare.cpp
lib/CodeGen/InterleavedAccessPass.cpp
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/MachineModuleInfo.cpp
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/RegUsageInfoCollector.cpp
lib/CodeGen/SafeStack.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/CodeGen/StackProtector.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/LTO/UpdateCompilerUsed.cpp
lib/Target/AArch64/AArch64AsmPrinter.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Target/AArch64/AArch64Subtarget.cpp
lib/Target/AArch64/AArch64Subtarget.h
lib/Target/AArch64/AArch64TargetTransformInfo.cpp
lib/Target/AMDGPU/AMDGPU.h
lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
lib/Target/AMDGPU/AMDGPUAsmPrinter.h
lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.h
lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
lib/Target/AMDGPU/AMDGPUSubtarget.cpp
lib/Target/AMDGPU/AMDGPUSubtarget.h
lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
lib/Target/AMDGPU/R600ISelLowering.cpp
lib/Target/AMDGPU/R600ISelLowering.h
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIISelLowering.h
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMAsmPrinter.h
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/ARM/ARMTargetObjectFile.cpp
lib/Target/ARM/ARMTargetTransformInfo.cpp
lib/Target/BPF/BPFAsmPrinter.cpp
lib/Target/BPF/BPFISelLowering.cpp
lib/Target/BPF/BPFISelLowering.h
lib/Target/BPF/BPFSubtarget.cpp
lib/Target/BPF/BPFSubtarget.h
lib/Target/Hexagon/HexagonAsmPrinter.cpp
lib/Target/Hexagon/HexagonAsmPrinter.h
lib/Target/Hexagon/HexagonISelLowering.cpp
lib/Target/Hexagon/HexagonISelLowering.h
lib/Target/Hexagon/HexagonSubtarget.cpp
lib/Target/Hexagon/HexagonSubtarget.h
lib/Target/Lanai/LanaiAsmPrinter.cpp
lib/Target/Lanai/LanaiISelLowering.cpp
lib/Target/Lanai/LanaiISelLowering.h
lib/Target/Lanai/LanaiSubtarget.cpp
lib/Target/Lanai/LanaiSubtarget.h
lib/Target/MSP430/MSP430AsmPrinter.cpp
lib/Target/MSP430/MSP430ISelLowering.cpp
lib/Target/MSP430/MSP430ISelLowering.h
lib/Target/MSP430/MSP430Subtarget.cpp
lib/Target/MSP430/MSP430Subtarget.h
lib/Target/Mips/MipsAsmPrinter.h
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
lib/Target/NVPTX/NVPTXAsmPrinter.h
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/Sparc/SparcISelLowering.cpp
lib/Target/Sparc/SparcISelLowering.h
lib/Target/Sparc/SparcSubtarget.cpp
lib/Target/Sparc/SparcSubtarget.h
lib/Target/SystemZ/SystemZAsmPrinter.h
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
lib/Target/SystemZ/SystemZSubtarget.cpp
lib/Target/SystemZ/SystemZSubtarget.h
lib/Target/X86/X86AsmPrinter.h
lib/Target/X86/X86Subtarget.h
lib/Target/X86/X86TargetTransformInfo.cpp
lib/Target/XCore/XCoreAsmPrinter.cpp
lib/Target/XCore/XCoreISelLowering.cpp
lib/Target/XCore/XCoreISelLowering.h
lib/Target/XCore/XCoreSubtarget.cpp
lib/Target/XCore/XCoreSubtarget.h
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
unittests/MI/LiveIntervalTest.cpp
unittests/Target/AArch64/InstSizes.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38482.117441.patch
Type: text/x-patch
Size: 84327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171002/fd565470/attachment-0001.bin>
More information about the llvm-commits
mailing list