llvm / llvm/circt

[FIRRTL][InferWidths] Make checkCycles Iterative

Open
#5,447 0 comments 0 reactions 0 assignees View on GitHub
bug FIRRTL
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

The method `InferWidths::checkCycles` is currently recursive. If `firtool` is spawned in a thread which has an abnormally low stack size (i.e., on MacOS running Chisel tests using Scalatest), this can result in stack overflows. Fix this method to make it recursive. This is similar to https://github.com/llvm/circt/pull/5305.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the FIRRTL InferWidths implementation and the checkCycles method, then compare its traversal with the analogous change in LLVM CIRCT pull request 5305. Confirm whether the intended result is iterative, as stated in the title, and verify that cycle checking no longer depends on recursive stack depth.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.