Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious panics in var-to-phi promotion #128

Open
fabianschuiki opened this issue Jun 6, 2020 · 0 comments
Open

Spurious panics in var-to-phi promotion #128

fabianschuiki opened this issue Jun 6, 2020 · 0 comments
Labels
A-opt Area: Optimization and transformation passes. C-bug Category: This is a bug.

Comments

@fabianschuiki
Copy link
Owner

The vtpp transformation generates spurious panics of the following form, when running on the complex tests in the moore repository (test/svlog/complex/*):

thread '<unnamed>' panicked at 'invalid value', [...]/llhd-0.13.0/src/ir/unit.rs:367:35

The backtrace would generally look something like this:

[...]
12: llhd::ir::unit::Unit::value_type
      at src/ir/unit.rs:367
13: llhd::ir::inst::InstBuilder::value_type
      at src/ir/inst.rs:585
14: llhd::ir::inst::InstBuilder::phi
      at src/ir/inst.rs:471
15: llhd::pass::vtpp::materialize_value
      at src/pass/vtpp.rs:168
16: <llhd::pass::vtpp::VarToPhiPromotion as llhd::opt::pass::Pass>::run_on_cfg
      at src/pass/vtpp.rs:83
17: llhd::opt::pass::Pass::run_on_unit
      at src/opt/pass.rs:23
18: llhd::opt::pass::Pass::run_on_module::{{closure}}
      at src/opt/pass.rs:17
[...]

The issue occurs only sporadically, so is probably either dependent on the rayon parallelization for some reason, or some randomness implied by HashSet/HashMap key ordering.

Possibly a phi node is being inserted for a value that was already removed, or should have been collected by DCE?

@fabianschuiki fabianschuiki added C-bug Category: This is a bug. A-opt Area: Optimization and transformation passes. labels Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-opt Area: Optimization and transformation passes. C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant