Page MenuHomePhabricator

[AMDGPU] Support for device scope shared variables
AbandonedPublic

Authored by hsmhsm on Oct 21 2020, 12:06 PM.

Details

Reviewers
jdoerfert
Summary

WIP, this patch is uploaded to save the current state of the work,
and is not meant for review at the moment.

Diff Detail

Unit TestsFailed

TimeTest
430 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp
150 mslinux > LLVM.CodeGen/AMDGPU::device-scope-lds-test-lds-with-different-data-types.ll
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -implement-amdgpu-device-scope-shared-variable -S < /mnt/disks/ssd0/agent/llvm-project/llvm/test/CodeGen/AMDGPU/device-scope-lds-test-lds-with-different-data-types.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck -check-prefixes=NEW-LDS,OLD-LDS,NEW-PARAM,GCN /mnt/disks/ssd0/agent/llvm-project/llvm/test/CodeGen/AMDGPU/device-scope-lds-test-lds-with-different-data-types.ll
50 mslinux > SanitizerCommon-Unit._/Sanitizer-x86_64-Test::SanitizerCommon.StackDepotPrint
Note: Google Test filter = SanitizerCommon.StackDepotPrint [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
80 mswindows > LLVM.CodeGen/AMDGPU::device-scope-lds-test-deep-function-calls.ll
Script: -- : 'RUN: at line 1'; c:\ws\w64\llvm-project\premerge-checks\build\bin\opt.exe -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -implement-amdgpu-device-scope-shared-variable -S < C:\ws\w64\llvm-project\premerge-checks\llvm\test\CodeGen\AMDGPU\device-scope-lds-test-deep-function-calls.ll | c:\ws\w64\llvm-project\premerge-checks\build\bin\filecheck.exe -check-prefixes=NEW-LDS,OLD-LDS,NEW-PARAM,GCN C:\ws\w64\llvm-project\premerge-checks\llvm\test\CodeGen\AMDGPU\device-scope-lds-test-deep-function-calls.ll
90 mswindows > LLVM.CodeGen/AMDGPU::device-scope-lds-test-lds-with-different-data-types.ll
Script: -- : 'RUN: at line 1'; c:\ws\w64\llvm-project\premerge-checks\build\bin\opt.exe -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -implement-amdgpu-device-scope-shared-variable -S < C:\ws\w64\llvm-project\premerge-checks\llvm\test\CodeGen\AMDGPU\device-scope-lds-test-lds-with-different-data-types.ll | c:\ws\w64\llvm-project\premerge-checks\build\bin\filecheck.exe -check-prefixes=NEW-LDS,OLD-LDS,NEW-PARAM,GCN C:\ws\w64\llvm-project\premerge-checks\llvm\test\CodeGen\AMDGPU\device-scope-lds-test-lds-with-different-data-types.ll

Event Timeline

hsmhsm created this revision.Oct 21 2020, 12:06 PM
hsmhsm requested review of this revision.Oct 21 2020, 12:06 PM
hsmhsm updated this revision to Diff 299912.Oct 22 2020, 3:36 AM

Implemented few more necessary data structures

hsmhsm updated this revision to Diff 300232.Oct 23 2020, 4:50 AM

Collect all associated LDS globals associated with a kernel.

hsmhsm updated this revision to Diff 301187.Tue, Oct 27, 11:31 PM

Fix bug and compute offset for each LDS

hsmhsm updated this revision to Diff 301850.Fri, Oct 30, 3:43 AM

Completed the handling of direct LDS globals within kernel

hsmhsm updated this revision to Diff 302806.Wed, Nov 4, 3:33 AM

Partial support for indirect LDS globals.

hsmhsm updated this revision to Diff 303232.Thu, Nov 5, 12:54 PM

Code refactoring as per the new logic of processing.

hsmhsm updated this revision to Diff 303764.Mon, Nov 9, 12:28 AM

Support for indirect LDS globals.

hsmhsm updated this revision to Diff 303795.Mon, Nov 9, 2:33 AM

First bug fix.

hsmhsm updated this revision to Diff 303801.Mon, Nov 9, 2:50 AM

Fixes previous incorrect commit.

hsmhsm updated this revision to Diff 303903.Mon, Nov 9, 9:30 AM

First cut of clode clean-up

hsmhsm updated this revision to Diff 304270.Tue, Nov 10, 11:28 AM

Support for replacing constant expressions [in progress].

hsmhsm updated this revision to Diff 304609.Wed, Nov 11, 11:46 AM

Successfully tested simple sum-reduce HIP application.

hsmhsm updated this revision to Diff 304886.Thu, Nov 12, 10:10 AM

Succesfully tested an HIP application which has more than one LDS globals.

hsmhsm updated this revision to Diff 305046.Thu, Nov 12, 11:51 PM

Successfully tested an HIP application which defines different shared
variables of different types within different device functions, and there
exist call graph path from kernel to all these device functions.

hsmhsm updated this revision to Diff 305308.Sat, Nov 14, 3:36 AM

Handle higher dimensional arrays.

hsmhsm updated this revision to Diff 305314.Sat, Nov 14, 7:28 AM

Updated introductory comment.

hsmhsm updated this revision to Diff 305315.Sat, Nov 14, 8:01 AM

Fixed minor bug in the updated code in the last commit.

hsmhsm updated this revision to Diff 305342.Sat, Nov 14, 9:08 PM

Make sure to run this pass as first AMDGPU IR pass.

hsmhsm updated this revision to Diff 305344.Sat, Nov 14, 9:48 PM

Retain original name for new cloned functions.

hsmhsm updated this revision to Diff 305379.Sun, Nov 15, 10:32 AM

Add lit test-cases.

hsmhsm abandoned this revision.Sun, Nov 15, 11:18 PM

This revision was created just for tracking the progress of the work. Now that the code is ready for actual review, I created a new official revision - https://reviews.llvm.org/D91516, and hence closing this revision.