This is an archive of the discontinued LLVM Phabricator instance.

[IR] Add the constructor of ShuffleVector for one-input-vector.
ClosedPublic

Authored by hyeongyukim on Sep 21 2021, 3:41 AM.

Details

Summary

One of the two inputs of the Shufflevector is often a placeholder.
Previously, there were cases where the placeholder was undef, and there were cases where it was poison.
I added these constructors to create a placeholder consistently.

Changing to use the newly added constructor will be written in a separate patch.

Diff Detail

Event Timeline

hyeongyukim created this revision.Sep 21 2021, 3:41 AM
hyeongyukim requested review of this revision.Sep 21 2021, 3:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2021, 3:41 AM
spatel accepted this revision.Sep 21 2021, 5:11 AM

LGTM - thanks!

llvm/include/llvm/IR/Instructions.h
2021

Cutting the "e" off of "Before" might have been a hack to make this fit in 80-columns for the original code, but it would be nice to spell it correctly now in all of these declarations. :)

llvm/lib/IR/Instructions.cpp
1910

We call this a "unary shuffle" in the IRBuilder code comments, so "createOperandForUnaryShuffle" might make it clearer that this is the same functionality for the raw constructors.

This revision is now accepted and ready to land.Sep 21 2021, 5:11 AM

rebase and change function name.

This revision was landed with ongoing or failed builds.Sep 21 2021, 6:06 AM
This revision was automatically updated to reflect the committed changes.