This is an archive of the discontinued LLVM Phabricator instance.

[SVE][CodeGen] Fix DAGCombiner::ForwardStoreValueToDirectLoad for scalable vectors
ClosedPublic

Authored by david-arm on Sep 3 2020, 10:24 AM.

Details

Summary

In DAGCombiner::ForwardStoreValueToDirectLoad I have fixed up some
implicit casts from TypeSize -> uint64_t and replaced calls to
getVectorNumElements() with getVectorElementCount(). There are some
simple cases of forwarding that we can definitely support for
scalable vectors, i.e. when the store and load are both scalable
vectors and have the same size. I have added tests for the new
code paths here:

CodeGen/AArch64/sve-forward-st-to-ld.ll

Diff Detail

Event Timeline

david-arm created this revision.Sep 3 2020, 10:24 AM
efriedma added inline comments.Sep 3 2020, 12:29 PM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
14784

Add comments to explain these bailouts?

14810

Probably you could make this math work for scalable vectors, but it probably doesn't really matter at the moment.

c-rhodes added inline comments.Sep 4 2020, 2:51 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
14832

should this be comparing LdMemSize?

david-arm updated this revision to Diff 289910.Sep 4 2020, 3:48 AM
  • Added comments to explain reasons for new bail-outs.
david-arm marked 2 inline comments as done.Sep 4 2020, 3:49 AM

I also changed StMemSize to LdMemSize as @c-rhodes suggested.

c-rhodes accepted this revision.Sep 4 2020, 4:53 AM

LGTM

This revision is now accepted and ready to land.Sep 4 2020, 4:53 AM