Page MenuHomePhabricator

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

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.Tue, Jun 8, 3:43 AM