llvm / llvm/circt

PrettifyVerilog: infinite loop + growing memory consumption on self-loop unary op

Open
#4,269 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Point `firtool` at this testcase: https://github.com/llvm/circt/blob/745e0809a12c0760ccb47ccd6e37fc48e4933361/test/Dialect/Comb/canonicalization.mlir , and prettify verilog spins and consumes over 30GB memory (at which point I killed it).

Judging by sampling stack, I think happening in `prettifyUnaryOperator` looping through uses, but more investigation required.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running firtool on test/Dialect/Comb/canonicalization.mlir at the reported revision and observe the prettify-verilog failure. Then inspect prettifyUnaryOperator and its use traversal, using the stack-sampling observation as an investigation lead. Done means the testcase completes without spinning or runaway memory consumption.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.