Skip to content

Commit 902e360

Browse files
kpetalan-baker
andauthored
spirv-opt: clarify declaration of FindNumberOfIterations (KhronosGroup#6727)
This function takes the branch instruction, not the condition instruction as returned by GetConditionInst(). Rename the parameter in the header (the implementation already uses the right name) and update the comment to save the next person discovering this a bit of time. --------- Signed-off-by: Kevin Petit <kevin.petit@arm.com> Co-authored-by: alan-baker <alanbaker@google.com>
1 parent 9b51d3d commit 902e360

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/opt/loop_descriptor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ class Loop {
242242
Instruction* FindConditionVariable(const BasicBlock* condition) const;
243243

244244
// Returns the number of iterations within a loop when given the |induction|
245-
// variable and the loop |condition| check. It stores the found number of
245+
// variable and the loop |branch| instruction. It stores the found number of
246246
// iterations in the output parameter |iterations| and optionally, the step
247-
// value in |step_value| and the initial value of the induction variable in
247+
// value in |step_amount| and the initial value of the induction variable in
248248
// |init_value|.
249249
bool FindNumberOfIterations(const Instruction* induction,
250-
const Instruction* condition, size_t* iterations,
250+
const Instruction* branch, size_t* iterations,
251251
int64_t* step_amount = nullptr,
252252
int64_t* init_value = nullptr) const;
253253

0 commit comments

Comments
 (0)