llvm / llvm/circt

[FIRRTL] Don't put names on constants

Open
#7,064 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

We are getting things like:

      %c0_ui2 = firrtl.constant 0 : !firrtl.uint<2> {name = "_count_reg_32_redundantReg_r_wrappedData"}
      %c0_ui4 = firrtl.constant 0 : !firrtl.uint<4> {name = "_count_reg_16_redundantReg_r_wrappedData"}
      %c0_ui1 = firrtl.constant 0 : !firrtl.uint<1> {name = "sources_with_cancel_0_2_lateCancel"}
      %c1_ui3 = firrtl.constant 1 : !firrtl.uint<3> {name = "r_d_bits_opcode"}
      %c1_ui1 = firrtl.constant 1 : !firrtl.uint<1> {name = "overflow_1"}
      %c1_ui2 = firrtl.constant 1 : !firrtl.uint<2> {name = "out_arw_bits_burst"}

I don't think constants should ever have name attributes.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the FIRRTL constant emission path and locating where the displayed name attributes are attached. Compare the generated examples with the intended FIRRTL representation; done means constants no longer receive name attributes, with relevant tests updated or added if the existing test suite covers this output.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.