Page MenuHomePhabricator

[SVE][CodeGen] Improve codegen of scalable masked scatters
ClosedPublic

Authored by kmclaughlin on Nov 6 2020, 6:59 AM.

Details

Summary

If the scatter store is able to perform the sign/zero extend of
its index, this is folded into the instruction with refineIndexType().
Additionally, refineUniformBase() will return the base pointer and index
from an add + splat_vector.

Diff Detail

Event Timeline

kmclaughlin created this revision.Nov 6 2020, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 6 2020, 6:59 AM

The indentation seems off for some of the changes, could you run the patch through clang-format?

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
9408

This should probably use SelectionDAG::getSplatValue() instead, because there are multiple ways of representing splats (SPLAT_VECTOR is only used for scalable vectors at the moment).

kmclaughlin marked an inline comment as done.
  • Replaced check for ISD::SPLAT_VECTOR opcode in refineUniformBase with SelectionDAG::getSplatVector()
  • Applied changes suggested by clang-format
sdesmalen accepted this revision.Nov 10 2020, 8:48 AM

Nice improvements to the test :) LGTM!

This revision is now accepted and ready to land.Nov 10 2020, 8:48 AM
yubing added a subscriber: yubing.Dec 2 2020, 11:14 PM
yubing added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
9421

If Index is a undef, this line will assertion fail.

kmclaughlin added inline comments.Dec 3 2020, 2:30 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
9421

Hi @yubing, thank you for posting a fix for this in D92548!