This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Teach scalarizeBinOpOfSplats handle scalable splat.

Authored by jacquesguan on Mar 31 2022, 2:15 AM.



This revision supports to scalarize a binary operation of two scalable
splat vectors.

Diff Detail

Event Timeline

jacquesguan created this revision.Mar 31 2022, 2:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 2:15 AM
jacquesguan requested review of this revision.Mar 31 2022, 2:15 AM

precommit the new tests and rebase so the patch shows the diff?

rebase the precommit test.

craig.topper added inline comments.Jun 14 2022, 9:49 PM

Not sure we should be creating SPLAT_VECTOR on targets that don't support SPLAT_VECTOR. At the very least it's a waste of compile time to convert it back to a BUILD_VECTOR.

RKSimon added inline comments.Jun 15 2022, 4:31 AM

Use DAG.isSplatValue instead?


+1 at the very least we need a hasOperation() check for the getSplatVector path and getBuildVector fallback

Address comment.

Fix test case.

jacquesguan added inline comments.Jul 10 2022, 7:27 PM

I tried to use DAG.isSplatValue, but this way would affect many no splat cases of X86 target, some of them are negative.


Done, I only build splat_vector when is scalable now.

RKSimon accepted this revision.Jul 18 2022, 1:53 AM

LGTM with one minor


OK - please can you add a TODO comment? It sounds like something that needs revisiting in the future.

This revision is now accepted and ready to land.Jul 18 2022, 1:53 AM

Address comment.

This revision was landed with ongoing or failed builds.Jul 18 2022, 8:23 PM
This revision was automatically updated to reflect the committed changes.
jacquesguan reopened this revision.Jul 19 2022, 1:24 AM
This revision is now accepted and ready to land.Jul 19 2022, 1:24 AM

rebase main