LLVM API Documentation
#include <ScalarEvolutionExpander.h>
Clients should create an instance of this class when rewriting is needed, and destroy it when finished to allow the release of the associated memory.
Definition at line 29 of file ScalarEvolutionExpander.h.
| llvm::SCEVExpander::SCEVExpander | ( | ScalarEvolution & | se, | |
| LoopInfo & | li | |||
| ) | [inline] |
Definition at line 39 of file ScalarEvolutionExpander.h.
| LoopInfo& llvm::SCEVExpander::getLoopInfo | ( | ) | const [inline] |
| void llvm::SCEVExpander::clear | ( | ) | [inline] |
clear - Erase the contents of the InsertedExpressions map so that users trying to expand the same expression into multiple BasicBlocks or different places within the same BasicBlock can do so.
Definition at line 46 of file ScalarEvolutionExpander.h.
References InsertedExpressions.
| bool llvm::SCEVExpander::isInsertedInstruction | ( | Instruction * | I | ) | const [inline] |
isInsertedInstruction - Return true if the specified instruction was inserted by the code rewriter. If so, the client should not modify the instruction.
Definition at line 51 of file ScalarEvolutionExpander.h.
References InsertedInstructions.
| Value* llvm::SCEVExpander::getOrInsertCanonicalInductionVariable | ( | const Loop * | L, | |
| const Type * | Ty | |||
| ) | [inline] |
getOrInsertCanonicalInductionVariable - This method returns the canonical induction variable of the specified type for the specified loop (inserting one if there is none). A canonical induction variable starts at zero and steps by one on each iteration.
Definition at line 59 of file ScalarEvolutionExpander.h.
References expand(), llvm::ScalarEvolution::getAddRecExpr(), llvm::ScalarEvolution::getIntegerSCEV(), H, llvm::Type::isInteger(), and SE.
Referenced by visitAddRecExpr().
| void llvm::SCEVExpander::addInsertedValue | ( | Instruction * | I, | |
| SCEV * | S | |||
| ) | [inline] |
addInsertedValue - Remember the specified instruction as being the canonical form for the specified SCEV.
Definition at line 68 of file ScalarEvolutionExpander.h.
References InsertedExpressions, and InsertedInstructions.
| Instruction* llvm::SCEVExpander::getInsertionPoint | ( | ) | const [inline] |
| Value * SCEVExpander::expandCodeFor | ( | SCEVHandle | SH, | |
| Instruction * | IP | |||
| ) |
expandCodeFor - Insert code to directly compute the specified SCEV expression into the program. The inserted code is inserted into the specified block.
Definition at line 278 of file ScalarEvolutionExpander.cpp.
| Value * SCEVExpander::InsertCastOfTo | ( | Instruction::CastOps | opcode, | |
| Value * | V, | |||
| const Type * | Ty | |||
| ) | [static] |
InsertCastOfTo - Insert a cast of V to the specified type, doing what we can to share the casts.
InsertCastOfTo - Insert a cast of V to the specified type, doing what we can to share the casts.
Definition at line 22 of file ScalarEvolutionExpander.cpp.
References A, llvm::CallingConv::C, llvm::CastInst::Create(), E, llvm::ConstantExpr::getCast(), llvm::Value::getName(), II, llvm::Value::use_begin(), and llvm::Value::use_end().
| Value * SCEVExpander::InsertBinop | ( | Instruction::BinaryOps | Opcode, | |
| Value * | LHS, | |||
| Value * | RHS, | |||
| Instruction * | InsertPt | |||
| ) | [static] |
InsertBinop - Insert the specified binary operator, doing a small amount of work to avoid inserting an obviously redundant operation.
InsertBinop - Insert the specified binary operator, doing a small amount of work to avoid inserting an obviously redundant operation.
Definition at line 75 of file ScalarEvolutionExpander.cpp.
References llvm::BasicBlock::begin(), llvm::BinaryOperator::Create(), llvm::ConstantExpr::get(), and llvm::Instruction::getParent().
Referenced by visitAddExpr(), visitAddRecExpr(), visitMulExpr(), and visitUDivExpr().
Definition at line 284 of file ScalarEvolutionExpander.cpp.
References InsertedExpressions, V, and llvm::SCEVVisitor< SC, RetVal >::visit().
Referenced by expandCodeFor(), getOrInsertCanonicalInductionVariable(), visitAddExpr(), visitAddRecExpr(), visitMulExpr(), visitSignExtendExpr(), visitSMaxExpr(), visitTruncateExpr(), visitUDivExpr(), visitUMaxExpr(), and visitZeroExtendExpr().
| Value* llvm::SCEVExpander::visitConstant | ( | SCEVConstant * | S | ) | [inline, protected] |
| Value * SCEVExpander::visitTruncateExpr | ( | SCEVTruncateExpr * | S | ) | [protected] |
Definition at line 243 of file ScalarEvolutionExpander.cpp.
References llvm::CastInst::CreateTruncOrBitCast(), expand(), llvm::SCEVTruncateExpr::getOperand(), llvm::SCEVTruncateExpr::getType(), InsertPt, and V.
| Value * SCEVExpander::visitZeroExtendExpr | ( | SCEVZeroExtendExpr * | S | ) | [protected] |
Definition at line 248 of file ScalarEvolutionExpander.cpp.
References llvm::CastInst::CreateZExtOrBitCast(), expand(), llvm::SCEVZeroExtendExpr::getOperand(), llvm::SCEVZeroExtendExpr::getType(), InsertPt, and V.
| Value * SCEVExpander::visitSignExtendExpr | ( | SCEVSignExtendExpr * | S | ) | [protected] |
Definition at line 253 of file ScalarEvolutionExpander.cpp.
References llvm::CastInst::CreateSExtOrBitCast(), expand(), llvm::SCEVSignExtendExpr::getOperand(), llvm::SCEVSignExtendExpr::getType(), InsertPt, and V.
| Value * SCEVExpander::visitAddExpr | ( | SCEVAddExpr * | S | ) | [protected] |
Definition at line 102 of file ScalarEvolutionExpander.cpp.
References Add(), expand(), llvm::SCEVCommutativeExpr::getNumOperands(), llvm::SCEVCommutativeExpr::getOperand(), InsertBinop(), InsertPt, and V.
| Value * SCEVExpander::visitMulExpr | ( | SCEVMulExpr * | S | ) | [protected] |
Definition at line 112 of file ScalarEvolutionExpander.cpp.
References expand(), llvm::Constant::getNullValue(), llvm::SCEVCommutativeExpr::getNumOperands(), llvm::SCEVCommutativeExpr::getOperand(), llvm::Value::getType(), InsertBinop(), InsertPt, and V.
| Value * SCEVExpander::visitUDivExpr | ( | SCEVUDivExpr * | S | ) | [protected] |
Definition at line 132 of file ScalarEvolutionExpander.cpp.
References expand(), llvm::ConstantInt::get(), llvm::SCEVUDivExpr::getLHS(), llvm::SCEVUDivExpr::getRHS(), llvm::SCEVUDivExpr::getType(), InsertBinop(), InsertPt, llvm::APInt::isPowerOf2(), LHS, llvm::APInt::logBase2(), LShr, and RHS.
| Value * SCEVExpander::visitAddRecExpr | ( | SCEVAddRecExpr * | S | ) | [protected] |
Definition at line 146 of file ScalarEvolutionExpander.cpp.
References Add(), llvm::PHINode::addIncoming(), llvm::BasicBlock::begin(), llvm::LoopBase< BlockT >::contains(), llvm::PHINode::Create(), llvm::SCEVAddRecExpr::evaluateAtIteration(), expand(), F, llvm::ConstantInt::get(), llvm::ScalarEvolution::getAddRecExpr(), llvm::LoopBase< BlockT >::getHeader(), llvm::ScalarEvolution::getIntegerSCEV(), llvm::SCEVAddRecExpr::getLoop(), llvm::LoopInfo::getLoopFor(), llvm::LoopBase< BlockT >::getLoopPreheader(), llvm::Constant::getNullValue(), llvm::SCEVAddRecExpr::getOperand(), getOrInsertCanonicalInductionVariable(), llvm::Instruction::getParent(), llvm::LoopBase< BlockT >::getParentLoop(), llvm::SCEVAddRecExpr::getStart(), llvm::BasicBlock::getTerminator(), llvm::SCEVAddRecExpr::getType(), llvm::ScalarEvolution::getUnknown(), Header, InsertBinop(), InsertPt, llvm::SCEVAddRecExpr::isAffine(), llvm::Type::isInteger(), llvm::LoopBase< BlockT >::isLoopInvariant(), L, LI, llvm::SCEVAddRecExpr::op_begin(), llvm::SCEVAddRecExpr::op_end(), PI, llvm::pred_begin(), llvm::pred_end(), SE, Start, Ty, and V.
| Value * SCEVExpander::visitSMaxExpr | ( | SCEVSMaxExpr * | S | ) | [protected] |
Definition at line 258 of file ScalarEvolutionExpander.cpp.
References llvm::SelectInst::Create(), expand(), llvm::SCEVCommutativeExpr::getNumOperands(), llvm::SCEVCommutativeExpr::getOperand(), llvm::CmpInst::ICMP_SGT, InsertPt, LHS, and RHS.
| Value * SCEVExpander::visitUMaxExpr | ( | SCEVUMaxExpr * | S | ) | [protected] |
Definition at line 268 of file ScalarEvolutionExpander.cpp.
References llvm::SelectInst::Create(), expand(), llvm::SCEVCommutativeExpr::getNumOperands(), llvm::SCEVCommutativeExpr::getOperand(), llvm::CmpInst::ICMP_UGT, InsertPt, LHS, and RHS.
| Value* llvm::SCEVExpander::visitUnknown | ( | SCEVUnknown * | S | ) | [inline, protected] |
friend struct SCEVVisitor< SCEVExpander, Value * > [friend] |
Definition at line 37 of file ScalarEvolutionExpander.h.
Definition at line 30 of file ScalarEvolutionExpander.h.
Referenced by getOrInsertCanonicalInductionVariable(), and visitAddRecExpr().
Definition at line 31 of file ScalarEvolutionExpander.h.
Referenced by getLoopInfo(), and visitAddRecExpr().
| std::map<SCEVHandle, Value*> llvm::SCEVExpander::InsertedExpressions |
Definition at line 32 of file ScalarEvolutionExpander.h.
Referenced by addInsertedValue(), clear(), and expand().
Definition at line 33 of file ScalarEvolutionExpander.h.
Referenced by addInsertedValue(), and isInsertedInstruction().
Definition at line 35 of file ScalarEvolutionExpander.h.
Referenced by expandCodeFor(), getInsertionPoint(), visitAddExpr(), visitAddRecExpr(), visitMulExpr(), visitSignExtendExpr(), visitSMaxExpr(), visitTruncateExpr(), visitUDivExpr(), visitUMaxExpr(), and visitZeroExtendExpr().