Skip to content

Commit

Permalink
fix(transform): fix isIndVarMonotonic
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcxzyw committed Aug 21, 2023
1 parent 7e07b4f commit 7b3e4b8
Show file tree
Hide file tree
Showing 10 changed files with 4,444 additions and 4,836 deletions.
4 changes: 4 additions & 0 deletions cmmc/Transforms/Loop/IndVarSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ class IndVarSimplify final : public TransformPass<Function> {
if(!add(exactly(indVar), int_(step))(MatchContext<Value>{ val->value }))
return false;
if(dir) {
if(step <= 0)
return false;
if(step <= maxInc)
continue;
} else {
if(step >= 0)
return false;
if(step >= -maxInc)
continue;
}
Expand Down
209 changes: 119 additions & 90 deletions tests/SysY2022/performance/large_loop_array_1.sy.ir

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7b3e4b8

Please sign in to comment.