intel / intel/llvm

[HIP] accessor.cpp failing after AA change in a30e50fcb31

Open
#16,505 1 comment 0 reactions 1 assignee Claimed by @frasercrmck View on GitHub
bug hip pdtracker
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

### Describe the bug

After https://github.com/intel/llvm/commit/a30e50fcb3119cc1f84f0398d229a929f296188d, the EarlyCSE (and GVN) might get confused by the aliasing related to the negative offset in GEP and address space cast.

```
--- g.log 2025-01-01 17:05:49.327276619 -0800
+++ b.log 2025-01-02 08:55:31.176390278 -0800
@@ -2289,8 +2289,7 @@
call void @llvm.experimental.noalias.scope.decl(metadata !209)
%add9.i = add nsw i32 %2, %add.i
store i32 %add9.i, ptr %incdec.ptr.i, align 4, !tbaa !90
- %3 = load i32, ptr addrspace(3) %_arg_LocalAcc20, align 4, !tbaa !90
- store i32 %3, ptr addrspace(1) %_arg_Acc24, align 4, !tbaa !90
+ store i32 32, ptr addrspace(1) %_arg_Acc24, align 4, !tbaa !90
ret void
}

```

The test is XFAILed in pulldown, please investigate/fix and UnXFAIL it.

https://github.com/intel/llvm/actions/runs/12563446905/job/35025604202

```
FAIL: SYCL :: Basic/accessor/accessor.cpp (250 of 2239)
******************** TEST 'SYCL :: Basic/accessor/accessor.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 1
/__w/llvm/llvm/toolchain/bin//clang++ -Werror -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1031 -fsycl -fsycl-targets=amdgcn-amd-amdhsa /__w/llvm/llvm/llvm/sycl/test-e2e/Basic/accessor/accessor.cpp -DSYCL2020_DISABLE_DEPRECATION_WARNINGS -o /__w/llvm/llvm/build-e2e/Basic/accessor/Output/accessor.cpp.tmp.out
# executed command: /__w/llvm/llvm/toolchain/bin//clang++ -Werror -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1031 -fsycl -fsycl-targets=amdgcn-amd-amdhsa /__w/llvm/llvm/llvm/sycl/test-e2e/Basic/accessor/accessor.cpp -DSYCL2020_DISABLE_DEPRECATION_WARNINGS -o /__w/llvm/llvm/build-e2e/Basic/accessor/Output/accessor.cpp.tmp.out
# note: command had no output on stdout or stderr
# RUN: at line 2
env UR_HIP_ENABLE_IMAGE_SUPPORT=1 ONEAPI_DEVICE_SELECTOR=hip:gpu /__w/llvm/llvm/build-e2e/Basic/accessor/Output/accessor.cpp.tmp.out
# executed command: env UR_HIP_ENABLE_IMAGE_SUPPORT=1 ONEAPI_DEVICE_SELECTOR=hip:gpu /__w/llvm/llvm/build-e2e/Basic/accessor/Output/accessor.cpp.tmp.out
# .---command stdout------------
# | exception received: placeholder accessor must be bound by calling handler::require() before it can be used.
# | exception received: placeholder accessor must be bound by calling handler::require() before it can be used.
# | exception received: placeholder accessor must be bound by calling handler::require() before it can be used.
# | exception received: placeholder accessor must be bound by calling handler::require() before it can be used.
# | SYCL exception caught: A local accessor must not be used in a SYCL kernel function that is invoked via single_task or via the simple form of parallel_for that takes a range parameter.
# | SYCL exception caught: A local accessor must not be used in a SYCL kernel function that is invoked via single_task or via the simple form of parallel_for that takes a range parameter.
# `-----------------------------
# .---command stderr------------
# | accessor.cpp.tmp.out: /__w/llvm/llvm/llvm/sycl/test-e2e/Basic/accessor/accessor.cpp:1[29](https://github.com/intel/llvm/actions/runs/12565145323/job/35029218571#step:24:30)8: int main(): Assertion `Data == 96' failed.
# `-----------------------------
# error: command failed with exit status: -6

--
```

### To reproduce

_No response_

### Environment

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.