OpenASIP
2.0
|
#include <LLVMTCEBuilder.hh>
Classes | |
struct | ConstantDataDef |
Data definition structure for constant pool values. More... | |
struct | DataDef |
Data definition structure for global values. More... | |
Public Member Functions | |
LLVMTCEBuilder (char &ID) | |
LLVMTCEBuilder (const TargetMachine &tm, TTAMachine::Machine *mach, char &ID, bool functionAtATime=false) | |
virtual | ~LLVMTCEBuilder () |
TTAProgram::Program * | result () |
TTAProgram::Instruction * | firstInstructionOfBasicBlock (const llvm::BasicBlock *bb) |
bool | isProgramUsingRestrictedPointers () const |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
virtual bool | isTTATarget () const |
void | deleteDeadProcedures () |
void | setInitialStackPointerValue (unsigned value) |
Static Public Attributes | |
static char | ID = 0 |
Protected Member Functions | |
bool | doInitialization (Module &M) |
bool | runOnMachineFunction (MachineFunction &MF) |
bool | doFinalization (Module &M) |
bool | hasAmbiguousASpaceRefs (const TTAProgram::Instruction &instr) const |
virtual bool | writeMachineFunction (MachineFunction &MF) |
void | initDataSections () |
std::shared_ptr< TTAProgram::Move > | createMove (const MachineOperand &src, const MachineOperand &dst, TTAProgram::MoveGuard *guard) |
const TargetMachine & | targetMachine () const |
virtual unsigned | spDRegNum () const =0 |
virtual unsigned | raPortDRegNum () const =0 |
virtual TCEString | registerFileName (unsigned llvmRegNum) const =0 |
virtual int | registerIndex (unsigned llvmRegNum) const =0 |
TCEString | registerName (unsigned llvmRegNum) const |
virtual TCEString | operationName (const MachineInstr &mi) const =0 |
virtual TTAProgram::Terminal * | createFUTerminal (const MachineOperand &) const |
std::string | mbbName (const MachineBasicBlock &mbb) |
const TTAMachine::HWOperation & | getHWOperation (std::string opName) |
TTAProgram::TerminalRegister * | createTerminalRegister (const std::string &rfName, int index) |
TTAProgram::Terminal * | createTerminal (const MachineOperand &mo, int bitLimit=0) |
std::shared_ptr< TTAProgram::Move > | createMove (TTAProgram::Terminal *src, TTAProgram::Terminal *dst, const TTAMachine::Bus &bus, TTAProgram::MoveGuard *guard=NULL) |
void | emitConstantPool (const llvm::MachineConstantPool &cp) |
virtual TTAProgram::Terminal * | createMBBReference (const MachineOperand &mo) |
virtual TTAProgram::Terminal * | createSymbolReference (const MachineOperand &mo) |
virtual TTAProgram::Terminal * | createProgramOperationReference (const MachineOperand &mo) |
virtual TTAProgram::Terminal * | createSymbolReference (const TCEString &symbolName) |
TTAProgram::Instruction * | emitInstruction (const MachineInstr *mi, TTAProgram::CodeSnippet *proc) |
virtual TTAProgram::Instruction * | emitMove (const MachineInstr *mi, TTAProgram::CodeSnippet *proc, bool conditional=false, bool trueGuard=true) |
TTAProgram::Instruction * | emitInlineAsm (const MachineFunction &mf, const MachineInstr *mi, TTAProgram::BasicBlock *bb, TTAProgram::InstructionReferenceManager &irm) |
void | fixProgramOperationReferences () |
void | addLabelForProgramOperation (TCEString label, ProgramOperationPtr po) |
virtual void | emitSPInitialization () |
void | emitSPInitialization (TTAProgram::CodeSnippet &target) |
void | clearFunctionBookkeeping () |
Static Protected Member Functions | |
static bool | isInlineAsm (const MachineInstr &instr) |
Protected Attributes | |
std::map< std::string, TTAProgram::Instruction * > | codeLabels_ |
Code labels. More... | |
TTAMachine::Machine * | mach_ |
Machine for building the program. More... | |
const llvm::TargetMachine * | tm_ |
Target machine description. More... | |
llvm::Mangler * | mang_ |
Mangler for mangling label strings. More... | |
TTAProgram::Program * | prog_ |
Current program being built. More... | |
std::set< std::string > | opset_ |
The operations supported by the current target machine. More... | |
bool | functionAtATime_ |
PRegionMarkerAnalyzer * | pregions_ |
int | spillMoveCount_ |
unsigned | initialStackPointerValue_ |
MachineFrameInfo * | curFrameInfo_ |
LLVMTCECmdLineOptions * | options_ = nullptr |
The compiler options. More... | |
Private Types | |
typedef std::map< TTAMachine::AddressSpace *, TTAProgram::DataMemory * > | DataMemIndex |
Private Attributes | |
llvm::Module * | mod_ |
TTAMachine::AddressSpace * | instrAddressSpace_ |
TTAMachine::AddressSpace * | defaultDataAddressSpace_ |
The default data memory address space (address space 0). More... | |
bool | multiDataMemMachine_ |
Set to true in case this machine has more than one data address spaces. More... | |
DataMemIndex | dmemIndex_ |
std::vector< DataDef > | data_ |
Data definitions. More... | |
std::vector< DataDef > | udata_ |
std::vector< ConstantDataDef > | cpData_ |
std::map< std::string, TTAProgram::Instruction * > | mbbs_ |
Machine basic block -> first instruction in the BB map. More... | |
std::map< const llvm::BasicBlock *, TTAProgram::Instruction * > | bbIndex_ |
Basic Block -> first instruction in the BB map. More... | |
std::map< std::string, unsigned > | dataLabels_ |
Data labels. More... | |
std::map< TTAProgram::TerminalInstructionAddress *, std::string > | codeLabelReferences_ |
Dummy code label references that have to be fixed after all instrutions have been built. More... | |
std::map< TTAProgram::TerminalInstructionAddress *, std::string > | mbbReferences_ |
Dummy basic block references that have to be fixed after all basic blocks have been built. More... | |
std::vector< std::shared_ptr< TTAProgram::Move > > | endReferences_ |
Dummy references to the _end symbol. More... | |
std::map< const llvm::Constant *, unsigned > | globalCP_ |
Global constant pool for all constants gathered from machine functions. Map key is unique constant and the value is address of the constant. More... | |
std::map< unsigned, unsigned > | currentFnCP_ |
Constant pool for the current machine function. Map key is constant pool index and the value is address. More... | |
std::map< TTAMachine::AddressSpace *, unsigned > | dataEnds_ |
The first position after the last data in the given address space. More... | |
bool | noAliasFound_ |
set to true in case at least one 'noalias' attribute (from the use of 'restricted' pointers) has been found More... | |
bool | multiAddrSpacesFound_ |
set to true in case at least one non-default address space memory access has been found in the generated code More... | |
std::vector< MachineFunction * > | functions_ |
List of machine functions collected from runForMachineFunction. More... | |
bool | dataInitialized_ |
std::set< TTAProgram::TerminalProgramOperation * > | symbolicPORefs_ |
std::map< TCEString, ProgramOperationPtr > | labeledPOs_ |
const llvm::DataLayout * | dl_ |
The data layout for the machine. More... | |
Static Private Attributes | |
static unsigned | MAU_BITS = 8 |
Target architechture MAU size in bits. More... | |
static unsigned | POINTER_SIZE_32 = 4 |
Target architecture pointer size in maus. More... | |
static unsigned | POINTER_SIZE_64 = 8 |
Base class for the various LLVM to TCE builder implementations.
Definition at line 102 of file LLVMTCEBuilder.hh.
|
private |
Definition at line 299 of file LLVMTCEBuilder.hh.
LLVMTCEBuilder::LLVMTCEBuilder | ( | char & | ID | ) |
Definition at line 167 of file LLVMTCEBuilder.cc.
References initMembers().
LLVMTCEBuilder::LLVMTCEBuilder | ( | const TargetMachine & | tm, |
TTAMachine::Machine * | mach, | ||
char & | ID, | ||
bool | functionAtATime = false |
||
) |
Definition at line 154 of file LLVMTCEBuilder.cc.
References dl_, functionAtATime_, initMembers(), mach_, and tm_.
|
virtual |
|
private |
Adds annotations to the given move that limit the choice of the load-store unit to only those that support the given address space.
Definition at line 3830 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::AnnotatedInstructionElement::addAnnotation(), TTAMachine::FunctionUnit::addressSpace(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAProgram::Move::destination(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::FunctionUnit::hasAddressSpace(), TTAMachine::AddressSpace::hasNumericalId(), TTAMachine::FunctionUnit::hasOperation(), TTAProgram::Terminal::isFUPort(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), mach_, TTAMachine::Component::name(), TTAProgram::Move::source(), TTAProgram::Move::toString(), and Application::verboseLevel().
Referenced by addPointerAnnotations().
|
inlineprotected |
Definition at line 222 of file LLVMTCEBuilder.hh.
References labeledPOs_.
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG().
|
private |
Adds annotations to a pointer-register move to assist the TCE-side alias analysis.
Note: this function now assumes that mi has only one address operand.
TODO: this is not very optimal, it gets the offset info only for the memory accesses to function argument pointers?
FIXME: this is not correct, especially when the above offset info is set!
Definition at line 1823 of file LLVMTCEBuilder.cc.
References TTAProgram::AnnotatedInstructionElement::addAnnotation(), addCandidateLSUAnnotations(), TTAProgram::ProgramAnnotation::ANN_CONSTANT_MEM, TTAProgram::ProgramAnnotation::ANN_PARALLEL_REGION_ID, TTAProgram::ProgramAnnotation::ANN_POINTER_ADDR_SPACE, TTAProgram::ProgramAnnotation::ANN_POINTER_NAME, TTAProgram::ProgramAnnotation::ANN_POINTER_OFFSET, TTAProgram::ProgramAnnotation::ANN_STACKUSE_SPILL, assert, curFrameInfo_, Application::logStream(), PRegionMarkerAnalyzer::markersFound(), multiAddrSpacesFound_, multiDataMemMachine_, noAliasFound_, PRegionMarkerAnalyzer::pregion(), pregions_, and TTAProgram::Move::toString().
Referenced by emitInstruction(), and emitOperationMacro().
|
private |
Definition at line 3765 of file LLVMTCEBuilder.cc.
References TTAMachine::Machine::addressSpaceNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), defaultDataAddressSpace_, TTAMachine::AddressSpace::hasNumericalId(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), mach_, and multiDataMemMachine_.
Referenced by createDataDefinition(), createFPDataDefinition(), createGlobalValueDataDefinition(), createIntDataDefinition(), createTerminal(), doFinalization(), emitConstantPool(), emitDataDef(), emitSPInitialization(), initDataSections(), and padToAlignment().
|
private |
|
inlineprotected |
Definition at line 231 of file LLVMTCEBuilder.hh.
References labeledPOs_, and symbolicPORefs_.
Referenced by llvm::LLVMTCEIRBuilder::writeMachineFunction().
|
private |
Definition at line 1797 of file LLVMTCEBuilder.cc.
References TTAProgram::AnnotatedInstructionElement::addAnnotation(), TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST, TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_SRC, TTAProgram::AnnotatedInstructionElement::annotation(), TTAProgram::AnnotatedInstructionElement::annotationCount(), TTAProgram::ProgramAnnotation::id(), and TTAProgram::ProgramAnnotation::payload().
Referenced by emitInstruction().
|
private |
|
private |
Creates POM data definition from a llvm data initializer.
addr | Address for the POM data. |
cv | Initializer for the data in llvm. |
forceInitialize | In case wanting to use initialization data even for null values. |
forceAlignment | Use the given alignment for the constant instead of the alignment defined in DataLayout. |
Definition at line 519 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::DataMemory::addDataDefinition(), addressSpaceById(), addressSpaceId(), createExprDataDefinition(), createFPDataDefinition(), createGlobalValueDataDefinition(), createIntDataDefinition(), dataMemoryForAddressSpace(), dl_, TTAMachine::Machine::isLittleEndian(), mach_, and padToAlignment().
Referenced by createExprDataDefinition(), and emitDataDef().
|
private |
Creates POM data definition from a llvm constant expression initializer.
addr | Address of the POM data definition. |
ce | Expression to create the data definition for. |
offset | Offset for an address defined by the expression. |
Definition at line 836 of file LLVMTCEBuilder.cc.
References addressSpaceId(), assert, createDataDefinition(), createGlobalValueDataDefinition(), createIntDataDefinition(), and dl_.
Referenced by createDataDefinition().
|
private |
Creates data definition of a floating point constant.
Definition at line 690 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::addDataDefinition(), addressSpaceById(), addressSpaceId(), assert, dataMemoryForAddressSpace(), dl_, TTAMachine::Machine::isLittleEndian(), mach_, TTAProgram::DataDefinition::size(), and TYPE_CONST.
Referenced by createDataDefinition().
|
inlineprotectedvirtual |
Reimplemented in llvm::LLVMTCEIRBuilder, llvm::LLVMPOMBuilder, and llvm::LLVMTCEPOMBuilder.
Definition at line 171 of file LLVMTCEBuilder.hh.
Referenced by createTerminal().
|
private |
Creates data definition for a global value reference.
addr | Address where the reference is to be defined. |
gv | Global value reference. |
Definition at line 785 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::addDataDefinition(), addressSpaceById(), addressSpaceId(), assert, codeLabels_, TTAProgram::InstructionReferenceManager::createReference(), dataLabels_, dataMemoryForAddressSpace(), dl_, TTAProgram::Program::instructionReferenceManager(), TTAMachine::Machine::isLittleEndian(), mach_, mang_, prog_, TTAProgram::DataDefinition::size(), and TYPE_CONST.
Referenced by createDataDefinition(), and createExprDataDefinition().
|
private |
Creates a register guard to given guard register.
Definition at line 3720 of file LLVMTCEBuilder.cc.
References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAProgram::TerminalRegister::index(), TTAMachine::Guard::isInverted(), TTAMachine::Machine::Navigator< ComponentType >::item(), mach_, TTAProgram::TerminalRegister::registerFile(), TTAMachine::RegisterGuard::registerFile(), and TTAMachine::RegisterGuard::registerIndex().
Referenced by emitInstruction(), emitMove(), and emitSelect().
|
private |
Creates data definition of a constant integer value.
addr | Address where the integer is to be defined. |
ci | Constant initializer for the integer value. |
Definition at line 634 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::addDataDefinition(), addressSpaceById(), addressSpaceId(), assert, dataMemoryForAddressSpace(), dl_, TTAMachine::Machine::is64bit(), TTAMachine::Machine::isLittleEndian(), mach_, MAU_BITS, POINTER_SIZE_32, POINTER_SIZE_64, and TTAProgram::DataDefinition::size().
Referenced by createDataDefinition(), and createExprDataDefinition().
|
protectedvirtual |
Reimplemented in llvm::LLVMTCEIRBuilder.
Definition at line 2288 of file LLVMTCEBuilder.cc.
References dummy, mbbName(), and mbbReferences_.
Referenced by createTerminal().
|
protected |
Creates POM instruction for a move.
src | The source operand. |
dst | The dst operand. |
Definition at line 2389 of file LLVMTCEBuilder.cc.
References assert, createTerminal(), UniversalMachine::instance(), TTAProgram::Terminal::port(), UniversalMachine::universalBus(), and TTAMachine::Port::width().
Referenced by emitComparisonForBranch(), emitInstruction(), llvm::LLVMTCEPOMBuilder::emitMove(), emitMove(), emitOperationMacro(), emitRemaingingBrach(), emitReturn(), emitSelect(), and emitSPInitialization().
|
protected |
Creates program object model move.
src | Source terminal of the move. |
dst | Destination terminal of the move. |
bus | Bus utilized to do the move. |
guard | Guard object for the move or NULL if the move is not guarded. |
Definition at line 3674 of file LLVMTCEBuilder.cc.
References endReferences_, TTAMachine::Machine::is64bit(), and mach_.
|
inlineprivatevirtual |
Reimplemented in llvm::LLVMTCEIRBuilder.
Definition at line 397 of file LLVMTCEBuilder.hh.
Referenced by emitComparisonForBranch(), emitGlobalXXtructorCalls(), emitInstruction(), emitRemaingingBrach(), and emitReturn().
|
protectedvirtual |
Definition at line 2260 of file LLVMTCEBuilder.cc.
References symbolicPORefs_.
Referenced by createTerminal().
|
private |
Creates instruction(s) to load initial stack pointer value.
Definition at line 3654 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeGenerator::loadTerminal(), and mach_.
Referenced by emitSPInitialization().
|
protectedvirtual |
NOTE: Hack to get code compiling even if llvm falsely makes libcalls to external functions even if they are found from currently lowered program.
http://llvm.org/bugs/show_bug.cgi?id=2673
Should be removed after fix is applied to llvm.. (maybe never...)
Definition at line 2298 of file LLVMTCEBuilder.cc.
Referenced by createTerminal().
|
protectedvirtual |
END OF HACK
Reimplemented in llvm::LLVMTCEIRBuilder.
Definition at line 2313 of file LLVMTCEBuilder.cc.
References codeLabelReferences_, dummy, and END_SYMBOL_NAME.
|
protected |
Creates a POM source terminal from an LLVM machine operand.
mo | LLVM machine operand. |
Definition at line 2149 of file LLVMTCEBuilder.cc.
References abortWithError, addressSpaceById(), assert, createFUTerminal(), createMBBReference(), createProgramOperationReference(), createSymbolReference(), createTerminalRegister(), currentFnCP_, dataLabels_, END_SYMBOL_NAME, functionAtATime_, UniversalMachine::instance(), TTAMachine::Machine::is64bit(), isTTATarget(), mach_, mang_, raPortDRegNum(), registerFileName(), and registerIndex().
Referenced by createMove(), emitComparisonForBranch(), emitInstruction(), emitLongjmp(), llvm::LLVMTCEPOMBuilder::emitMove(), emitMove(), emitOperationMacro(), emitReadSP(), emitRemaingingBrach(), emitReturnTo(), emitSelect(), emitSetjmp(), emitWriteSP(), and handleMemoryCategoryInfo().
|
protected |
Definition at line 2120 of file LLVMTCEBuilder.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), UniversalMachine::instance(), UniversalMachine::integerRegisterFile(), TTAMachine::Port::isOutput(), TTAMachine::Machine::Navigator< ComponentType >::item(), mach_, TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), and TTAMachine::Machine::registerFileNavigator().
Referenced by createTerminal().
|
private |
Returns the position after the highest written data symbol for the given address space.
Definition at line 3789 of file LLVMTCEBuilder.cc.
References assert, MapTools::containsKey(), dataEnds_, LLVMTCECmdLineOptions::dataStartAddress(), defaultDataAddressSpace_, LLVMTCECmdLineOptions::isDataStartAddressSet(), mach_, MachineInfo::maxMemoryAlignment(), options_, TTAMachine::AddressSpace::start(), and tm_.
Referenced by doFinalization(), emitConstantPool(), and initDataSections().
|
private |
Returns the "layout array" for the data memory of the given address space.
Definition at line 3816 of file LLVMTCEBuilder.cc.
References MapTools::containsKey(), and dmemIndex_.
Referenced by createDataDefinition(), createFPDataDefinition(), createGlobalValueDataDefinition(), createIntDataDefinition(), emitDataDef(), emitSPInitialization(), initDataSections(), and padToAlignment().
|
private |
Helper method that converts LLVM debug data markers to Move annotations.
Definition at line 2057 of file LLVMTCEBuilder.cc.
References TTAProgram::AnnotatedInstructionElement::addAnnotation(), TTAProgram::ProgramAnnotation::ANN_DEBUG_SOURCE_CODE_LINE, TTAProgram::ProgramAnnotation::ANN_STACKUSE_RA_SAVE, TTAProgram::ProgramAnnotation::ANN_STACKUSE_SPILL, TPEF::InstructionAnnotation::MAX_ANNOTATION_BYTES, TTAProgram::AnnotatedInstructionElement::setAnnotation(), and spillMoveCount_.
Referenced by emitInstruction(), and emitOperationMacro().
void LLVMTCEBuilder::deleteDeadProcedures | ( | ) |
Definition at line 1197 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::dataDefinition(), TTAProgram::Program::dataMemory(), TTAProgram::Program::dataMemoryCount(), TTAProgram::DataDefinition::destinationAddress(), Application::logStream(), TTAProgram::Program::procedure(), prog_, llvm::MachineDCE::removeableFunctions, TTAProgram::Program::removeProcedure(), TTAProgram::CodeSnippet::startAddress(), and Application::verboseLevel().
Referenced by LLVMBackend::compile().
|
protected |
Finalizes the POM building.
Creates data initializers. Fixes dummy code references to point the actual instructions.
Definition at line 1090 of file LLVMTCEBuilder.cc.
References TTAProgram::Scope::addDataLabel(), TTAProgram::Program::addDataMemory(), llvm::LLVMTCEBuilder::DataDef::address, addressSpaceById(), llvm::LLVMTCEBuilder::DataDef::addressSpaceId, llvm::LLVMTCEBuilder::DataDef::alignment, assert, codeLabelReferences_, codeLabels_, cpData_, TTAProgram::InstructionReferenceManager::createReference(), data_, dataEnd(), dataLabels_, POMDisassembler::disassemble(), dmemIndex_, emitDataDef(), emitSPInitialization(), END_SYMBOL_NAME, endReferences_, TTAProgram::Program::globalScope(), llvm::LLVMTCEBuilder::DataDef::initialize, TTAProgram::Program::instructionReferenceManager(), TTAMachine::Machine::is64bit(), mach_, mbbReferences_, mbbs_, llvm::LLVMTCEBuilder::DataDef::name, prog_, TTAProgram::Terminal::setInstructionReference(), llvm::LLVMTCEBuilder::DataDef::size, and udata_.
Referenced by llvm::LLVMPOMBuilder::doFinalization(), llvm::LLVMTCEIRBuilder::doFinalization(), and llvm::LLVMTCEPOMBuilder::doFinalization().
|
protected |
Initializer creates a new POM and adds all global data initializations.
m | Module to initialize the writer for. |
Definition at line 429 of file LLVMTCEBuilder.cc.
References dataInitialized_, and mod_.
Referenced by llvm::LLVMTCEIRBuilder::doInitialization(), and llvm::LLVMTCEPOMBuilder::doInitialization().
|
private |
Definition at line 1727 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), createMove(), createMoveNode(), createTerminal(), getHWOperation(), UniversalMachine::instance(), OperationPool::operation(), and UniversalMachine::universalBus().
Referenced by emitInstruction().
|
protected |
Reserves space and addresses for constant pool entries.
Data defitions are not emitted until in doFinalization() because CP values may refer to symbols not yet encountered such as functions and _end symbol.
The constant pool is appended to the end of the default data memory. FIXME: should be emitted before global data.
mcp | Constant pool to emit. |
Definition at line 2346 of file LLVMTCEBuilder.cc.
References addressSpaceById(), assert, cpData_, currentFnCP_, dataEnd(), dl_, globalCP_, and padToAlignment().
Referenced by llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
private |
Creates data definition from a Constant pool entry definition.
addr | Address where the data is to be defined in the data memory. |
cv | Constant initializer for the data. |
Definition at line 498 of file LLVMTCEBuilder.cc.
References llvm::LLVMTCEBuilder::ConstantDataDef::address, assert, createDataDefinition(), llvm::LLVMTCEBuilder::ConstantDataDef::size, and llvm::LLVMTCEBuilder::ConstantDataDef::value.
|
private |
Creates data definition from a Constant initializer and adds it to the machine data memory.
addr | Address where the data is to be defined in the data memory. |
cv | Constant initializer for the data. |
Definition at line 443 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::addDataDefinition(), llvm::LLVMTCEBuilder::DataDef::address, addressSpaceById(), llvm::LLVMTCEBuilder::DataDef::addressSpaceId, llvm::LLVMTCEBuilder::DataDef::alignment, assert, createDataDefinition(), dataMemoryForAddressSpace(), llvm::LLVMTCEBuilder::DataDef::initialize, TTAMachine::Machine::isLittleEndian(), mach_, mang_, mod_, llvm::LLVMTCEBuilder::DataDef::name, and llvm::LLVMTCEBuilder::DataDef::size.
Referenced by doFinalization().
|
private |
Constructs moves for calling all global constructors or destructors, if any.
mi | Machine instruction including the inline asm. |
proc | TTA procedure to append moves into. |
constructors | True, if emitting constructors, otherwise destructors. |
Definition at line 3486 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), assert, createMoveNode(), TTAProgram::CodeGenerator::createTerminalFUPort(), TTAMachine::NullInstructionTemplate::instance(), UniversalMachine::instance(), TTAProgram::CodeSnippet::lastInstruction(), mach_, mang_, mod_, OperationPool::operation(), and UniversalMachine::universalBus().
Referenced by emitSpecialInlineAsm().
|
protected |
Handles INLINEASM nodes that hold real inline assembly code.
This method should not be called for pseudo inline assembly - like TCE operation macros (see emitOperationMacro()).
Definition at line 2786 of file LLVMTCEBuilder.cc.
References assert, dataLabels_, InlineAsmParser::diagnostics(), getInlineAsmOperands(), getSourceLocationInfo(), getSourceLocationString(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), isInlineAsm(), mang_, options_, InlineAsmParser::parse(), LLVMTCECmdLineOptions::printInlineAsmWarnings(), llvm::TCETargetMachine::registerName(), THROW_EXCEPTION, tm_, and AssemblyParserDiagnostic::warnings().
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG().
|
protected |
Creates POM instructions from a LLVM MachineInstruction.
One POM instruction per Move are created.
mi | Machine instruction to emit to the POM. |
proc | POM procedure to append the instruction to. |
Definition at line 1322 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), addPointerAnnotations(), TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST, TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_SRC, TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_DST, TTAProgram::ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC, TTAProgram::ProgramAnnotation::ANN_STACKUSE_FP_SAVE, TTAProgram::ProgramAnnotation::ANN_STACKUSE_RA_SAVE, TTAProgram::ProgramAnnotation::ANN_STACKUSE_SPILL, assert, TTAProgram::MoveGuard::copy(), copyFUAnnotations(), createGuard(), createMove(), createMoveNode(), createTerminal(), debugDataToAnnotations(), emitComparisonForBranch(), emitMove(), emitOperationMacro(), emitRemaingingBrach(), emitReturn(), emitSelect(), TTAMachine::Machine::functionUnitNavigator(), getHWOperation(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), UniversalMachine::instance(), TTAMachine::Machine::is64bit(), Operand::isAddress(), Operation::isBaseOffsetMemOperation(), Operand::isInput(), Operand::isNull(), Operand::isOutput(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), mach_, TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), TTAProgram::Instruction::movePtr(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), Operation::operand(), OperationPool::operation(), operationName(), PRINT_VAR, targetMachine(), and UniversalMachine::universalBus().
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), and writeMachineFunction().
|
private |
|
private |
Constructs moves for ".longjmp"
mi | Machine instruction including the inline asm. |
proc | TTA procedure to emit moves into. |
Definition at line 3584 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeGenerator::addMoveToProcedure(), assert, TTAMachine::Machine::Navigator< ComponentType >::count(), createTerminal(), TTAProgram::CodeGenerator::createTerminalRegister(), TTAProgram::CodeGenerator::incrementStackPointer(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAProgram::CodeGenerator::loadFromRegisterAddress(), mach_, TTAMachine::Component::name(), TTAMachine::BaseRegisterFile::numberOfRegisters(), TTAProgram::CodeGenerator::popRegisterFromStack(), TTAProgram::CodeGenerator::pushToStack(), registerFileName(), TTAMachine::Machine::registerFileNavigator(), registerIndex(), TTAProgram::CodeGenerator::registerJump(), and spDRegNum().
Referenced by emitSpecialInlineAsm().
|
protectedvirtual |
Creates POM instruction for a move.
mi | Move machine instruction. |
proc | POM procedure to add the move to. |
Reimplemented in llvm::LLVMTCEPOMBuilder.
Definition at line 2418 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), TTAProgram::CodeGenerator::addMoveToProcedure(), assert, createGuard(), createMove(), createTerminal(), getHWOperation(), TTAMachine::Machine::hasOperation(), TTAProgram::Terminal::index(), UniversalMachine::instance(), TTAMachine::Machine::is64bit(), TTAProgram::Terminal::isGPR(), Application::logStream(), mach_, TTAMachine::Component::name(), TTAProgram::Terminal::port(), TTAMachine::Unit::portCount(), TTAProgram::Terminal::registerFile(), THROW_EXCEPTION, UniversalMachine::universalBus(), and TTAMachine::Port::width().
Referenced by emitInstruction(), and llvm::LLVMTCEPOMBuilder::emitMove().
|
private |
Handles operation macros which too uses INLINEASM nodes.
Here the inline assembly string is expected to be just a name of a (custom) operation. Operation operands are expected to be listed as the inline assembly use and def registers. Architecture specific pseudo assembly constructs are also supported (they start with dot) and are delegated to emitSpecialInlineAsm().
Definition at line 2860 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), addPointerAnnotations(), TTAMachine::FunctionUnit::addressSpace(), addressSpaceId(), TTAMachine::Machine::addressSpaceNavigator(), TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST, TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_SRC, assert, StringTools::containsChar(), TTAMachine::Machine::Navigator< ComponentType >::count(), createMove(), createTerminal(), debugDataToAnnotations(), emitSpecialInlineAsm(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::AddressSpace::hasNumericalId(), UniversalFunctionUnit::hasOperation(), UniversalMachine::instance(), Operand::isAddress(), TTAMachine::Machine::Navigator< ComponentType >::item(), mach_, TTAMachine::Component::name(), Operation::operand(), UniversalFunctionUnit::operation(), OperationPool::operation(), TTAMachine::HWOperation::pipeline(), TTAMachine::ExecutionPipeline::readOperands(), UniversalMachine::universalBus(), UniversalMachine::universalFunctionUnit(), and TTAMachine::ExecutionPipeline::writtenOperands().
Referenced by emitInstruction().
|
private |
Emits moves to read the stack pointer value.
Definition at line 3207 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::CodeGenerator::addMoveToProcedure(), createTerminal(), TTAProgram::CodeGenerator::createTerminalRegister(), TTAProgram::CodeSnippet::lastInstruction(), mach_, TTAProgram::CodeSnippet::nextInstruction(), registerFileName(), registerIndex(), and spDRegNum().
Referenced by emitSpecialInlineAsm().
|
private |
Definition at line 1765 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), createMove(), createMoveNode(), createTerminal(), getHWOperation(), UniversalMachine::instance(), OperationPool::operation(), and UniversalMachine::universalBus().
Referenced by emitInstruction().
|
private |
Creates POM instructions for a return.
mi | Return machine instruction. |
proc | POM procedure to add the return to. |
Definition at line 2530 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), TTAMachine::Machine::controlUnit(), createMove(), createMoveNode(), UniversalMachine::instance(), OperationPool::operation(), TTAMachine::FunctionUnit::operation(), and UniversalMachine::universalBus().
Referenced by emitInstruction().
|
private |
Emits moves that overwrite the RA and return to that address.
Definition at line 3244 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::CodeGenerator::addMoveToProcedure(), createTerminal(), TTAProgram::CodeGenerator::createTerminalRegister(), TTAProgram::CodeSnippet::lastInstruction(), mach_, TTAProgram::CodeSnippet::nextInstruction(), and TTAProgram::CodeGenerator::registerJump().
Referenced by emitSpecialInlineAsm().
|
private |
Creates POM instructions for a select.
mi | select machine instruction. |
proc | POM procedure to add the select to. |
Definition at line 2561 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::addMove(), assert, createGuard(), createMove(), createTerminal(), TTAProgram::Terminal::equals(), UniversalMachine::instance(), and UniversalMachine::universalBus().
Referenced by emitInstruction().
|
private |
Constructs moves for ".setjmp"
mi | Machine instruction including the inline asm. |
proc | TTA procedure to emit moves into. |
Definition at line 3375 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::CodeGenerator::addMoveToProcedure(), assert, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAProgram::InstructionReferenceManager::createReference(), createTerminal(), TTAProgram::CodeGenerator::createTerminalRegister(), TTAProgram::CodeGenerator::decrementStackPointer(), TTAProgram::CodeGenerator::incrementStackPointer(), TTAMachine::NullInstructionTemplate::instance(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Program::instructionReferenceManager(), TTAMachine::Machine::is64bit(), TTAMachine::Machine::Navigator< ComponentType >::item(), mach_, TTAMachine::Component::name(), TTAMachine::BaseRegisterFile::numberOfRegisters(), TTAProgram::CodeGenerator::popFromStack(), TTAProgram::CodeGenerator::popRegisterFromStack(), prog_, TTAProgram::CodeGenerator::pushInstructionReferenceToStack(), TTAProgram::CodeGenerator::pushRegisterToStack(), TTAProgram::CodeGenerator::pushToStack(), registerFileName(), TTAMachine::Machine::registerFileNavigator(), registerIndex(), spDRegNum(), and TTAProgram::CodeGenerator::storeToAddress().
Referenced by emitSpecialInlineAsm().
|
private |
Constructs moves for architecture-dependant special asm.
op | Assembly instruction string. |
mi | Machine instruction including the inline asm. |
proc | TTA procedure to emit moves into. |
Definition at line 3156 of file LLVMTCEBuilder.cc.
References abortWithError, assert, debugLog, emitGlobalXXtructorCalls(), emitLongjmp(), emitReadSP(), emitReturnTo(), emitSetjmp(), emitWriteSP(), handleMemoryCategoryInfo(), and TCEString::startsWith().
Referenced by emitOperationMacro().
|
protectedvirtual |
Emit stack pointer initialization move to the begining of the program.
Reimplemented in llvm::LLVMTCEIRBuilder.
Definition at line 2669 of file LLVMTCEBuilder.cc.
References TTAProgram::Program::firstInstruction(), TTAProgram::Instruction::parent(), and prog_.
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), and doFinalization().
|
protected |
Definition at line 2679 of file LLVMTCEBuilder.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::DataMemory::addDataDefinition(), TTAProgram::Instruction::addMove(), addressSpaceById(), TTAProgram::CodeSnippet::append(), assert, MachineInfo::canEncodeImmediateInteger(), createMove(), createSPInitLoad(), dataMemoryForAddressSpace(), TTAMachine::AddressSpace::end(), TTAProgram::CodeSnippet::firstInstruction(), TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAProgram::InstructionReferenceManager::hasReference(), initialStackPointerValue_, TTAProgram::CodeSnippet::insertBefore(), UniversalMachine::instance(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Program::instructionReferenceManager(), TTAMachine::Machine::is64bit(), TTAMachine::Machine::isLittleEndian(), TTAMachine::Port::isOutput(), TTAMachine::Machine::Navigator< ComponentType >::item(), mach_, TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), prog_, registerFileName(), TTAMachine::Machine::registerFileNavigator(), registerIndex(), TTAProgram::InstructionReferenceManager::replace(), spDRegNum(), llvm::TCETargetMachine::stackAlignment(), tm_, and UniversalMachine::universalBus().
|
private |
|
private |
Emits moves to write the stack pointer value.
Definition at line 3275 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::CodeGenerator::addMoveToProcedure(), assert, createTerminal(), TTAProgram::CodeGenerator::createTerminalRegister(), TTAProgram::CodeSnippet::lastInstruction(), Application::logStream(), mach_, TTAProgram::CodeSnippet::nextInstruction(), llvm::TCETargetMachine::registerIndex(), llvm::TCETargetMachine::rfName(), llvm::TCETargetMachine::spDRegNum(), and tm_.
Referenced by emitSpecialInlineAsm().
|
inline |
Definition at line 119 of file LLVMTCEBuilder.hh.
References bbIndex_.
|
protected |
Fixes the symbolic ProgramOperation references to point to the now created real ProgramOperations.
Assumes the POs are found in the label index.
Definition at line 2276 of file LLVMTCEBuilder.cc.
References assert, TTAProgram::TerminalProgramOperation::isProgramOperationKnown(), TTAProgram::TerminalProgramOperation::label(), labeledPOs_, TTAProgram::TerminalProgramOperation::setProgramOperation(), and symbolicPORefs_.
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG().
|
inlinevirtual |
Reimplemented in llvm::LLVMTCEIRBuilder.
Definition at line 125 of file LLVMTCEBuilder.hh.
Referenced by llvm::LLVMTCEIRBuilder::getAnalysisUsage().
|
private |
|
protected |
Definition at line 1288 of file LLVMTCEBuilder.cc.
References abortWithError, TTAMachine::Machine::controlUnit(), UniversalMachine::instance(), TTAMachine::FunctionUnit::operation(), opset_, StringTools::stringToLower(), and UniversalMachine::universalFunctionUnit().
Referenced by emitComparisonForBranch(), emitInstruction(), emitMove(), and emitRemaingingBrach().
|
private |
Handles the .pointer_category pseudo assembler instruction.
First argument is a string defining the category, second refers to the pointer.
Definition at line 3318 of file LLVMTCEBuilder.cc.
References abortWithError, TTAProgram::CodeGenerator::addMoveToProcedure(), createTerminal(), TTAProgram::CodeSnippet::lastInstruction(), Application::logStream(), mach_, and TTAProgram::CodeSnippet::nextInstruction().
Referenced by emitSpecialInlineAsm().
|
protected |
Checks that the potential memory operations triggered in the given unscheduled instruction (with exactly one move) have unambiguous address space.
This should be called as a sanity check for instructions in a program (and a machine) with multiple address spaces. Returns true in case the instruction has at least one move that refers to memory without the address space information being unambiguous in the currently targeted machine.
Definition at line 1259 of file LLVMTCEBuilder.cc.
References TTAProgram::ProgramAnnotation::ANN_ALLOWED_UNIT_DST, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAProgram::Move::destination(), TTAMachine::Machine::functionUnitNavigator(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), TTAMachine::FunctionUnit::hasOperation(), TTAProgram::Terminal::hintOperation(), Operand::isAddress(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isRA(), TTAMachine::Machine::Navigator< ComponentType >::item(), mach_, TTAProgram::Instruction::move(), Operation::operand(), and TTAProgram::Terminal::operationIndex().
Referenced by writeMachineFunction().
|
protected |
Initializes the data sections of the POM.
Can be called multiple times. Doesn't do anything after the first successful call.
Definition at line 210 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::addDataDefinition(), TTAProgram::Scope::addDataLabel(), llvm::LLVMTCEBuilder::DataDef::address, TTAMachine::FunctionUnit::addressSpace(), addressSpaceById(), llvm::LLVMTCEBuilder::DataDef::addressSpaceId, addressSpaceId(), TTAMachine::Machine::addressSpaceNavigator(), llvm::LLVMTCEBuilder::DataDef::alignment, assert, TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), data_, dataEnd(), dataInitialized_, dataLabels_, dataMemoryForAddressSpace(), defaultDataAddressSpace_, dl_, END_SYMBOL_NAME, TTAMachine::Machine::functionUnitNavigator(), TTAProgram::Program::globalScope(), llvm::LLVMTCEBuilder::DataDef::initialize, instrAddressSpace_, isInitialized(), TTAMachine::Machine::isLittleEndian(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), mach_, mang_, mod_, multiDataMemMachine_, TTAMachine::HWOperation::name(), TTAMachine::Component::name(), llvm::LLVMTCEBuilder::DataDef::name, TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), opset_, prog_, llvm::LLVMTCEBuilder::DataDef::size, llvm::TCETargetMachine::stackAlignment(), StringTools::stringToLower(), tm_, TYPE_CONST, udata_, and Application::verboseLevel().
Referenced by llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
private |
Definition at line 172 of file LLVMTCEBuilder.cc.
References Application::cmdLineOptions(), dataInitialized_, initialStackPointerValue_, mach_, mang_, mod_, multiAddrSpacesFound_, multiDataMemMachine_, noAliasFound_, options_, prog_, spillMoveCount_, and tm_.
Referenced by LLVMTCEBuilder().
|
private |
|
private |
Returns true if the Constant value structure has initialized data.
cv | Initializer to check. |
Definition at line 2648 of file LLVMTCEBuilder.cc.
Referenced by initDataSections().
|
staticprotected |
Returns true if the instruction is real inline asm aka. holds moves.
Returns false if instruction is not inline asm. This also return false for operation macros (_TCE_OP(...)) that also use inline asm statements in C code.
instr | The instruction. |
Definition at line 3908 of file LLVMTCEBuilder.cc.
References InlineAsmParser::isInlineAsm().
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), and emitInlineAsm().
|
inline |
Definition at line 123 of file LLVMTCEBuilder.hh.
References noAliasFound_.
Referenced by LLVMBackend::compile().
|
inlinevirtual |
Definition at line 132 of file LLVMTCEBuilder.hh.
References targetMachine().
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), createTerminal(), llvm::LLVMTCEIRBuilder::raPortDRegNum(), llvm::LLVMTCEIRBuilder::registerFileName(), and llvm::LLVMTCEIRBuilder::registerIndex().
|
protected |
Returns string identifier for a basic block.
These identifiers are used for the BB -> POM instruction book keeping.
mbb | Basic block object. |
Definition at line 2632 of file LLVMTCEBuilder.cc.
References mang_, and Conversion::toString().
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), createMBBReference(), and writeMachineFunction().
|
protectedpure virtual |
Implemented in llvm::LLVMTCEIRBuilder, llvm::LLVMPOMBuilder, and llvm::LLVMTCEPOMBuilder.
Referenced by emitInstruction().
|
private |
Pads data memory with zeroes until desired alignment is reached.
Zero padding is only added when necessary. That is the address is already aligned.
addressSpaceId | The address space id. |
addr | The current address, which is updated to the desired alignment after the call. |
align | The desired alignment. |
Definition at line 917 of file LLVMTCEBuilder.cc.
References TTAProgram::DataMemory::addDataDefinition(), addressSpaceById(), addressSpaceId(), dataMemoryForAddressSpace(), TTAMachine::Machine::isLittleEndian(), and mach_.
Referenced by createDataDefinition(), and emitConstantPool().
|
protectedpure virtual |
Implemented in llvm::LLVMTCEIRBuilder, llvm::LLVMTCEPOMBuilder, and llvm::LLVMPOMBuilder.
Referenced by createTerminal().
|
protectedpure virtual |
Implemented in llvm::LLVMTCEIRBuilder, llvm::LLVMPOMBuilder, and llvm::LLVMTCEPOMBuilder.
Referenced by createTerminal(), emitLongjmp(), emitReadSP(), emitSetjmp(), and emitSPInitialization().
|
protectedpure virtual |
Implemented in llvm::LLVMTCEIRBuilder, llvm::LLVMPOMBuilder, and llvm::LLVMTCEPOMBuilder.
Referenced by createTerminal(), emitLongjmp(), emitReadSP(), emitSetjmp(), and emitSPInitialization().
|
protected |
TTAProgram::Program * LLVMTCEBuilder::result | ( | ) |
Returns the program built during the pass.
NotAvailable | If program is not ready. |
Definition at line 3713 of file LLVMTCEBuilder.cc.
References prog_.
Referenced by LLVMBackend::compile(), and llvm::LLVMTCEPOMBuilder::emitMove().
|
protected |
Creates POM procedure of a MachineFunction object and adds it to the current program.
mf | MachineFunction to process. |
Definition at line 947 of file LLVMTCEBuilder.cc.
References writeMachineFunction().
void LLVMTCEBuilder::setInitialStackPointerValue | ( | unsigned | value | ) |
Sets the value the stack pointer should be initialized to.
Definition at line 1240 of file LLVMTCEBuilder.cc.
References initialStackPointerValue_.
Referenced by LLVMBackend::compile().
|
protectedpure virtual |
Implemented in llvm::LLVMTCEIRBuilder, llvm::LLVMTCEPOMBuilder, and llvm::LLVMPOMBuilder.
Referenced by emitLongjmp(), emitReadSP(), emitSetjmp(), and emitSPInitialization().
|
inlineprotected |
Definition at line 157 of file LLVMTCEBuilder.hh.
References tm_.
Referenced by llvm::LLVMTCEPOMBuilder::createFUTerminal(), emitInstruction(), llvm::LLVMTCEPOMBuilder::emitMove(), isTTATarget(), llvm::LLVMPOMBuilder::operationName(), llvm::LLVMTCEIRBuilder::operationName(), llvm::LLVMPOMBuilder::raPortDRegNum(), llvm::LLVMTCEIRBuilder::raPortDRegNum(), llvm::LLVMPOMBuilder::registerFileName(), llvm::LLVMTCEIRBuilder::registerFileName(), llvm::LLVMPOMBuilder::registerIndex(), llvm::LLVMTCEIRBuilder::registerIndex(), llvm::LLVMPOMBuilder::spDRegNum(), and llvm::LLVMTCEIRBuilder::spDRegNum().
|
protectedvirtual |
Writes machine function to POM.
Actually does things to MachineFunction which was supposed to be done in runOnMachineFunction, but which cannot be done during that, because MachineDCE is not ready yet at that time...
Reimplemented in llvm::LLVMTCEIRBuilder.
Definition at line 959 of file LLVMTCEBuilder.cc.
References TTAProgram::Procedure::add(), TTAProgram::Scope::addCodeLabel(), TTAProgram::Program::addProcedure(), assert, bbIndex_, codeLabels_, MapTools::containsKey(), curFrameInfo_, emitConstantPool(), emitInstruction(), TTAProgram::Program::globalScope(), hasAmbiguousASpaceRefs(), initDataSections(), instrAddressSpace_, Application::logStream(), mang_, mbbName(), mbbs_, multiDataMemMachine_, prog_, spillMoveCount_, tm_, TTAProgram::Instruction::toString(), and Application::verboseLevel().
Referenced by runOnMachineFunction().
|
private |
Basic Block -> first instruction in the BB map.
Definition at line 451 of file LLVMTCEBuilder.hh.
Referenced by firstInstructionOfBasicBlock(), and writeMachineFunction().
|
private |
Dummy code label references that have to be fixed after all instrutions have been built.
Definition at line 459 of file LLVMTCEBuilder.hh.
Referenced by createSymbolReference(), and doFinalization().
|
protected |
Code labels.
Definition at line 239 of file LLVMTCEBuilder.hh.
Referenced by createGlobalValueDataDefinition(), doFinalization(), llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
private |
Definition at line 445 of file LLVMTCEBuilder.hh.
Referenced by doFinalization(), and emitConstantPool().
|
protected |
Definition at line 265 of file LLVMTCEBuilder.hh.
Referenced by addPointerAnnotations(), llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
private |
Constant pool for the current machine function. Map key is constant pool index and the value is address.
Definition at line 476 of file LLVMTCEBuilder.hh.
Referenced by createTerminal(), and emitConstantPool().
|
private |
Data definitions.
Definition at line 443 of file LLVMTCEBuilder.hh.
Referenced by doFinalization(), and initDataSections().
|
private |
The first position after the last data in the given address space.
Definition at line 479 of file LLVMTCEBuilder.hh.
Referenced by dataEnd().
|
private |
Definition at line 495 of file LLVMTCEBuilder.hh.
Referenced by doInitialization(), initDataSections(), and initMembers().
|
private |
Data labels.
Definition at line 454 of file LLVMTCEBuilder.hh.
Referenced by createGlobalValueDataDefinition(), createTerminal(), doFinalization(), emitInlineAsm(), and initDataSections().
|
private |
The default data memory address space (address space 0).
Definition at line 430 of file LLVMTCEBuilder.hh.
Referenced by addressSpaceById(), dataEnd(), and initDataSections().
|
private |
The data layout for the machine.
Definition at line 502 of file LLVMTCEBuilder.hh.
Referenced by createDataDefinition(), createExprDataDefinition(), createFPDataDefinition(), createGlobalValueDataDefinition(), createIntDataDefinition(), emitConstantPool(), initDataSections(), and LLVMTCEBuilder().
|
private |
Definition at line 440 of file LLVMTCEBuilder.hh.
Referenced by dataMemoryForAddressSpace(), and doFinalization().
|
private |
Dummy references to the _end symbol.
Definition at line 468 of file LLVMTCEBuilder.hh.
Referenced by createMove(), and doFinalization().
|
protected |
Definition at line 257 of file LLVMTCEBuilder.hh.
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), llvm::LLVMTCEIRBuilder::compileOptimized(), createTerminal(), LLVMTCEBuilder(), llvm::LLVMTCEIRBuilder::LLVMTCEIRBuilder(), and llvm::LLVMTCEIRBuilder::writeMachineFunction().
|
private |
List of machine functions collected from runForMachineFunction.
Definition at line 493 of file LLVMTCEBuilder.hh.
|
private |
Global constant pool for all constants gathered from machine functions. Map key is unique constant and the value is address of the constant.
Definition at line 473 of file LLVMTCEBuilder.hh.
Referenced by emitConstantPool().
|
static |
Definition at line 105 of file LLVMTCEBuilder.hh.
|
protected |
Definition at line 263 of file LLVMTCEBuilder.hh.
Referenced by emitSPInitialization(), initMembers(), and setInitialStackPointerValue().
|
private |
Definition at line 427 of file LLVMTCEBuilder.hh.
Referenced by initDataSections(), and writeMachineFunction().
|
private |
Definition at line 499 of file LLVMTCEBuilder.hh.
Referenced by addLabelForProgramOperation(), clearFunctionBookkeeping(), and fixProgramOperationReferences().
|
protected |
Machine for building the program.
Definition at line 242 of file LLVMTCEBuilder.hh.
Referenced by addCandidateLSUAnnotations(), addressSpaceById(), llvm::LLVMTCEIRBuilder::compileFast(), llvm::LLVMTCEIRBuilder::compileOptimized(), createDataDefinition(), createFPDataDefinition(), llvm::LLVMTCEPOMBuilder::createFUTerminal(), createGlobalValueDataDefinition(), createGuard(), createIntDataDefinition(), createMove(), createSPInitLoad(), createTerminal(), createTerminalRegister(), dataEnd(), llvm::LLVMTCEIRBuilder::doFinalization(), doFinalization(), llvm::LLVMTCEPOMBuilder::doInitialization(), emitDataDef(), emitGlobalXXtructorCalls(), emitInstruction(), emitLongjmp(), emitMove(), emitOperationMacro(), emitReadSP(), emitReturnTo(), emitSetjmp(), emitSPInitialization(), emitWriteSP(), handleMemoryCategoryInfo(), hasAmbiguousASpaceRefs(), initDataSections(), initMembers(), LLVMTCEBuilder(), padToAlignment(), llvm::LLVMTCEIRBuilder::registerFileName(), llvm::LLVMTCEIRBuilder::scheduler(), and llvm::LLVMTCEIRBuilder::writeMachineFunction().
|
protected |
Mangler for mangling label strings.
Definition at line 247 of file LLVMTCEBuilder.hh.
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), createGlobalValueDataDefinition(), createTerminal(), emitDataDef(), emitGlobalXXtructorCalls(), emitInlineAsm(), initDataSections(), initMembers(), llvm::LLVMTCEIRBuilder::isHotFunction(), mbbName(), llvm::LLVMTCEIRBuilder::writeMachineFunction(), writeMachineFunction(), and ~LLVMTCEBuilder().
|
staticprivate |
Target architechture MAU size in bits.
Definition at line 419 of file LLVMTCEBuilder.hh.
Referenced by createIntDataDefinition().
|
private |
Dummy basic block references that have to be fixed after all basic blocks have been built.
Definition at line 465 of file LLVMTCEBuilder.hh.
Referenced by createMBBReference(), and doFinalization().
|
private |
Machine basic block -> first instruction in the BB map.
Definition at line 448 of file LLVMTCEBuilder.hh.
Referenced by doFinalization(), and writeMachineFunction().
|
private |
Definition at line 425 of file LLVMTCEBuilder.hh.
Referenced by doInitialization(), emitDataDef(), emitGlobalXXtructorCalls(), initDataSections(), and initMembers().
|
private |
set to true in case at least one non-default address space memory access has been found in the generated code
Definition at line 490 of file LLVMTCEBuilder.hh.
Referenced by addPointerAnnotations(), and initMembers().
|
private |
Set to true in case this machine has more than one data address spaces.
Definition at line 434 of file LLVMTCEBuilder.hh.
Referenced by addPointerAnnotations(), addressSpaceById(), initDataSections(), initMembers(), and writeMachineFunction().
|
private |
set to true in case at least one 'noalias' attribute (from the use of 'restricted' pointers) has been found
Definition at line 487 of file LLVMTCEBuilder.hh.
Referenced by addPointerAnnotations(), initMembers(), and isProgramUsingRestrictedPointers().
|
protected |
The operations supported by the current target machine.
Definition at line 253 of file LLVMTCEBuilder.hh.
Referenced by getHWOperation(), initDataSections(), and llvm::LLVMTCEIRBuilder::LLVMTCEIRBuilder().
|
protected |
The compiler options.
Definition at line 268 of file LLVMTCEBuilder.hh.
Referenced by dataEnd(), emitInlineAsm(), initMembers(), llvm::LLVMTCEIRBuilder::isHotFunction(), llvm::LLVMTCEIRBuilder::LLVMTCEIRBuilder(), and llvm::LLVMTCEIRBuilder::writeMachineFunction().
|
staticprivate |
Target architecture pointer size in maus.
Definition at line 422 of file LLVMTCEBuilder.hh.
Referenced by createIntDataDefinition().
|
staticprivate |
Definition at line 423 of file LLVMTCEBuilder.hh.
Referenced by createIntDataDefinition().
|
protected |
Definition at line 259 of file LLVMTCEBuilder.hh.
Referenced by addPointerAnnotations(), and llvm::LLVMTCEIRBuilder::buildTCECFG().
|
protected |
Current program being built.
Definition at line 250 of file LLVMTCEBuilder.hh.
Referenced by llvm::LLVMTCEIRBuilder::buildTCECFG(), createGlobalValueDataDefinition(), deleteDeadProcedures(), llvm::LLVMTCEIRBuilder::doFinalization(), llvm::LLVMTCEPOMBuilder::doFinalization(), doFinalization(), emitSetjmp(), emitSPInitialization(), initDataSections(), initMembers(), result(), llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
protected |
Definition at line 261 of file LLVMTCEBuilder.hh.
Referenced by debugDataToAnnotations(), initMembers(), llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
private |
Definition at line 497 of file LLVMTCEBuilder.hh.
Referenced by clearFunctionBookkeeping(), createProgramOperationReference(), and fixProgramOperationReferences().
|
protected |
Target machine description.
Definition at line 245 of file LLVMTCEBuilder.hh.
Referenced by dataEnd(), emitInlineAsm(), emitSPInitialization(), emitWriteSP(), initDataSections(), initMembers(), LLVMTCEBuilder(), targetMachine(), llvm::LLVMTCEIRBuilder::writeMachineFunction(), and writeMachineFunction().
|
private |
Definition at line 444 of file LLVMTCEBuilder.hh.
Referenced by doFinalization(), and initDataSections().