Page MenuHomePhabricator

[VP] Strided loads/stores
Needs ReviewPublic

Authored by loralb on Dec 1 2021, 8:45 AM.

Details

Summary

This patch introduces two new experimental IR intrinsics and SDAG nodes to represent vector strided loads and stores.

Diff Detail

Unit TestsFailed

TimeTest
50 msx64 debian > LLVM.Bindings/Go::go.test
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-go go=/usr/bin/go test llvm.org/llvm/bindings/go/llvm

Event Timeline

loralb created this revision.Dec 1 2021, 8:45 AM
loralb requested review of this revision.Dec 1 2021, 8:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2021, 8:45 AM
craig.topper added inline comments.Dec 1 2021, 2:33 PM
llvm/include/llvm/IR/VPIntrinsics.def
217

Is this an existing mistake in the documentation? Can you just push this as an NFC commit? No need to bury it in this patch.

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
7969

Since this accesses multiple disjoint memory locations, the Size is not MemVT.getStoreSize(). It probably needs to always be unknown. I guess it would be if the stride were statically known to be 0, but not sure it is worth special casing that.

8102

Same as load, the Size can't be based on the store type.

8158

Same

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
7449

This Size doesn't make sense. I think it needs to be unknown.

7470

Same

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
574

Can these be SmallVectorImpl<SDValue>?

rogfer01 added inline comments.Dec 1 2021, 10:43 PM
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
7437

Does anyone know if we should be passing AAInfo here?

(Non-stride) VPLoad doesn't do that, so we can fix both in a later change if necessary.

loralb updated this revision to Diff 391348.Dec 3 2021, 12:52 AM

ChangeLog:

  • add documentation for the new intrinsics
  • use MemoryLocation::UnknownSize
  • use SmallVectorImpl<SDValue> in functions signatures
loralb marked 7 inline comments as done.Dec 3 2021, 12:57 AM
loralb added inline comments.
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
574

I'll fix visitVPLoadGather and visitVPStoreScatter above in a later change.

loralb updated this revision to Diff 394256.Dec 14 2021, 8:40 AM
loralb marked an inline comment as done.

Changelog:

  • ensure default alignment behaviour reflects changes in D114423
  • align MemoryLocation retrieval for VPStridedLoad to VPLoad (see D115036)
loralb marked an inline comment as done.Dec 14 2021, 8:42 AM
simoll added inline comments.Dec 15 2021, 3:04 AM
llvm/lib/IR/IntrinsicInst.cpp
495

This will require an explicit return type because of opaque pointers, as in 6213f1dd03e27fd2483f8ac775a346de8e873573

loralb updated this revision to Diff 394547.Dec 15 2021, 6:36 AM

Changelog:

  • use explicit return type in Intrinsic::getDeclaration() for experimental_vp_strided_load
  • get first argument type from first operand in Intrinsic::getDeclaration() for experimental_vp_strided_store
loralb marked an inline comment as done.Dec 15 2021, 6:37 AM
simoll added a project: Restricted Project.Dec 23 2021, 12:40 AM