Page MenuHomePhabricator

[OpenMP] Simplify all stores in the device code
AcceptedPublic

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

Unit TestsFailed

TimeTest
100 msx64 debian > LLVM.Transforms/OpenMP::spmdization.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt --mtriple=amdgcn-amd-amdhsa --data-layout=A5 -S -passes=openmp-opt < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/OpenMP/spmdization.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/OpenMP/spmdization.ll --check-prefixes=AMDGPU
170 msx64 windows > LLVM.Transforms/OpenMP::spmdization.ll
Script: -- : 'RUN: at line 2'; c:\ws\w6\llvm-project\premerge-checks\build\bin\opt.exe --mtriple=amdgcn-amd-amdhsa --data-layout=A5 -S -passes=openmp-opt < C:\ws\w6\llvm-project\premerge-checks\llvm\test\Transforms\OpenMP\spmdization.ll | c:\ws\w6\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w6\llvm-project\premerge-checks\llvm\test\Transforms\OpenMP\spmdization.ll --check-prefixes=AMDGPU

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
2107

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
2107

Will happen eventually.