[PATCH] D93989: [Scalarizer] Use poison as insertelement's placeholder

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 3 06:18:03 PST 2021


aqjune created this revision.
aqjune added reviewers: nikic, spatel, bjope, ctetreau.
Herald added a subscriber: hiraditya.
aqjune requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch makes Scalarizer to use poison as insertelement's placeholder.

It contains two changes in Scalarizer.cpp, and the both changes does not change the semantics of the optimized program.
It is because the placeholder value (poison) is already completely hidden by following insertelement instructions.

The first change at visitBitCastInst() creates poison vector of MidTy and consecutively inserts FanIn times,
which is # of elems of MidTy.
The second change at ScalarizerVisitor::finish() creates poison with Op->getType(), and it is filled with
Count insertelements.

The test diffs show that the poison value is never exposed after insertelements.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93989

Files:
  llvm/lib/Transforms/Scalar/Scalarizer.cpp
  llvm/test/Transforms/Scalarizer/basic-inseltpoison.ll
  llvm/test/Transforms/Scalarizer/basic.ll
  llvm/test/Transforms/Scalarizer/constant-insertelement.ll
  llvm/test/Transforms/Scalarizer/intrinsics.ll
  llvm/test/Transforms/Scalarizer/order-bug-inseltpoison.ll
  llvm/test/Transforms/Scalarizer/order-bug.ll
  llvm/test/Transforms/Scalarizer/scatter-order.ll
  llvm/test/Transforms/Scalarizer/variable-extractelement.ll
  llvm/test/Transforms/Scalarizer/variable-insertelement.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93989.314281.patch
Type: text/x-patch
Size: 20527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210103/50d422db/attachment.bin>


More information about the llvm-commits mailing list