This is an archive of the discontinued LLVM Phabricator instance.

[X86] `canonicalizeShuffleWithBinOps()`: support `VS[HR][LA]I` opcodes, unary shuffles part
Needs ReviewPublic

Authored by lebedev.ri on Jan 15 2023, 3:27 PM.

Details

Summary

This addresses the regression from https://reviews.llvm.org/D141778#inline-1369900
This builds upon the NFC refactoring of D141877, and enhances the xform
to support the uniform shifts by immediate, but only for unary shuffles

Diff Detail

Event Timeline

lebedev.ri created this revision.Jan 15 2023, 3:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 15 2023, 3:27 PM

Thanks for looking at this!

llvm/lib/Target/X86/X86ISelLowering.cpp
40436

Instead of checking for ISD::TargetConstant specifically, could you use a helper to indicate whether to ignore a specific operandno for specific opcodes - that would allow us to extend this to the non-immediate versions of the sse shifts as well.

lebedev.ri marked an inline comment as done.
lebedev.ri edited the summary of this revision. (Show Details)

@RKSimon thank you for taking a look!
Indeed, that does solve my concerns.

lebedev.ri retitled this revision from [X86] `canonicalizeShuffleWithBinOps()`: support `VS[HR][LA]I` opcodes (unary shuffles only) to [X86] `canonicalizeShuffleWithBinOps()`: support `VS[HR][LA]I` opcodes.
lebedev.ri edited the summary of this revision. (Show Details)

Implement binary shuffles too.

lebedev.ri retitled this revision from [X86] `canonicalizeShuffleWithBinOps()`: support `VS[HR][LA]I` opcodes to [X86] `canonicalizeShuffleWithBinOps()`: support `VS[HR][LA]I` opcodes, unary shuffles part.
lebedev.ri edited the summary of this revision. (Show Details)

Split the refactoring into a preparatory NFC patch.