|
2 | 2 | // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -O1 -o - | FileCheck %s
|
3 | 3 |
|
4 | 4 | // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x half> @_Z13test_lit_halfDhDhDh(
|
5 |
| -// CHECK-SAME: half noundef nofpclass(nan inf) [[N_DOT_L:%.*]], half noundef nofpclass(nan inf) [[N_DOT_H:%.*]], half noundef nofpclass(nan inf) [[M:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 5 | +// CHECK-SAME: half noundef nofpclass(nan inf) [[NDOTL:%.*]], half noundef nofpclass(nan inf) [[NDOTH:%.*]], half noundef nofpclass(nan inf) [[M:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
6 | 6 | // CHECK-NEXT: [[ENTRY:.*:]]
|
7 |
| -// CHECK-NEXT: [[CMP_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt half [[N_DOT_L]], 0xH0000 |
8 |
| -// CHECK-NEXT: [[HLSL_SELECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.maxnum.f16(half [[N_DOT_L]], half 0xH0000) |
| 7 | +// CHECK-NEXT: [[CMP_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt half [[NDOTL]], 0xH0000 |
| 8 | +// CHECK-NEXT: [[HLSL_SELECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.maxnum.f16(half [[NDOTL]], half 0xH0000) |
9 | 9 | // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x half> <half 0xH3C00, half poison, half poison, half 0xH3C00>, half [[HLSL_SELECT_I]], i64 1
|
10 |
| -// CHECK-NEXT: [[CMP4_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt half [[N_DOT_H]], 0xH0000 |
| 10 | +// CHECK-NEXT: [[CMP4_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt half [[NDOTH]], 0xH0000 |
11 | 11 | // CHECK-NEXT: [[HLSL_OR_I:%.*]] = or i1 [[CMP_I]], [[CMP4_I]]
|
12 |
| -// CHECK-NEXT: [[ELT_LOG_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.log.f16(half [[N_DOT_H]]) |
| 12 | +// CHECK-NEXT: [[ELT_LOG_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.log.f16(half [[NDOTH]]) |
13 | 13 | // CHECK-NEXT: [[MUL_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half [[ELT_LOG_I]], [[M]]
|
14 | 14 | // CHECK-NEXT: [[ELT_EXP_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn half @llvm.exp.f16(half [[MUL_I]])
|
15 | 15 | // CHECK-NEXT: [[HLSL_SELECT7_I:%.*]] = select reassoc nnan ninf nsz arcp afn i1 [[HLSL_OR_I]], half 0xH0000, half [[ELT_EXP_I]]
|
16 | 16 | // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x half> [[VECINIT2_I]], half [[HLSL_SELECT7_I]], i64 2
|
17 | 17 | // CHECK-NEXT: ret <4 x half> [[VECINS_I]]
|
18 | 18 | //
|
19 |
| -half4 test_lit_half(half N_dot_l, half N_dot_h, half M) { return lit(N_dot_l, N_dot_h, M); } |
| 19 | +half4 test_lit_half(half NDotL, half NDotH, half M) { return lit(NDotL, NDotH, M); } |
20 | 20 |
|
21 | 21 | // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z14test_lit_floatfff(
|
22 |
| -// CHECK-SAME: float noundef nofpclass(nan inf) [[N_DOT_L:%.*]], float noundef nofpclass(nan inf) [[N_DOT_H:%.*]], float noundef nofpclass(nan inf) [[M:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 22 | +// CHECK-SAME: float noundef nofpclass(nan inf) [[NDOTL:%.*]], float noundef nofpclass(nan inf) [[NDOTH:%.*]], float noundef nofpclass(nan inf) [[M:%.*]]) local_unnamed_addr #[[ATTR0]] { |
23 | 23 | // CHECK-NEXT: [[ENTRY:.*:]]
|
24 |
| -// CHECK-NEXT: [[CMP_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt float [[N_DOT_L]], 0.000000e+00 |
25 |
| -// CHECK-NEXT: [[HLSL_SELECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.maxnum.f32(float [[N_DOT_L]], float 0.000000e+00) |
| 24 | +// CHECK-NEXT: [[CMP_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt float [[NDOTL]], 0.000000e+00 |
| 25 | +// CHECK-NEXT: [[HLSL_SELECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.maxnum.f32(float [[NDOTL]], float 0.000000e+00) |
26 | 26 | // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float 1.000000e+00>, float [[HLSL_SELECT_I]], i64 1
|
27 |
| -// CHECK-NEXT: [[CMP4_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt float [[N_DOT_H]], 0.000000e+00 |
| 27 | +// CHECK-NEXT: [[CMP4_I:%.*]] = fcmp reassoc nnan ninf nsz arcp afn olt float [[NDOTH]], 0.000000e+00 |
28 | 28 | // CHECK-NEXT: [[HLSL_OR_I:%.*]] = or i1 [[CMP_I]], [[CMP4_I]]
|
29 |
| -// CHECK-NEXT: [[ELT_LOG_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float [[N_DOT_H]]) |
| 29 | +// CHECK-NEXT: [[ELT_LOG_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float [[NDOTH]]) |
30 | 30 | // CHECK-NEXT: [[MUL_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[ELT_LOG_I]], [[M]]
|
31 | 31 | // CHECK-NEXT: [[ELT_EXP_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(float [[MUL_I]])
|
32 | 32 | // CHECK-NEXT: [[HLSL_SELECT7_I:%.*]] = select reassoc nnan ninf nsz arcp afn i1 [[HLSL_OR_I]], float 0.000000e+00, float [[ELT_EXP_I]]
|
33 | 33 | // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float [[HLSL_SELECT7_I]], i64 2
|
34 | 34 | // CHECK-NEXT: ret <4 x float> [[VECINS_I]]
|
35 | 35 | //
|
36 |
| -float4 test_lit_float(float N_dot_l, float N_dot_h, float M) { return lit(N_dot_l, N_dot_h, M); } |
| 36 | +float4 test_lit_float(float NDotL, float NDotH, float M) { return lit(NDotL, NDotH, M); } |
0 commit comments