diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ConstantHoisting.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ConstantHoisting.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp index 4b53628e442..470e687a722 100644 --- a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp +++ b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp @@ -84,7 +84,7 @@ static cl::opt<bool> ConstHoistWithBlockFrequency( namespace { -/// \brief The constant hoisting pass. +/// The constant hoisting pass. class ConstantHoistingLegacyPass : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid @@ -127,7 +127,7 @@ FunctionPass *llvm::createConstantHoistingPass() { return new ConstantHoistingLegacyPass(); } -/// \brief Perform the constant hoisting optimization for the given function. +/// Perform the constant hoisting optimization for the given function. bool ConstantHoistingLegacyPass::runOnFunction(Function &Fn) { if (skipFunction(Fn)) return false; @@ -153,7 +153,7 @@ bool ConstantHoistingLegacyPass::runOnFunction(Function &Fn) { return MadeChange; } -/// \brief Find the constant materialization insertion point. +/// Find the constant materialization insertion point. Instruction *ConstantHoistingPass::findMatInsertPt(Instruction *Inst, unsigned Idx) const { // If the operand is a cast instruction, then we have to materialize the @@ -187,7 +187,7 @@ Instruction *ConstantHoistingPass::findMatInsertPt(Instruction *Inst, return IDom->getBlock()->getTerminator(); } -/// \brief Given \p BBs as input, find another set of BBs which collectively +/// Given \p BBs as input, find another set of BBs which collectively /// dominates \p BBs and have the minimal sum of frequencies. Return the BB /// set found in \p BBs. static void findBestInsertionSet(DominatorTree &DT, BlockFrequencyInfo &BFI, @@ -289,7 +289,7 @@ static void findBestInsertionSet(DominatorTree &DT, BlockFrequencyInfo &BFI, } } -/// \brief Find an insertion point that dominates all uses. +/// Find an insertion point that dominates all uses. SmallPtrSet<Instruction *, 8> ConstantHoistingPass::findConstantInsertionPoint( const ConstantInfo &ConstInfo) const { assert(!ConstInfo.RebasedConstants.empty() && "Invalid constant info entry."); @@ -335,7 +335,7 @@ SmallPtrSet<Instruction *, 8> ConstantHoistingPass::findConstantInsertionPoint( return InsertPts; } -/// \brief Record constant integer ConstInt for instruction Inst at operand +/// Record constant integer ConstInt for instruction Inst at operand /// index Idx. /// /// The operand at index Idx is not necessarily the constant integer itself. It @@ -375,7 +375,7 @@ void ConstantHoistingPass::collectConstantCandidates( } } -/// \brief Check the operand for instruction Inst at index Idx. +/// Check the operand for instruction Inst at index Idx. void ConstantHoistingPass::collectConstantCandidates( ConstCandMapType &ConstCandMap, Instruction *Inst, unsigned Idx) { Value *Opnd = Inst->getOperand(Idx); @@ -416,7 +416,7 @@ void ConstantHoistingPass::collectConstantCandidates( } } -/// \brief Scan the instruction for expensive integer constants and record them +/// Scan the instruction for expensive integer constants and record them /// in the constant candidate vector. void ConstantHoistingPass::collectConstantCandidates( ConstCandMapType &ConstCandMap, Instruction *Inst) { @@ -436,7 +436,7 @@ void ConstantHoistingPass::collectConstantCandidates( } // end of for all operands } -/// \brief Collect all integer constants in the function that cannot be folded +/// Collect all integer constants in the function that cannot be folded /// into an instruction itself. void ConstantHoistingPass::collectConstantCandidates(Function &Fn) { ConstCandMapType ConstCandMap; @@ -541,7 +541,7 @@ ConstantHoistingPass::maximizeConstantsInRange(ConstCandVecType::iterator S, return NumUses; } -/// \brief Find the base constant within the given range and rebase all other +/// Find the base constant within the given range and rebase all other /// constants with respect to the base constant. void ConstantHoistingPass::findAndMakeBaseConstant( ConstCandVecType::iterator S, ConstCandVecType::iterator E) { @@ -567,7 +567,7 @@ void ConstantHoistingPass::findAndMakeBaseConstant( ConstantVec.push_back(std::move(ConstInfo)); } -/// \brief Finds and combines constant candidates that can be easily +/// Finds and combines constant candidates that can be easily /// rematerialized with an add from a common base constant. void ConstantHoistingPass::findBaseConstants() { // Sort the constants by value and type. This invalidates the mapping! @@ -601,7 +601,7 @@ void ConstantHoistingPass::findBaseConstants() { findAndMakeBaseConstant(MinValItr, ConstCandVec.end()); } -/// \brief Updates the operand at Idx in instruction Inst with the result of +/// Updates the operand at Idx in instruction Inst with the result of /// instruction Mat. If the instruction is a PHI node then special /// handling for duplicate values form the same incoming basic block is /// required. @@ -629,7 +629,7 @@ static bool updateOperand(Instruction *Inst, unsigned Idx, Instruction *Mat) { return true; } -/// \brief Emit materialization code for all rebased constants and update their +/// Emit materialization code for all rebased constants and update their /// users. void ConstantHoistingPass::emitBaseConstants(Instruction *Base, Constant *Offset, @@ -702,7 +702,7 @@ void ConstantHoistingPass::emitBaseConstants(Instruction *Base, } } -/// \brief Hoist and hide the base constant behind a bitcast and emit +/// Hoist and hide the base constant behind a bitcast and emit /// materialization code for derived constants. bool ConstantHoistingPass::emitBaseConstants() { bool MadeChange = false; @@ -765,7 +765,7 @@ bool ConstantHoistingPass::emitBaseConstants() { return MadeChange; } -/// \brief Check all cast instructions we made a copy of and remove them if they +/// Check all cast instructions we made a copy of and remove them if they /// have no more users. void ConstantHoistingPass::deleteDeadCastInst() const { for (auto const &I : ClonedCastMap) @@ -773,7 +773,7 @@ void ConstantHoistingPass::deleteDeadCastInst() const { I.first->eraseFromParent(); } -/// \brief Optimize expensive integer constants in the given function. +/// Optimize expensive integer constants in the given function. bool ConstantHoistingPass::runImpl(Function &Fn, TargetTransformInfo &TTI, DominatorTree &DT, BlockFrequencyInfo *BFI, BasicBlock &Entry) { |