Skip to content

Commit

Permalink
[Util] Erase state of modified ops (#19187)
Browse files Browse the repository at this point in the history
This was hard to debug and I haven't yet been able to track down which
op was modified causing the issue nor which pattern was triggering this.
I was encountering the following assert during `Stream` pipeline (but
not global opt):

```shell
APInt.cpp:285: int llvm::APInt::compare(const APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed.
```

It might be worth reverting #19130
instead of this patch since I wasn't able to track this down fully.


2/2 fix for #19167.

Signed-off-by: Ian Wood <[email protected]>
  • Loading branch information
IanWood1 authored Nov 18, 2024
1 parent df83f8e commit 1ab3b49
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ class DataFlowListener : public RewriterBase::Listener {
s.eraseState(res);
}

void notifyOperationModified(Operation *op) override {
s.eraseState(s.getProgramPointAfter(op));
for (Value res : op->getResults()) {
s.eraseState(res);
}
}

DataFlowSolver &s;
};

Expand Down

0 comments on commit 1ab3b49

Please sign in to comment.