File: freeze.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (37 lines) | stat: -rw-r--r-- 1,527 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}

; CHECK: OpName %[[Arg1:.*]] "arg1"
; CHECK: OpName %[[Arg2:.*]] "arg2"
; CHECK: OpName %[[NotAStaticPoison:.*]] "poison1"
; CHECK: OpName %[[NotAStaticPoison]] "nil0"
; CHECK: OpName %[[StaticPoisonIntFreeze:.*]] "nil1"
; CHECK: OpName %[[StaticPoisonFloatFreeze:.*]] "nil2"
; CHECK: OpName %[[Arg1]] "val1"
; CHECK: OpName %[[Const100:.*]] "val2"
; CHECK: OpName %[[Const100]] "val3"
; CHECK: OpDecorate
; CHECK-DAG: %[[FloatTy:.*]] = OpTypeFloat 32
; CHECK-DAG: %[[ShortTy:.*]] = OpTypeInt 16 0
; CHECK-DAG: %[[IntTy:.*]] = OpTypeInt 32 0
; CHECK-DAG: %[[Undef:.*]] = OpUndef %[[ShortTy]]
; CHECK-DAG: %[[Const100]] = OpConstant %[[IntTy]] 100
; CHECK-DAG: %[[StaticPoisonIntFreeze]] = OpConstantNull %[[IntTy]]
; CHECK-DAG: %[[StaticPoisonFloatFreeze]] = OpConstantNull %[[FloatTy]]
; CHECK: %[[Arg1]] = OpFunctionParameter %[[FloatTy]]
; CHECK: %[[NotAStaticPoison]] = OpIAdd %[[ShortTy]] %[[Arg2]] %[[Undef]]

target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
target triple = "spir64-unknown-unknown"

define spir_func void @foo(float %arg1, i16 %arg2) {
entry:
  %poison1 = add i16 %arg2, undef
  %nil0 = freeze i16 %poison1
  %nil1 = freeze i32 undef
  %nil2 = freeze float poison
  %val1 = freeze float %arg1
  %val2 = freeze i32 100
  %val3 = freeze i32 %val2
  ret void
}