Skip to content

Conversation

@topperc
Copy link
Collaborator

@topperc topperc commented Nov 16, 2024

The implementaton of methods only vary by what arguments they pass to selectVSplatCommon.

Turn selectVSplatCommon into a virtual function and use template methods in the base class to pass the immediate size.

…lates.

The implementaton of methods only vary by what arguments they pass to
selectVSplatCommon.

Turn selectVSplatCommon into a virtual function and use template
methods in the base class to pass the immediate size.
@topperc topperc requested review from arsenm and dtcxzyw November 16, 2024 05:31

def vsplati8_uimm3 : SplatComplexPattern<vsplat_uimm3, v16i8, 1,
"selectVSplatUimm3",
"selectVSplatUimm<3>",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can further reduce duplicate code with foreach:

foreach I = {2, 4, 5, 8} in
ef vsplati8_uimm # I : SplatComplexPattern<vsplat_uimm # I, v16i8, 1,
                                          "selectVSplatUimm<"# I #">",

Up to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might do some other refactorings here. I'm not sure we need one of these for every element size.

Copy link
Member

@dtcxzyw dtcxzyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@topperc topperc merged commit a6140af into llvm:main Nov 17, 2024
5 of 8 checks passed
@topperc topperc deleted the pr/splatimm branch November 17, 2024 04:37
devin-ai-integration bot pushed a commit to ohhmm/llvm-project that referenced this pull request Nov 17, 2024
…lates. (llvm#116475)

The implementaton of methods only vary by what arguments they pass to
selectVSplatCommon.

Turn selectVSplatCommon into a virtual function and use template methods
in the base class to pass the immediate size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants