This is an archive of the discontinued LLVM Phabricator instance.

[LSV] Change the default value of InstertElement to poison
ClosedPublic

Authored by hyeongyukim on Oct 3 2021, 12:32 AM.

Details

Summary

This patch is changing the InsertElement's placeholder to poison without changing the LSV's behavior.

Regardless of whether StoreTy is FixedVectorType or not, the poison value will be overwritten with a different value.
Therefore, whether the InsertElement's placeholder is poison or undef will not affect the result of the program.

Diff Detail

Event Timeline

hyeongyukim created this revision.Oct 3 2021, 12:32 AM
hyeongyukim requested review of this revision.Oct 3 2021, 12:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2021, 12:32 AM
hyeongyukim added inline comments.
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
1131

if StoreTy is FixedVectorType, the poison will be hided by this CreateInsertElement.
Since VecTy's length is Chain.size() * VecStoreTy->getNumElements(), all poisons will be hidden.

1144

if StoreTy is not FixedVectorType, the poison will be hided by this CreateInsertElement.
Since VecTy's length is Chain.size(), all poisons will be hidden.

nikic accepted this revision.Oct 3 2021, 1:18 AM

LGTM

This revision is now accepted and ready to land.Oct 3 2021, 1:18 AM