Skip to content

[MLIR][SCF] pipelining pass use of uninitialized value #146990

@Hyffer

Description

@Hyffer

Here in the code:

for (auto &opSchedule : schedule) {
maxStage = std::max(maxStage, opSchedule.second);
stages[opSchedule.first] = opSchedule.second;
opOrder.push_back(opSchedule.first);
}

maxStage is used before initialized.

When it checks numIteration > maxStage at line-127, maxStage is always 0 as default. So it will mistakenly decide if the loop trip count is actually greater than stage number, and thus pipelining a loop that should not have done.


At older llvm version(17), it was correct. The problem is introduced in this commit: ef11283

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions