|
1 | 1 | // RUN: %clang_cc1 -finclude-default-header -triple \ |
2 | 2 | // RUN: dxil-pc-shadermodel6.3-library %s \ |
3 | | -// RUN: -emit-llvm -O1 -o - | FileCheck %s |
| 3 | +// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s |
4 | 4 |
|
5 | | -//CHECK-LABEL: define noundef i1 @_Z15test_and_scalarbb( |
6 | | -//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
7 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
8 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = or i1 [[X]], [[Y]] |
9 | | -//CHECK-NEXT: ret i1 [[HLSL_OR]] |
10 | | -//CHECK-NEXT: } |
11 | | -bool test_and_scalar(bool x, bool y) |
| 5 | +//CHECK-LABEL: define noundef i1 @_Z14test_or_scalarbb( |
| 6 | +//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]]) #[[ATTR0:[0-9]+]] { |
| 7 | +//CHECK-NEXT: entry: |
| 8 | +//CHECK: [[HLSL_OR:%.*]] = or i1 [[A:%.*]], [[B:%.*]] |
| 9 | +//CHECK: ret i1 [[HLSL_OR]] |
| 10 | +bool test_or_scalar(bool x, bool y) |
12 | 11 | { |
13 | 12 | return or(x, y); |
14 | 13 | } |
15 | 14 |
|
16 | 15 | //CHECK-LABEL: define noundef <2 x i1> @_Z13test_or_bool2Dv2_bS_( |
17 | | -//CHECK-SAME: <2 x i1> noundef [[X:%.*]], <2 x i1> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] { |
18 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
19 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = or <2 x i1> [[X]], [[Y]] |
20 | | -//CHECK-NEXT: ret <2 x i1> [[HLSL_OR]] |
21 | | -//CHECK-NEXT: } |
| 16 | +//CHECK-SAME: <2 x i1> noundef [[X:%.*]], <2 x i1> noundef [[Y:%.*]]) #[[ATTR0]] { |
| 17 | +//CHECK-NEXT: entry: |
| 18 | +//CHECK: [[HLSL_OR:%.*]] = or <2 x i1> [[A:%.*]], [[B:%.*]] |
| 19 | +//CHECK: ret <2 x i1> [[HLSL_OR]] |
22 | 20 | bool2 test_or_bool2(bool2 x, bool2 y) |
23 | 21 | { |
24 | 22 | return or(x, y); |
25 | 23 | } |
26 | 24 |
|
27 | 25 | //CHECK-LABEL: define noundef <3 x i1> @_Z13test_or_bool3Dv3_bS_( |
28 | | -//CHECK-SAME: <3 x i1> noundef [[X:%.*]], <3 x i1> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] { |
29 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
30 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = or <3 x i1> [[X]], [[Y]] |
31 | | -//CHECK-NEXT: ret <3 x i1> [[HLSL_OR]] |
32 | | -//CHECK-NEXT: } |
| 26 | +//CHECK-SAME: <3 x i1> noundef [[X:%.*]], <3 x i1> noundef [[Y:%.*]]) #[[ATTR0]] { |
| 27 | +//CHECK-NEXT: entry: |
| 28 | +//CHECK: [[HLSL_OR:%.*]] = or <3 x i1> [[A:%.*]], [[B:%.*]] |
| 29 | +//CHECK: ret <3 x i1> [[HLSL_OR]] |
33 | 30 | bool3 test_or_bool3(bool3 x, bool3 y) |
34 | 31 | { |
35 | 32 | return or(x, y); |
36 | 33 | } |
37 | 34 |
|
38 | 35 | //CHECK-LABEL: define noundef <4 x i1> @_Z13test_or_bool4Dv4_bS_( |
39 | | -//CHECK-SAME: <4 x i1> noundef [[X:%.*]], <4 x i1> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] { |
40 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
41 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = or <4 x i1> [[X]], [[Y]] |
42 | | -//CHECK-NEXT: ret <4 x i1> [[HLSL_OR]] |
43 | | -//CHECK-NEXT: } |
| 36 | +//CHECK-SAME: <4 x i1> noundef [[X:%.*]], <4 x i1> noundef [[Y:%.*]]) #[[ATTR0]] { |
| 37 | +//CHECK-NEXT: entry: |
| 38 | +//CHECK: [[HLSL_OR:%.*]] = or <4 x i1> [[A:%.*]], [[B:%.*]] |
| 39 | +//CHECK: ret <4 x i1> [[HLSL_OR]] |
44 | 40 | bool4 test_or_bool4(bool4 x, bool4 y) |
45 | 41 | { |
46 | 42 | return or(x, y); |
47 | 43 | } |
48 | 44 |
|
49 | 45 | //CHECK-LABEL: define noundef i1 @_Z11test_or_intii( |
50 | | -//CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] { |
51 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
52 | | -//CHECK-NEXT: [[A:%.*]] = or i32 [[Y]], [[X]] |
53 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = icmp ne i32 [[A]], 0 |
54 | | -//CHECK-NEXT: ret i1 [[HLSL_OR]] |
55 | | -//CHECK-NEXT: } |
| 46 | +//CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) #[[ATTR0]] { |
| 47 | +//CHECK-NEXT: entry: |
| 48 | +//CHECK: [[TOBBOL:%.*]] = icmp ne i32 [[A:%.*]], 0 |
| 49 | +//CHECK: [[TOBBOL1:%.*]] = icmp ne i32 [[B:%.*]], 0 |
| 50 | +//CHECK: [[HLSL_OR:%.*]] = or i1 [[TOBBOL]], [[TOBBOL1]] |
| 51 | +//CHECK: ret i1 [[HLSL_OR]] |
56 | 52 | bool test_or_int(int x, int y) |
57 | 53 | { |
58 | 54 | return or(x, y); |
59 | 55 | } |
60 | 56 |
|
61 | 57 | //CHECK-LABEL: define noundef <4 x i1> @_Z12test_or_int4Dv4_iS_( |
62 | | -//CHECK-SAME: <4 x i32> noundef [[X:%.*]], <4 x i32> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] { |
63 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
64 | | -//CHECK-NEXT: [[A:%.*]] = or <4 x i32> [[Y]], [[X]] |
65 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = icmp ne <4 x i32> [[A]], zeroinitializer |
66 | | -//CHECK-NEXT: ret <4 x i1> [[HLSL_OR]] |
67 | | -//CHECK-NEXT: } |
| 58 | +//CHECK-SAME: <4 x i32> noundef [[X:%.*]], <4 x i32> noundef [[Y:%.*]]) #[[ATTR0]] { |
| 59 | +//CHECK-NEXT: entry: |
| 60 | +//CHECK: [[TOBOOL:%.*]] = icmp ne <4 x i32> [[A:%.*]], zeroinitializer |
| 61 | +//CHECK: [[TOBOOL1:%.*]] = icmp ne <4 x i32> [[B:%.*]], zeroinitializer |
| 62 | +//CHECK: [[HLSL_OR:%.*]] = or <4 x i1> [[TOBOOL]], [[TOBOOL1]] |
| 63 | +//CHECK: ret <4 x i1> [[HLSL_OR]] |
68 | 64 | bool4 test_or_int4(int4 x, int4 y) |
69 | 65 | { |
70 | 66 | return or(x, y); |
71 | 67 | } |
72 | 68 |
|
73 | | -//CHECK-LABEL: noundef <4 x i1> @_Z14test_or_float4Dv4_fS_( |
74 | | -//CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[X:%.*]], <4 x float> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] { |
75 | | -//CHECK-NEXT: [[ENTRY:.*:]] |
76 | | -//CHECK-NEXT: [[TOBOOL:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[X]], zeroinitializer |
77 | | -//CHECK-NEXT: [[TOBOOL1:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[Y]], zeroinitializer |
78 | | -//CHECK-NEXT: [[HLSL_OR:%.*]] = or <4 x i1> [[TOBOOL]], [[TOBOOL1]] |
79 | | -//CHECK-NEXT: ret <4 x i1> [[HLSL_OR]] |
80 | | -//CHECK-NEXT: } |
| 69 | +//CHECK-LABEL: define noundef <4 x i1> @_Z14test_or_float4Dv4_fS_( |
| 70 | +//CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[X:%.*]], <4 x float> noundef nofpclass(nan inf) [[Y:%.*]]) #[[ATTR0]] { |
| 71 | +//CHECK-NEXT: entry: |
| 72 | +//CHECK: [[TOBOOL:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[A:%.*]], zeroinitializer |
| 73 | +//CHECK: [[TOBOOL1:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[B:%.*]], zeroinitializer |
| 74 | +//CHECK: [[HLSL_OR:%.*]] = or <4 x i1> [[TOBOOL]], [[TOBOOL1]] |
| 75 | +//CHECK: ret <4 x i1> [[HLSL_OR]] |
81 | 76 | bool4 test_or_float4(float4 x, float4 y) |
82 | 77 | { |
83 | 78 | return or(x, y); |
|
0 commit comments