Skip to content

[VectorCombine] foldShuffleOfIntrinsics - support multiple uses of shuffled ops #173037

@RKSimon

Description

@RKSimon

The "shuffle (intrinsic), (intrinsic)" -> "intrinsic (shuffle), (shuffle)" fold is currently limited by a mOneUse check:

bool VectorCombine::foldShuffleOfIntrinsics(Instruction &I) {
Value *V0, *V1;
ArrayRef<int> OldMask;
if (!match(&I, m_Shuffle(m_OneUse(m_Value(V0)), m_OneUse(m_Value(V1)),
m_Mask(OldMask))))
return false;

We should try to remove the m_OneUse limits and adjust the NewCost accordingly - similar to what happens in foldShuffleOfCastops

A large portion of this task will be creating test coverage.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions