Duplicate IR functions created for DSLX stdlib functions
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Using a stdlib function in a function and a proc yields duplicate functions being generated in the IR.
```
import std
pub fn bar(x: u32, y: u32) -> u32 {
std::umin(x, y)
}
pub proc foo {
init { () }
config () { () }
next(tok: token, state: ()) {
let _ = std::umin(u32:1, u32:2);
()
}
}
```
Repro:
```
bazel -bin/third_party/xls/dslx/interpreter_main input.x
```
Error:
```
E0113 14:09:07.559838 2779847 command_line_utils.cc:37] Could not extract a textual position from error message: INTERNAL: XLS_RET_CHECK failure (third_party/xls/ir/verifier.cc:1728) !name_set->contains(function_base->name()) Function/proc/block with name __std__umin__32 is not unique within package foo
```
Contributor guide
Assessment
This issue has not been assessed yet.