This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Allow vector access types in PromoteAllocaToVector
ClosedPublic

Authored by Pierre-vh on Jul 19 2023, 6:33 AM.

Details

Reviewers
arsenm
Group Reviewers
Restricted Project
Commits
rG3cd4afce5b18: [AMDGPU] Allow vector access types in PromoteAllocaToVector
Summary

Depends on D152706
Solves SWDEV-408279

Diff Detail

Event Timeline

Pierre-vh created this revision.Jul 19 2023, 6:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 6:33 AM
Pierre-vh requested review of this revision.Jul 19 2023, 6:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 6:33 AM
nlopes added inline comments.Jul 19 2023, 6:35 AM
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
427

Please use poison instead of undef as a placeholder whenever possible (like here).
We are trying to remove undef. Thank you!

Pierre-vh updated this revision to Diff 541997.Jul 19 2023, 6:38 AM

undef -> poison

arsenm added inline comments.Jul 19 2023, 6:59 AM
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
415

extra parens around getTypeStoreSize

467

Extra parens

473

Is there a benefit to using it here? I'd assume we end up breaking it down anyway during legalization

553

These actually return TypeSize, you can do
DL.getTypeStoreSize(AccessTy).isKnownMultipleOf(DL.getTypeStoreSize(VecTy->getElementType()))

556

return isBitOrNoop...

llvm/test/CodeGen/AMDGPU/promote-alloca-subvecs.ll
47

Try some 1 x vectors, those usually break something.

Also vectors of pointers, and FP types

arsenm added inline comments.Jul 19 2023, 7:02 AM
llvm/test/CodeGen/AMDGPU/promote-alloca-subvecs.ll
47

And reload ptr as int and int as ptr

Pierre-vh updated this revision to Diff 543411.Jul 24 2023, 1:23 AM
Pierre-vh marked 7 inline comments as done.

Comments

llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
473

Probably not, it's indeed broken into insert/extracts anyway. I've simplified it.

arsenm accepted this revision.Jul 24 2023, 6:11 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
456

TypeSize?

467

isKnownMultipleOf

This revision is now accepted and ready to land.Jul 24 2023, 6:11 AM
Pierre-vh updated this revision to Diff 543513.Jul 24 2023, 6:25 AM
Pierre-vh marked 2 inline comments as done.

Comments

arsenm accepted this revision.Jul 24 2023, 6:29 AM