Added check if the execution of the last step of the given unrolled loop has generated more branches. If yes, than treat it as a normal (non-unrolled) loop in the remaining part of the analysis.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
The heuristic makes perfect sense to me.
I think we could use some tests here.
lib/StaticAnalyzer/Core/LoopUnrolling.cpp | ||
---|---|---|
224–229 ↗ | (On Diff #111982) | Could you comment on whether it's possible that both ifs happen (LoopStmt's node has more than one successor) and if it is, why do we behave correctly in this case? |
lib/StaticAnalyzer/Core/LoopUnrolling.cpp | ||
---|---|---|
224–229 ↗ | (On Diff #111982) | Hmm I ve intended to write BlockEntrance instead of BlockEdge and in this case it wont happen that both of the ifStmts is true. |
Comment Actions
LGTM!
I guess later it'd be great to comment on every numTimesReached() why is it supposed to be reached exactly that many times, as it's often unclear, especially with tricky control flow. Because if somebody accidentally breaks the test, they'd have no idea what it tests or why it should work this way.