This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix promote alloca which is already vector
ClosedPublic

Authored by rampitec on May 11 2020, 12:26 PM.

Details

Summary

Just do not touch loads and stores which are already vector.
Previously pass was just unable to see these loads and stores
because these were hidden bitcasts.

Diff Detail

Event Timeline

rampitec created this revision.May 11 2020, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2020, 12:26 PM
arsenm added inline comments.May 11 2020, 1:11 PM
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
489–491

isAggregateType might be safer?

llvm/test/CodeGen/AMDGPU/vector-alloca-bitcast.ll
363

What if the load was with a smaller vector, or a bitcast to a different aggregate type/

rampitec updated this revision to Diff 263278.May 11 2020, 2:10 PM
rampitec marked 4 inline comments as done.

Added two more tests.

llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
489–491

Array is fine. I am adding a test.

llvm/test/CodeGen/AMDGPU/vector-alloca-bitcast.ll
363

Loads and stores which are already vector skipped by this patch (smaller vector included).
Test for different array type bitcast is added. Test with cast to struct is added.

arsenm accepted this revision.May 11 2020, 2:32 PM
This revision is now accepted and ready to land.May 11 2020, 2:32 PM
This revision was automatically updated to reflect the committed changes.