[all-commits] [llvm/llvm-project] 1fc992: [Scalarizer] Use poison as insertelement's placeho...

Juneyoung Lee via All-commits all-commits at lists.llvm.org
Sun Jan 3 07:41:06 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fc992bd864aa7e73615a47e72e82e2cf7ac73ef
      https://github.com/llvm/llvm-project/commit/1fc992bd864aa7e73615a47e72e82e2cf7ac73ef
  Author: Juneyoung Lee <aqjune at gmail.com>
  Date:   2021-01-04 (Mon, 04 Jan 2021)

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

  Log Message:
  -----------
  [Scalarizer] Use poison as insertelement's placeholder

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.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D93989




More information about the All-commits mailing list