[FIRRTL] Reconsider use of inferReturnType in FIRRTLExprs
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 524
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
We require FIRRTLExprs to define inferReturnType, which is used, for example, here: https://github.com/llvm/circt/blob/a3e993cb387a08e686b0df1d7f5b599bca0b3751/lib/Dialect/FIRRTL/Import/FIRParser.cpp#L2285
There is some ODS machinery to allow subclasses to customize this using inferTypeDecl and inferType: https://github.com/llvm/circt/blob/a3e993cb387a08e686b0df1d7f5b599bca0b3751/include/circt/Dialect/FIRRTL/FIRRTLExpressions.td#L548-L566
@uenoku pointed out on https://github.com/llvm/circt/pull/6701 that we can probably just use methods from InferTypeOpInterface. All of this machinery seems to predate that existing, but we might be able to simplify it now.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading FIRRTLExpressions.td around the inferTypeDecl and inferType definitions, then inspect the FIRRTLParser.cpp use of inferReturnType and the discussion in pull request 6701. Determine whether InferTypeOpInterface can replace the existing FIRRTLExprs machinery; done means the redundant machinery is simplified without breaking the affected FIRRTL expression type inference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100