Page MenuHomePhabricator

[Scalarizer] Use poison as insertelement's placeholder
ClosedPublic

Authored by aqjune on Sun, Jan 3, 6:18 AM.

Details

Summary

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.

Diff Detail

Event Timeline

aqjune created this revision.Sun, Jan 3, 6:18 AM
aqjune requested review of this revision.Sun, Jan 3, 6:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptSun, Jan 3, 6:18 AM
nikic accepted this revision.Sun, Jan 3, 7:34 AM

LGTM

This revision is now accepted and ready to land.Sun, Jan 3, 7:34 AM
This revision was automatically updated to reflect the committed changes.