Skip to content

Commit 81ea0f1

Browse files
committed
[HashRecognize] Fix a couple of nits
1 parent 02bb3fa commit 81ea0f1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/Analysis/HashRecognize.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,14 @@ struct RecurrenceInfo {
298298
}
299299

300300
bool matchSimpleRecurrence(const PHINode *P);
301-
BinaryOperator *digRecurrence(
302-
Instruction *V, const PHINode *P,
303-
Instruction::BinaryOps BOWithConstOpToMatch = Instruction::BinaryOpsEnd);
304301
bool matchConditionalRecurrence(
305302
const PHINode *P,
306303
Instruction::BinaryOps BOWithConstOpToMatch = Instruction::BinaryOpsEnd);
304+
305+
private:
306+
BinaryOperator *digRecurrence(
307+
Instruction *V,
308+
Instruction::BinaryOps BOWithConstOpToMatch = Instruction::BinaryOpsEnd);
307309
};
308310

309311
/// Wraps llvm::matchSimpleRecurrence. Match a simple first order recurrence
@@ -329,7 +331,7 @@ bool RecurrenceInfo::matchSimpleRecurrence(const PHINode *P) {
329331
/// Digs for a recurrence starting with \p V hitting the PHI node in a use-def
330332
/// chain. Used by matchConditionalRecurrence.
331333
BinaryOperator *
332-
RecurrenceInfo::digRecurrence(Instruction *V, const PHINode *P,
334+
RecurrenceInfo::digRecurrence(Instruction *V,
333335
Instruction::BinaryOps BOWithConstOpToMatch) {
334336
SmallVector<Instruction *> Worklist;
335337
Worklist.push_back(V);
@@ -395,8 +397,8 @@ bool RecurrenceInfo::matchConditionalRecurrence(
395397

396398
// For a conditional recurrence, both the true and false values of the
397399
// select must ultimately end up in the same recurrent BinOp.
398-
BinaryOperator *FoundBO = digRecurrence(TV, P, BOWithConstOpToMatch);
399-
BinaryOperator *AltBO = digRecurrence(FV, P, BOWithConstOpToMatch);
400+
BinaryOperator *FoundBO = digRecurrence(TV, BOWithConstOpToMatch);
401+
BinaryOperator *AltBO = digRecurrence(FV, BOWithConstOpToMatch);
400402
if (!FoundBO || FoundBO != AltBO)
401403
return false;
402404

0 commit comments

Comments
 (0)