Page MenuHomePhabricator

[AMDGPU] Add llvm.amdgcn.raw.atomic.buffer.load intrinsic to support OpAtomicLoad lowering
Needs ReviewPublic

Authored by mariusz-sikora-at-amd on Nov 28 2022, 3:48 AM.

Details

Summary

This adds llvm.amdgcn.raw.atomic.buffer.load intrinsic to support
OpAtomicLoad lowering on AMDGPU. Previously this was lowered to
llvm.amdgcn.raw.buffer.load which caused the load in some cases
to be marked as invariant and hoisted in LICM.

Diff Detail

Unit TestsFailed

TimeTest
160 msx64 debian > LLVM.Examples/OrcV2Examples::lljit-with-thinlto-summaries.test
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -module-summary /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Examples/OrcV2Examples/Inputs/main-mod.ll -o /var/lib/buildkite-agent/builds/llvm-project/build/test/Examples/OrcV2Examples/Output/main-mod.bc
1,750 msx64 debian > LLVM.Transforms/ArgumentPromotion::inalloca.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/ArgumentPromotion/inalloca.ll -passes='module(globalopt),cgscc(argpromotion),function(sroa)' -S | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Transforms/ArgumentPromotion/inalloca.ll
60,040 msx64 debian > libFuzzer.libFuzzer::minimize_crash.test
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/NullDerefTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/minimize_crash.test.tmp-NullDerefTest

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 3:48 AM
mariusz-sikora-at-amd requested review of this revision.Nov 28 2022, 3:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 3:48 AM
foad added inline comments.Nov 28 2022, 6:13 AM
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.atomic.buffer.load.ll
3

Should test globalisel too.

arsenm added inline comments.Nov 28 2022, 7:10 AM
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
977

We really ought to fix these bypassing the usual atomic memory model stuff

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.atomic.buffer.load.ll
23

Use named values in tests

53

Needs tests with more types. i64, <2 x i16>, <4 x i16>, and some pointers