mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
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:
parent
3e40d927a7
commit
69e42dbd00
@ -25,6 +25,7 @@ namespace llvm {
|
||||
class MachineFunctionPass;
|
||||
class PassInfo;
|
||||
class PassManagerBase;
|
||||
class TargetLoweringBase;
|
||||
class TargetLowering;
|
||||
class TargetRegisterClass;
|
||||
class raw_ostream;
|
||||
@ -284,7 +285,8 @@ namespace llvm {
|
||||
///
|
||||
/// This pass implements the target transform info analysis using the target
|
||||
/// independent information available to the LLVM code generator.
|
||||
ImmutablePass *createBasicTargetTransformInfoPass(const TargetLowering *TLI);
|
||||
ImmutablePass *
|
||||
createBasicTargetTransformInfoPass(const TargetLoweringBase *TLI);
|
||||
|
||||
/// createUnreachableBlockEliminationPass - The LLVM code generator does not
|
||||
/// work well with unreachable basic blocks (what live ranges make sense for a
|
||||
@ -481,7 +483,7 @@ namespace llvm {
|
||||
|
||||
/// createStackProtectorPass - This pass adds stack protectors to functions.
|
||||
///
|
||||
FunctionPass *createStackProtectorPass(const TargetLowering *tli);
|
||||
FunctionPass *createStackProtectorPass(const TargetLoweringBase *tli);
|
||||
|
||||
/// createMachineVerifierPass - This pass verifies cenerated machine code
|
||||
/// instructions for correctness.
|
||||
@ -495,7 +497,7 @@ namespace llvm {
|
||||
/// createSjLjEHPreparePass - This pass adapts exception handling code to use
|
||||
/// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
|
||||
///
|
||||
FunctionPass *createSjLjEHPreparePass(const TargetLowering *tli);
|
||||
FunctionPass *createSjLjEHPreparePass(const TargetLoweringBase *tli);
|
||||
|
||||
/// LocalStackSlotAllocation - This pass assigns local frame indices to stack
|
||||
/// slots relative to one another and allocates base registers to access them
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
|
@ -9,8 +9,8 @@ add_llvm_library(LLVMCodeGen
|
||||
CodeGen.cpp
|
||||
CodePlacementOpt.cpp
|
||||
CriticalAntiDepBreaker.cpp
|
||||
DeadMachineInstructionElim.cpp
|
||||
DFAPacketizer.cpp
|
||||
DeadMachineInstructionElim.cpp
|
||||
DwarfEHPrepare.cpp
|
||||
EarlyIfConversion.cpp
|
||||
EdgeBundles.cpp
|
||||
@ -32,21 +32,20 @@ add_llvm_library(LLVMCodeGen
|
||||
LiveInterval.cpp
|
||||
LiveIntervalAnalysis.cpp
|
||||
LiveIntervalUnion.cpp
|
||||
LiveRangeCalc.cpp
|
||||
LiveRangeEdit.cpp
|
||||
LiveRegMatrix.cpp
|
||||
LiveStackAnalysis.cpp
|
||||
LiveVariables.cpp
|
||||
LiveRangeCalc.cpp
|
||||
LiveRangeEdit.cpp
|
||||
LocalStackSlotAllocation.cpp
|
||||
MachineBasicBlock.cpp
|
||||
MachineBlockFrequencyInfo.cpp
|
||||
MachineBlockPlacement.cpp
|
||||
MachineBranchProbabilityInfo.cpp
|
||||
MachineCSE.cpp
|
||||
MachineCodeEmitter.cpp
|
||||
MachineCopyPropagation.cpp
|
||||
MachineCSE.cpp
|
||||
MachineDominators.cpp
|
||||
MachinePostDominators.cpp
|
||||
MachineFunction.cpp
|
||||
MachineFunctionAnalysis.cpp
|
||||
MachineFunctionPass.cpp
|
||||
@ -58,6 +57,7 @@ add_llvm_library(LLVMCodeGen
|
||||
MachineModuleInfo.cpp
|
||||
MachineModuleInfoImpls.cpp
|
||||
MachinePassRegistry.cpp
|
||||
MachinePostDominators.cpp
|
||||
MachineRegisterInfo.cpp
|
||||
MachineSSAUpdater.cpp
|
||||
MachineScheduler.cpp
|
||||
@ -91,16 +91,17 @@ add_llvm_library(LLVMCodeGen
|
||||
ShrinkWrapping.cpp
|
||||
SjLjEHPrepare.cpp
|
||||
SlotIndexes.cpp
|
||||
Spiller.cpp
|
||||
SpillPlacement.cpp
|
||||
Spiller.cpp
|
||||
SplitKit.cpp
|
||||
StackColoring.cpp
|
||||
StackProtector.cpp
|
||||
StackSlotColoring.cpp
|
||||
StackColoring.cpp
|
||||
StrongPHIElimination.cpp
|
||||
TailDuplication.cpp
|
||||
TargetFrameLoweringImpl.cpp
|
||||
TargetInstrInfo.cpp
|
||||
TargetLoweringBase.cpp
|
||||
TargetLoweringObjectFileImpl.cpp
|
||||
TargetOptionsImpl.cpp
|
||||
TargetRegisterInfo.cpp
|
||||
|
@ -33,7 +33,7 @@ STATISTIC(NumResumesLowered, "Number of resume calls lowered");
|
||||
namespace {
|
||||
class DwarfEHPrepare : public FunctionPass {
|
||||
const TargetMachine *TM;
|
||||
const TargetLowering *TLI;
|
||||
const TargetLoweringBase *TLI;
|
||||
|
||||
// RewindFunction - _Unwind_Resume or the target equivalent.
|
||||
Constant *RewindFunction;
|
||||
|
@ -151,7 +151,7 @@ namespace {
|
||||
/// basic block number.
|
||||
std::vector<BBInfo> BBAnalysis;
|
||||
|
||||
const TargetLowering *TLI;
|
||||
const TargetLoweringBase *TLI;
|
||||
const TargetInstrInfo *TII;
|
||||
const TargetRegisterInfo *TRI;
|
||||
const InstrItineraryData *InstrItins;
|
||||
|
@ -171,7 +171,7 @@ class MachineBlockPlacement : public MachineFunctionPass {
|
||||
const TargetInstrInfo *TII;
|
||||
|
||||
/// \brief A handle to the target's lowering info.
|
||||
const TargetLowering *TLI;
|
||||
const TargetLoweringBase *TLI;
|
||||
|
||||
/// \brief Allocator and owner of BlockChain structures.
|
||||
///
|
||||
|
@ -62,7 +62,7 @@ namespace {
|
||||
class MachineLICM : public MachineFunctionPass {
|
||||
const TargetMachine *TM;
|
||||
const TargetInstrInfo *TII;
|
||||
const TargetLowering *TLI;
|
||||
const TargetLoweringBase *TLI;
|
||||
const TargetRegisterInfo *TRI;
|
||||
const MachineFrameInfo *MFI;
|
||||
MachineRegisterInfo *MRI;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -43,7 +43,7 @@ STATISTIC(NumSpilled, "Number of registers live across unwind edges");
|
||||
|
||||
namespace {
|
||||
class SjLjEHPrepare : public FunctionPass {
|
||||
const TargetLowering *TLI;
|
||||
const TargetLoweringBase *TLI;
|
||||
Type *FunctionContextTy;
|
||||
Constant *RegisterFn;
|
||||
Constant *UnregisterFn;
|
||||
@ -58,7 +58,7 @@ namespace {
|
||||
AllocaInst *FuncCtx;
|
||||
public:
|
||||
static char ID; // Pass identification, replacement for typeid
|
||||
explicit SjLjEHPrepare(const TargetLowering *tli = NULL)
|
||||
explicit SjLjEHPrepare(const TargetLoweringBase *tli = NULL)
|
||||
: FunctionPass(ID), TLI(tli) { }
|
||||
bool doInitialization(Module &M);
|
||||
bool runOnFunction(Function &F);
|
||||
@ -82,7 +82,7 @@ namespace {
|
||||
char SjLjEHPrepare::ID = 0;
|
||||
|
||||
// Public Interface To the SjLjEHPrepare pass.
|
||||
FunctionPass *llvm::createSjLjEHPreparePass(const TargetLowering *TLI) {
|
||||
FunctionPass *llvm::createSjLjEHPreparePass(const TargetLoweringBase *TLI) {
|
||||
return new SjLjEHPrepare(TLI);
|
||||
}
|
||||
// doInitialization - Set up decalarations and types needed to process
|
||||
|
@ -36,7 +36,7 @@ namespace {
|
||||
class StackProtector : public FunctionPass {
|
||||
/// TLI - Keep a pointer of a TargetLowering to consult for determining
|
||||
/// target type sizes.
|
||||
const TargetLowering *TLI;
|
||||
const TargetLoweringBase *TLI;
|
||||
|
||||
Function *F;
|
||||
Module *M;
|
||||
@ -68,7 +68,7 @@ namespace {
|
||||
StackProtector() : FunctionPass(ID), TLI(0) {
|
||||
initializeStackProtectorPass(*PassRegistry::getPassRegistry());
|
||||
}
|
||||
StackProtector(const TargetLowering *tli)
|
||||
StackProtector(const TargetLoweringBase *tli)
|
||||
: FunctionPass(ID), TLI(tli) {
|
||||
initializeStackProtectorPass(*PassRegistry::getPassRegistry());
|
||||
}
|
||||
@ -85,7 +85,7 @@ char StackProtector::ID = 0;
|
||||
INITIALIZE_PASS(StackProtector, "stack-protector",
|
||||
"Insert stack protectors", false, false)
|
||||
|
||||
FunctionPass *llvm::createStackProtectorPass(const TargetLowering *tli) {
|
||||
FunctionPass *llvm::createStackProtectorPass(const TargetLoweringBase *tli) {
|
||||
return new StackProtector(tli);
|
||||
}
|
||||
|
||||
|
1274
lib/CodeGen/TargetLoweringBase.cpp
Normal file
1274
lib/CodeGen/TargetLoweringBase.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user