Skip to content

Commit b6cef74

Browse files
Add additional check to demonstrate E2E impact of this optimization
1 parent c083530 commit b6cef74

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

llvm/test/Transforms/InstCombine/AMDGPU/llvm.amdgcn.ballot-assume-wave32.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -mattr=+wavefrontsize32 -passes=instcombine -S | FileCheck %s
3+
; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -mattr=+wavefrontsize32 -O2 -S | FileCheck %s --check-prefix=O2
34
;
45
; Wave32-specific tests for ballot-assume optimizations.
56
; - ballot.i32 should optimize (captures all 32 lanes)
@@ -25,6 +26,10 @@ define amdgpu_kernel void @wave32_ballot_i32_all_lanes(i32 %x, ptr addrspace(1)
2526
; CHECK-NEXT: ret void
2627
; CHECK: bar:
2728
; CHECK-NEXT: ret void
29+
;
30+
; O2-LABEL: @wave32_ballot_i32_all_lanes(
31+
; O2-NEXT: common.ret:
32+
; O2-NEXT: ret void
2833
;
2934
%cmp = icmp eq i32 %x, 0
3035
%ballot = call i32 @llvm.amdgcn.ballot.i32(i1 %cmp)

llvm/test/Transforms/InstCombine/AMDGPU/llvm.amdgcn.ballot-assume-wave64.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -mattr=+wavefrontsize64 -passes=instcombine -S | FileCheck %s
3+
; RUN: opt < %s -mtriple=amdgcn-amd-amdhsa -mattr=+wavefrontsize64 -O2 -S | FileCheck %s --check-prefix=O2
34
;
45
; Wave64-specific tests for ballot-assume optimizations.
56
; - ballot.i64 should optimize (captures all 64 lanes)
@@ -25,6 +26,10 @@ define amdgpu_kernel void @wave64_ballot_i64_all_lanes(i32 %x, ptr addrspace(1)
2526
; CHECK-NEXT: ret void
2627
; CHECK: bar:
2728
; CHECK-NEXT: ret void
29+
;
30+
; O2-LABEL: @wave64_ballot_i64_all_lanes(
31+
; O2-NEXT: common.ret:
32+
; O2-NEXT: ret void
2833
;
2934
%cmp = icmp eq i32 %x, 0
3035
%ballot = call i64 @llvm.amdgcn.ballot.i64(i1 %cmp)

0 commit comments

Comments
 (0)