[PATCH] D151630: [LSV] Fix the ContextInst for computeKnownBits.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 28 19:28:05 PDT 2023


jlebar added a comment.

In D151630#4378433 <https://reviews.llvm.org/D151630#4378433>, @ronlieb wrote:

> thanks for looking into it. enjoy rest of your day

I'm not seeing how this can happen.  :(

I see two places where I call `APInt::operator==`:

- `bool AreContiguous = It->OffsetFromLeader == PrevReadEnd;`
- `if (IOffset == ChainElemOffset ...)`

In the first case, the two APInts are from the `OffsetFromLeader` values from the same Chain.  There are two places where a ChainElem is created (search for `ChainElem{`), and the OffsetFromLeader values explicitly have the same bitwidth.

In the second case, IOffset and ChainElemOffset come from the `ChainOffsets` hashtable, which is created using the ChainElem::OffsetFromLeader field, so here too they should have the same bitwidth.

Perhaps the assertion is happening in another file (still is probably my bug!), or perhaps I'm missing the call to APInt::operator==.  Or perhaps I'm misunderstanding my invariants somehow.

A reproducer, or at least a stacktrace, would be very helpful.

Sorry for the trouble, and thanks for helping me hunt this down.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151630/new/

https://reviews.llvm.org/D151630



More information about the llvm-commits mailing list