[PATCH] D122026: just resize the cache, dont assert equality of sizes

Benoit Jacob via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 19 19:53:05 PDT 2022


Benoit added a comment.

OK, I have dug deeper now :-)

Here <https://gist.github.com/bjacob/b52d34f1d04cb80e44c85f936a5d780e> is the dumped function at the point where the assert is triggering. It's still not a testcase because it references types that `opt` doesn't know about.

I know specifically the part that is tripping the assertion, it's:

  %233 = extractelement <16 x <64 x i32>*> %bc, i64 0
  %wide.vec = load <64 x i32>, <64 x i32>* %233, align 4, !dbg !20

The `extractelement` is handled by `ScalarizerVisitor::visitExtractElementInst`, which calls `gather`, which associates to the Value `%233` a vector of length 1, explicitly here <https://github.com/google/iree-llvm-fork/blob/9879c555f21097aee15e73dd25bd89f652dba8ea/llvm/lib/Transforms/Scalar/Scalarizer.cpp#L829>.

But then the `load` is handled by `ScalarizerVisitor::visitLoadInst` , calling scatter on its operand `%233`, which determines that its type being `<64 x i32>`, its vector size is 64, thus complaining that the cached ValueVector has size 1 (from what the above `gather` did), not 64.

I'm ignorant enough that it's not trivial for me to turn this into a testcase (I just dont know LLVM IR as a language at all), but I could try a bit harder... maybe you have thoughts already at this point, though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122026



More information about the llvm-commits mailing list