This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Update transformations to use poison for insertelement/shufflevector's placeholder value (1/2)
AbandonedPublic

Authored by aqjune on Jan 10 2021, 5:28 PM.

Details

Summary

This patch updates InstCombine transformations except InstCombineVectorOps.cpp to create
insertelement/shufflevector with poison placeholder.

The updates in InstCombineVectorOps.cpp will be done in the next patch.

It is close to the end..!

Diff Detail

Event Timeline

aqjune created this revision.Jan 10 2021, 5:28 PM
aqjune requested review of this revision.Jan 10 2021, 5:28 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 10 2021, 5:28 PM
aqjune added inline comments.Jan 10 2021, 5:33 PM
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
1728

Guarded by this branch condition, the for loop at line 1740 never adds a mask that makes Shuffle point to the second operand vector (which was previously Undef, but now Poison).

llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
2613

This creates insertelement <1 x X86_mmx> undef, Elem, 0
Replacing undef with poison has no visible effect.

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
1693

Be conservative, and create shufflevector with undef if Mask may point to the second vector

Matt added a subscriber: Matt.Jun 8 2021, 3:43 AM
aqjune abandoned this revision.Sep 25 2021, 8:14 PM

I abandon this patch because (1) shufflevector parts are covered in D110226, D110227, D110230, and (2) insertelement parts will be covered in upcoming new patches.