This is an archive of the discontinued LLVM Phabricator instance.

[DirectX backend] Support typed buffer load/store.
Needs ReviewPublic

Authored by python3kgae on Oct 19 2022, 4:42 PM.

Details

Summary

New DXIL op BufferLoad/BufferStore is added.
Resources in "hlsl.uavs" will be lowered into createHandle, BufferLoad and BufferStore.

Didn't use the createHandle generated in clangCodeGen yet.
Tracking with https://github.com/llvm/llvm-project/issues/58031.

MemAccessLowerHelper::collectMemAccess is added to help find memory access for lowering.
Different version of Offset will be added for different memory access later.

Array of resources are not supported yet.
Tracking with https://github.com/llvm/llvm-project/issues/58486

Diff Detail

Event Timeline

python3kgae created this revision.Oct 19 2022, 4:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 4:42 PM
python3kgae requested review of this revision.Oct 19 2022, 4:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 4:42 PM

Remove unused header

beanz added a comment.Jan 3 2023, 1:53 PM

A few questions. Does this pass work with handles passed as parameters to functions? What about different functions that refer to the same global? Does that result in multiple createHandle calls?

llvm/lib/Target/DirectX/DXILTypedBufferLowering.cpp
56

Is this particularly complicated?

85

Should this cast be to int8_t instead since that is the argument type?

107
python3kgae marked 2 inline comments as done.

Fix typo and argument type.

python3kgae added inline comments.Jan 3 2023, 3:07 PM
llvm/lib/Target/DirectX/DXILTypedBufferLowering.cpp
56

Might be complicated when support array.
Better do this after resource array is supported.