Split TargetLowering into a CodeGen and a SelectionDAG part.

This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172246 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2013-01-11 20:05:37 +00:00
parent 3e40d927a7
commit 69e42dbd00
12 changed files with 1931 additions and 1608 deletions

View File

@ -26,7 +26,7 @@ using namespace llvm;
namespace {
class BasicTTI : public ImmutablePass, public TargetTransformInfo {
const TargetLowering *TLI;
const TargetLoweringBase *TLI;
/// Estimate the overhead of scalarizing an instruction. Insert and Extract
/// are set if the result needs to be inserted and/or extracted from vectors.
@ -37,7 +37,7 @@ public:
llvm_unreachable("This pass cannot be directly constructed");
}
BasicTTI(const TargetLowering *TLI) : ImmutablePass(ID), TLI(TLI) {
BasicTTI(const TargetLoweringBase *TLI) : ImmutablePass(ID), TLI(TLI) {
initializeBasicTTIPass(*PassRegistry::getPassRegistry());
}
@ -112,7 +112,7 @@ INITIALIZE_AG_PASS(BasicTTI, TargetTransformInfo, "basictti",
char BasicTTI::ID = 0;
ImmutablePass *
llvm::createBasicTargetTransformInfoPass(const TargetLowering *TLI) {
llvm::createBasicTargetTransformInfoPass(const TargetLoweringBase *TLI) {
return new BasicTTI(TLI);
}
@ -128,7 +128,7 @@ bool BasicTTI::isLegalICmpImmediate(int64_t imm) const {
bool BasicTTI::isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
int64_t BaseOffset, bool HasBaseReg,
int64_t Scale) const {
TargetLowering::AddrMode AM;
TargetLoweringBase::AddrMode AM;
AM.BaseGV = BaseGV;
AM.BaseOffs = BaseOffset;
AM.HasBaseReg = HasBaseReg;