EnzymeAD / EnzymeAD/Enzyme

Assertion `pair.second == ConcreteType(BaseType::Pointer) || pair.second == ConcreteType(BaseType::Anything)

Open
#2,311 1 comment 0 reactions 1 assignee Claimed by @wsmoses View on GitHub
needs more information
Dominant language
LLVM
Stars
1.7k
Forks
188
Avg merge
1d 22h
Merged PRs (30d)
26

Description

A reduced bugreport from https://github.com/g-bauer/enzyme_playground case2.
I'd recommend to fix the SCEV issue first, since 4+ other cases run into it.
The reproducer below triggers the assertion in the title when we compile case2 with rustc. However, if I print the module right before the enzyme pass and then just run the pass through opt, standalone, then we don't trigger TA, but the SCEV bug. `LooseTypes` has no effect.

Error message:
```
rustc: /home/manuel/prog/rust-master/src/tools/enzyme/enzyme/Enzyme/TypeAnalysis/TypeTree.h:607: TypeTree TypeTree::Lookup(size_t, const llvm::DataLayout &) const: Assertion `pair.second == ConcreteType(BaseType::Pointer) || pair.second == ConcreteType(BaseType::Anything)' failed.
```
We don't create any tt in the upstream rustc at all, so that should be an enzyme bug.

[mod2.ll.txt](https://github.com/user-attachments/files/20140588/mod2.ll.txt)

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.