mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 03:30:37 +00:00
Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
78cb3f218a
commit
4c080863de
@ -28,6 +28,11 @@ class TargetMachine;
|
||||
//
|
||||
extern const PassInfo *PHIEliminationID;
|
||||
|
||||
// TwoAddressInstruction pass - This pass reduces two-address
|
||||
// instructions to use two operands. This destroys SSA information but
|
||||
// it is desired by register allocators.
|
||||
extern const PassInfo *TwoAddressInstructionPassID;
|
||||
|
||||
/// Creates a register allocator as the user specified on the command
|
||||
/// line.
|
||||
FunctionPass *createRegisterAllocator();
|
||||
|
@ -1,51 +0,0 @@
|
||||
//===-- llvm/CodeGen/TwoAddressInstructionPass.h - Two-Address instruction pass -*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file was developed by the LLVM research group and is distributed under
|
||||
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the Two-Address instruction rewriter pass. In
|
||||
// some architectures instructions have a combined source/destination
|
||||
// operand. In those cases the instruction cannot have three operands
|
||||
// as the destination is implicit (for example ADD %EAX, %EBX on the
|
||||
// IA-32). After code generation this restrictions are not handled and
|
||||
// instructions may have three operands. This pass remedies this and
|
||||
// reduces all two-address instructions to two operands.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CODEGEN_TWOADDRESSINSTRUCTIONPASS_H
|
||||
#define LLVM_CODEGEN_TWOADDRESSINSTRUCTIONPASS_H
|
||||
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class LiveVariables;
|
||||
class MRegisterInfo;
|
||||
|
||||
class TwoAddressInstructionPass : public MachineFunctionPass
|
||||
{
|
||||
private:
|
||||
MachineFunction* mf_;
|
||||
const TargetMachine* tm_;
|
||||
const MRegisterInfo* mri_;
|
||||
LiveVariables* lv_;
|
||||
|
||||
public:
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||
|
||||
private:
|
||||
/// runOnMachineFunction - pass entry point
|
||||
bool runOnMachineFunction(MachineFunction&);
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
@ -24,7 +24,6 @@
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/CodeGen/SSARegMap.h"
|
||||
#include "llvm/CodeGen/TwoAddressInstructionPass.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@ -50,7 +49,7 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const
|
||||
AU.addRequired<LiveVariables>();
|
||||
AU.addPreservedID(PHIEliminationID);
|
||||
AU.addRequiredID(PHIEliminationID);
|
||||
AU.addRequired<TwoAddressInstructionPass>();
|
||||
AU.addRequiredID(TwoAddressInstructionPassID);
|
||||
MachineFunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "llvm/CodeGen/SSARegMap.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/LiveVariables.h"
|
||||
#include "llvm/CodeGen/TwoAddressInstructionPass.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "Support/CommandLine.h"
|
||||
@ -113,7 +112,7 @@ namespace {
|
||||
if (!DisableKill)
|
||||
AU.addRequired<LiveVariables>();
|
||||
AU.addRequiredID(PHIEliminationID);
|
||||
AU.addRequired<TwoAddressInstructionPass>();
|
||||
AU.addRequiredID(TwoAddressInstructionPassID);
|
||||
MachineFunctionPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define DEBUG_TYPE "twoaddrinstr"
|
||||
#include "llvm/CodeGen/TwoAddressInstructionPass.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/CodeGen/LiveVariables.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
@ -36,7 +35,23 @@
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
RegisterAnalysis<TwoAddressInstructionPass> X(
|
||||
class TwoAddressInstructionPass : public MachineFunctionPass
|
||||
{
|
||||
private:
|
||||
MachineFunction* mf_;
|
||||
const TargetMachine* tm_;
|
||||
const MRegisterInfo* mri_;
|
||||
LiveVariables* lv_;
|
||||
|
||||
public:
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||
|
||||
private:
|
||||
/// runOnMachineFunction - pass entry point
|
||||
bool runOnMachineFunction(MachineFunction&);
|
||||
};
|
||||
|
||||
RegisterPass<TwoAddressInstructionPass> X(
|
||||
"twoaddressinstruction", "Two-Address instruction pass");
|
||||
|
||||
Statistic<> numTwoAddressInstrs("twoaddressinstruction",
|
||||
@ -45,6 +60,8 @@ namespace {
|
||||
"Number of instructions added");
|
||||
};
|
||||
|
||||
const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
|
||||
|
||||
void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const
|
||||
{
|
||||
AU.addPreserved<LiveVariables>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user