Skip to content

Commit da94dcc

Browse files
committed
Add/update comments
1 parent faa7f87 commit da94dcc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

llvm/include/llvm/Transforms/Utils/Local.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ LLVM_ABI unsigned replaceDominatedUsesWith(Value *From, Value *To,
452452
LLVM_ABI unsigned replaceDominatedUsesWith(Value *From, Value *To,
453453
DominatorTree &DT,
454454
const BasicBlock *BB);
455+
/// Replace each use of 'From' with 'To' if that use is dominated by the
456+
/// given instruction. Returns the number of replacements made.
455457
LLVM_ABI unsigned replaceDominatedUsesWith(Value *From, Value *To,
456458
DominatorTree &DT,
457459
const Instruction *I);
@@ -467,7 +469,9 @@ LLVM_ABI unsigned replaceDominatedUsesWithIf(
467469
LLVM_ABI unsigned replaceDominatedUsesWithIf(
468470
Value *From, Value *To, DominatorTree &DT, const BasicBlock *BB,
469471
function_ref<bool(const Use &U, const Value *To)> ShouldReplace);
470-
472+
/// Replace each use of 'From' with 'To' if that use is dominated by
473+
/// the given instruction and the callback ShouldReplace returns true. Returns
474+
/// the number of replacements made.
471475
LLVM_ABI unsigned replaceDominatedUsesWithIf(
472476
Value *From, Value *To, DominatorTree &DT, const Instruction *I,
473477
function_ref<bool(const Use &U, const Value *To)> ShouldReplace);

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,8 +2444,8 @@ void GVNPass::assignBlockRPONumber(Function &F) {
24442444
/// The given values are known to be equal in every use
24452445
/// dominated by 'Root'. Exploit this, for example by replacing 'LHS' with
24462446
/// 'RHS' everywhere in the scope. Returns whether a change was made.
2447-
/// If DominatesByEdge is false, then it means that we will propagate the RHS
2448-
/// value starting from the end of Root.Start.
2447+
/// The Root may either be a basic block edge (for conditions) or an
2448+
/// instruction (for assumes).
24492449
bool GVNPass::propagateEquality(
24502450
Value *LHS, Value *RHS,
24512451
const std::variant<BasicBlockEdge, Instruction *> &Root) {

0 commit comments

Comments
 (0)