aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/SPIRV/llvm-intrinsics/ctlz.ll
blob: 480ea761a669cfb5757e136647aac921673962bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s

; CHECK: %[[#extinst_id:]] = OpExtInstImport "OpenCL.std"

; CHECK: OpFunction
; CHECK: %[[#]] = OpExtInst %[[#]] %[[#extinst_id]] clz
; CHECK: OpFunctionEnd

define spir_func i32 @TestClz(i32 %x) local_unnamed_addr {
entry:
  %0 = tail call i32 @llvm.ctlz.i32(i32 %x, i1 true)
  ret i32 %0
}

declare i32 @llvm.ctlz.i32(i32, i1 immarg)