google / google/xls

benchmark_ir crashes w/ __itok__ top

Open
#2,211 0 comments 0 reactions 0 assignees View on GitHub
bug ir ux 🧦 sox
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

**Describe the bug**
It doesn't seems that `benchmar_ir_main` supports specifying a top function prefixed w/ `__itok__`.

**To Reproduce**
- `ir_convert` a function w/ sub-functions that uses `assert`.
- `opt` w/ a top that point to one of the `__itok__` sub-functions.
- `benchmark_ir` the resulting optimized IR.

This will result in the following crash:
```
F0519 16:11:37.882557 921042 benchmark_main.cc:505] Check failed: pointers.back() != nullptr ((null) vs. (null))
*** Check failure stack trace: ***
@ absl::log_internal::LogMessage::SendToLog()
@ absl::log_internal::LogMessage::Flush()
@ xls::(anonymous namespace)::ConvertToJitArguments()
@ xls::(anonymous namespace)::RunInterpreterAndJit()
@ main
@ __libc_start_main
@ _start
```

**Expected behavior**
`benchmark_ir` could infer a trivial non-itok wrapper:
```
after_all.19: token = after_all(id=19)
literal.20: bits[1] = literal(value=1, id=20)
invoke.21: (token, bits[8]) = invoke(after_all.19, literal.20, ..., to_apply=__itok__fn, id=21)
ret tuple_index.22: bits[8] = tuple_index(invoke.21, index=1, id=22)
```
or clearly states that it isn't supported instead of crashing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.