-
Notifications
You must be signed in to change notification settings - Fork 794
[SYCLLowerIR][GlobalOffset] Fix collection order of load's defs #20428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
cc75265
e4167e6
e986c0b
030a41e
88ffae7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ; RUN: opt -bugpoint-enable-legacy-pm -globaloffset %s -S -o - | FileCheck %s | ||
|
|
||
| ; Check that phi is correctly handled in load's defs collection. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
done, updated the test to have detailed check, thanks |
||
|
|
||
| target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9" | ||
| target triple = "amdgcn-amd-amdhsa" | ||
|
|
||
| define internal i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 %0) { | ||
| ; CHECK-NOT: call ptr addrspace(5) @llvm.amdgcn.implicit.offset() | ||
|
|
||
| switch i32 %0, label %14 [ | ||
| i32 0, label %2 | ||
| i32 1, label %4 | ||
| i32 2, label %7 | ||
| ] | ||
|
|
||
| 2: ; preds = %1 | ||
| %3 = tail call ptr addrspace(5) @llvm.amdgcn.implicit.offset() | ||
| br label %10 | ||
|
|
||
| 4: ; preds = %1 | ||
| %5 = tail call ptr addrspace(5) @llvm.amdgcn.implicit.offset() | ||
| %6 = getelementptr inbounds nuw i8, ptr addrspace(5) %5, i32 4 | ||
| br label %10 | ||
|
|
||
| 7: ; preds = %1 | ||
| %8 = tail call ptr addrspace(5) @llvm.amdgcn.implicit.offset() | ||
| %9 = getelementptr inbounds nuw i8, ptr addrspace(5) %8, i32 8 | ||
| br label %10 | ||
|
|
||
| 10: ; preds = %7, %4, %2 | ||
| %11 = phi ptr addrspace(5) [ %3, %2 ], [ %6, %4 ], [ %9, %7 ] | ||
| %12 = load i32, ptr addrspace(5) %11, align 4 | ||
| %13 = load i32, ptr addrspace(5) %11, align 4 | ||
| ret i64 0 | ||
|
|
||
| 14: ; preds = %1 | ||
| unreachable | ||
| } | ||
|
|
||
| declare ptr addrspace(5) @llvm.amdgcn.implicit.offset() | ||
|
|
||
| !llvm.module.flags = !{!0} | ||
|
|
||
| !0 = !{i32 1, !"sycl-device", i32 1} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ; RUN: opt -bugpoint-enable-legacy-pm -globaloffset %s -S -o - | FileCheck %s | ||
|
|
||
| target datalayout = "e-p6:32:32-i64:64-i128:128-i256:256-v16:16-v32:32-n16:32:64" | ||
| target triple = "nvptx64-nvidia-cuda" | ||
|
|
||
| declare ptr @llvm.nvvm.implicit.offset() | ||
|
|
||
| define weak_odr dso_local ptx_kernel void @test() { | ||
| entry: | ||
| ; CHECK-NOT: call ptr @llvm.nvvm.implicit.offset() | ||
|
|
||
| %0 = tail call ptr @llvm.nvvm.implicit.offset() | ||
| %1 = getelementptr inbounds nuw i8, ptr %0, i64 4 | ||
| %2 = load i32, ptr %1, align 4 | ||
| %3 = load i32, ptr %0, align 4 | ||
| ret void | ||
| } | ||
|
|
||
| !llvm.module.flags = !{!0} | ||
|
|
||
| !0 = !{i32 1, !"sycl-device", i32 1} |
Uh oh!
There was an error while loading. Please reload this page.