Files
clang-p2996/llvm/test/CodeGen/AMDGPU/divergence-driven-not-isel.ll
alex-t 1448aa9dbd [AMDGPU] Expand not pattern according to the XOR node divergence
The "not" is defined as XOR $src -1.
 We need to transform this pattern to either S_NOT_B32 or V_NOT_B32_e32
 dependent on the "xor" node divergence.

Reviewed By: rampitec, foad

Differential Revision: https://reviews.llvm.org/D115884
2021-12-20 14:41:38 +03:00

35 lines
882 B
LLVM

; RUN: llc -march=amdgcn -stop-after=amdgpu-isel < %s | FileCheck -check-prefix=GCN %s
; GCN-LABEL: name: scalar_not_i32
; GCN: S_NOT_B32
define amdgpu_kernel void @scalar_not_i32(i32 addrspace(1)* %out, i32 %val) {
%not.val = xor i32 %val, -1
store i32 %not.val, i32 addrspace(1)* %out
ret void
}
; GCN-LABEL: name: scalar_not_i64
; GCN: S_NOT_B64
define amdgpu_kernel void @scalar_not_i64(i64 addrspace(1)* %out, i64 %val) {
%not.val = xor i64 %val, -1
store i64 %not.val, i64 addrspace(1)* %out
ret void
}
; GCN-LABEL: name: vector_not_i32
; GCN: V_NOT_B32_e32
define i32 @vector_not_i32(i32 %val) {
%not.val = xor i32 %val, -1
ret i32 %not.val
}
; GCN-LABEL: name: vector_not_i64
; GCN: V_NOT_B32_e32
; GCN: V_NOT_B32_e32
define i64 @vector_not_i64(i64 %val) {
%not.val = xor i64 %val, -1
ret i64 %not.val
}