Allows allocas with memset users to be promoted.
This is intended to prevent patterns such as memset(&alloca, 0, sizeof(alloca)) (which I think can be emitted by frontends) from preventing a vectorization of allocas.
Fixes SWDEV-388784
Paths
| Differential D146225
[AMDGPU] Handle memset users in PromoteAlloca ClosedPublic Authored by Pierre-vh on Mar 16 2023, 6:35 AM.
Details Summary Allows allocas with memset users to be promoted. This is intended to prevent patterns such as memset(&alloca, 0, sizeof(alloca)) (which I think can be emitted by frontends) from preventing a vectorization of allocas. Fixes SWDEV-388784
Diff Detail
Event Timeline
Comment Actions
Do you mean the PromoteAlloca pass? I'm not sure Comment Actions
@lebedev.ri had some patches to do a much less aggressive vector formation during SROA
Comment Actions
(Unrelated to the review) do you have a link to those patches? I was planning to do some PromoteAlloca improvements later but if we're planning to merge it with SROA later then I suppose time would be better spent moving in that direction and helping these patches land
Pierre-vh marked an inline comment as done. Comment ActionsComments
This revision is now accepted and ready to land.Mar 28 2023, 5:28 AM This revision was landed with ongoing or failed builds.Mar 28 2023, 6:02 AM Closed by commit rGd7b4b76956e2: [AMDGPU] Handle memset users in PromoteAlloca (authored by Pierre-vh). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 505798 llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
llvm/test/CodeGen/AMDGPU/promote-alloca-memset.ll
|
I'd expect the input to be the MemSetInst and the dyn_cast would be on the caller side. Also, use TypeSize?