This is an archive of the discontinued LLVM Phabricator instance.

Use unary CreateShuffleVector if possible
ClosedPublic

Authored by aqjune on Dec 29 2020, 2:37 PM.

Details

Summary

As mentioned in D93793, there are quite a few places where unary IRBuilder::CreateShuffleVector(X, Mask) can be used
instead of IRBuilder::CreateShuffleVector(X, Undef, Mask).
Let's update them.

Actually, it would have been more natural if the patches were made in this order:
(1) let them use unary CreateShuffleVector first
(2) update IRBuilder::CreateShuffleVector to use poison as a placeholder value (D93793)

The order is swapped, but in terms of correctness it is still fine.

Diff Detail

Event Timeline

aqjune created this revision.Dec 29 2020, 2:37 PM
aqjune requested review of this revision.Dec 29 2020, 2:37 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 29 2020, 2:37 PM
aqjune added inline comments.Dec 29 2020, 2:38 PM
llvm/lib/Transforms/Scalar/SROA.cpp
2260

I think it is the only part where a non-trivial change has made

spatel accepted this revision.Dec 30 2020, 5:11 AM

See inline comments to avoid bot failures - otherwise, LGTM. Thanks for the cleanup!

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
3193

ShadowTy is now an unused variable. Delete to avoid a compile warning.

llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
337

Undef is now an unused variable. Delete to avoid a compile warning.

450

Undef is now an unused variable. Delete to avoid a compile warning.

944

Undef is now an unused variable. Delete to avoid a compile warning.

This revision is now accepted and ready to land.Dec 30 2020, 5:11 AM
aqjune updated this revision to Diff 314108.Dec 30 2020, 6:05 AM
  • clang-format, address warnings
This revision was landed with ongoing or failed builds.Dec 30 2020, 6:06 AM
This revision was automatically updated to reflect the committed changes.