This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Simplify all stores in the device code
ClosedPublic

Authored by jdoerfert on Sep 17 2021, 12:57 PM.

Details

Summary

Similar to loads, we want to be aggressive when it comes to store
simplification. Not everything in LLVM handles dead stores well when
address space casts are involved, we can simply ask the Attributor to do
it for us though.

Diff Detail

Event Timeline

jdoerfert created this revision.Sep 17 2021, 12:57 PM
jdoerfert requested review of this revision.Sep 17 2021, 12:57 PM
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
tianshilei1992 accepted this revision.Sep 20 2021, 11:36 AM

LGTM.

llvm/test/Transforms/OpenMP/spmdization.ll
1873–1874

Can we do further? Since the store to this variable is removed, its value now is meaningless. We don't have to pass it to the function call below, and we can remove the argument for the callee, and we don't need to allocate this variable.

This revision is now accepted and ready to land.Sep 20 2021, 11:36 AM
jdoerfert added inline comments.Sep 20 2021, 12:31 PM
llvm/test/Transforms/OpenMP/spmdization.ll
1873–1874

Will happen eventually.

This revision was landed with ongoing or failed builds.Dec 28 2021, 10:21 PM
This revision was automatically updated to reflect the committed changes.