diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-12-17 22:06:08 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-12-17 22:06:08 +0000 |
commit | 426275b96d1d78c1903df4d4212269670d44acaf (patch) | |
tree | d8581a80971e71b23ccc9c832cda92e470cc7966 /llvm/lib/Target/Sparc | |
parent | b01a80aa94d3c5ca578eaf18985ef91476eb428f (diff) | |
download | bcm5719-llvm-426275b96d1d78c1903df4d4212269670d44acaf.tar.gz bcm5719-llvm-426275b96d1d78c1903df4d4212269670d44acaf.zip |
Doxygenified some comments, reduced extraneous space.
llvm-svn: 10501
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r-- | llvm/lib/Target/Sparc/PreSelection.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/llvm/lib/Target/Sparc/PreSelection.cpp b/llvm/lib/Target/Sparc/PreSelection.cpp index 205ecd3145c..5bb9b2b3619 100644 --- a/llvm/lib/Target/Sparc/PreSelection.cpp +++ b/llvm/lib/Target/Sparc/PreSelection.cpp @@ -94,13 +94,11 @@ static GetElementPtrInst* getGlobalAddr(Value* ptr, Instruction& insertBefore) { : NULL; } - -// Wrapper on Constant::classof to use in find_if :-( +// Wrapper on Constant::classof to use in find_if inline static bool nonConstant(const Use& U) { return ! isa<Constant>(U); } - static Instruction* DecomposeConstantExpr(ConstantExpr* CE, Instruction& insertBefore) { @@ -177,15 +175,15 @@ PreSelection::visitOneOperand(Instruction &I, Value* Op, unsigned opNum, } } -// visitOperands() transforms individual operands of all instructions: -// -- Load "large" int constants into a virtual register. What is large -// depends on the type of instruction and on the target architecture. -// -- For any constants that cannot be put in an immediate field, -// load address into virtual register first, and then load the constant. -// -// firstOp and lastOp can be used to skip leading and trailing operands. -// If lastOp is 0, it defaults to #operands or #incoming Phi values. -// +/// visitOperands - transform individual operands of all instructions: +/// -- Load "large" int constants into a virtual register. What is large +/// depends on the type of instruction and on the target architecture. +/// -- For any constants that cannot be put in an immediate field, +/// load address into virtual register first, and then load the constant. +/// +/// firstOp and lastOp can be used to skip leading and trailing operands. +/// If lastOp is 0, it defaults to #operands or #incoming Phi values. +/// inline void PreSelection::visitOperands(Instruction &I, int firstOp) { // For any instruction other than PHI, copies go just before the instr. for (unsigned i = firstOp, e = I.getNumOperands(); i != e; ++i) @@ -205,15 +203,12 @@ void PreSelection::visitPHINode(PHINode &PN) { // do not call visitOperands! } - - // Common work for *all* instructions. This needs to be called explicitly // by other visit<InstructionType> functions. inline void PreSelection::visitInstruction(Instruction &I) { visitOperands(I); // Perform operand transformations } - // GetElementPtr instructions: check if pointer is a global void PreSelection::visitGetElementPtrInst(GetElementPtrInst &I) { Instruction* curI = &I; @@ -239,10 +234,8 @@ void PreSelection::visitCallInst(CallInst &I) { visitOperands(I, (/*firstOp=*/ I.getCalledFunction()? 1 : 0)); } -//===----------------------------------------------------------------------===// -// createPreSelectionPass - Public entrypoint for pre-selection pass -// and this file as a whole... -// +/// createPreSelectionPass - Public entry point for the PreSelection pass +/// FunctionPass* createPreSelectionPass(const TargetMachine &TM) { return new PreSelection(TM); } |