[PATCH] D126012: [Scalarizer] Support loading from an extracted vector of pointer

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 13:23:09 PDT 2022


serge-sans-paille created this revision.
serge-sans-paille added reviewers: nikic, vettoreldaniele, lebedev.ri.
Herald added a subscriber: hiraditya.
Herald added a project: All.
serge-sans-paille requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The scalarizer associates unique scattered values to each instruction that involves
vector.

In the case of a vector of pointer to vectors <N x <T x M>*> that gets extracted, the
extractelement is logically associated to the single element being extracted,
leading to a scattered vector of size 1 holding an element of type '<T x M>*'.

If we try to load from that pointer, the scalarizer wants to associate the
pointer we load from (i.e. the extractelement value) to M scattered values, which
is not compatible with the existing situation where we already have a single
scattered value from the extractelement, and aborts leading to bug #54469
showcased in the test case.

Fix that situation by broadcasting the scattered state when needed.

Fix #54469


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126012

Files:
  llvm/lib/Transforms/Scalar/Scalarizer.cpp
  llvm/test/Transforms/Scalarizer/global-bug.ll
  llvm/test/Transforms/Scalarizer/vector-of-pointer-to-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126012.430787.patch
Type: text/x-patch
Size: 6013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220519/206eff0f/attachment.bin>


More information about the llvm-commits mailing list