|
1 | 1 | ;=========================== begin_copyright_notice ============================
|
2 | 2 | ;
|
3 |
| -; Copyright (C) 2022 Intel Corporation |
| 3 | +; Copyright (C) 2022-2023 Intel Corporation |
4 | 4 | ;
|
5 | 5 | ; SPDX-License-Identifier: MIT
|
6 | 6 | ;
|
@@ -70,3 +70,17 @@ define <8 x i8*> @test_vector(<8 x i1> %cond, <8 x i8*> %left, <8 x i8*> %right)
|
70 | 70 | %res = select <8 x i1> %cond, <8 x i8*> %left, <8 x i8*> %right
|
71 | 71 | ret <8 x i8*> %res
|
72 | 72 | }
|
| 73 | + |
| 74 | +; CHECK-LABEL: @test_constexpr |
| 75 | +define float addrspace(1)* @test_constexpr(i1 %cond) { |
| 76 | + ; CHECK: [[SEL_LO:%[^ ]+]] = select i1 %cond, <1 x i32> zeroinitializer, <1 x i32> <i32 ptrtoint (float addrspace(1)* addrspacecast (float addrspace(4)* null to float addrspace(1)*) to i32)> |
| 77 | + ; CHECK: [[SEL_HI:%[^ ]+]] = select i1 %cond, <1 x i32> zeroinitializer, <1 x i32> <i32 trunc (i64 lshr (i64 ptrtoint (float addrspace(1)* addrspacecast (float addrspace(4)* null to float addrspace(1)*) to i64), i64 32) to i32)> |
| 78 | + ; CHECK: [[PART_JOIN:%[^ ]+]] = call <2 x i32> @llvm.genx.wrregioni.v2i32.v1i32.i16.i1(<2 x i32> undef, <1 x i32> [[SEL_LO]], i32 0, i32 1, i32 2, i16 0, i32 undef, i1 true) |
| 79 | + ; CHECK: [[JOIN:%[^ ]+]] = call <2 x i32> @llvm.genx.wrregioni.v2i32.v1i32.i16.i1(<2 x i32> [[PART_JOIN]], <1 x i32> [[SEL_HI]], i32 0, i32 1, i32 2, i16 4, i32 undef, i1 true) |
| 80 | + ; CHECK: [[VCAST:%[^ ]+]] = bitcast <2 x i32> [[JOIN]] to <1 x i64> |
| 81 | + ; CHECK: [[ICAST:%[^ ]+]] = bitcast <1 x i64> [[VCAST]] to i64 |
| 82 | + ; CHECK: [[ITP:%[^ ]+]] = inttoptr i64 [[ICAST]] to float addrspace(1)* |
| 83 | + ; CHECK: ret float addrspace(1)* [[ITP]] |
| 84 | + %res = select i1 %cond, float addrspace(1)* null, float addrspace(1)* addrspacecast(float addrspace(4)* null to float addrspace(1)*) |
| 85 | + ret float addrspace(1)* %res |
| 86 | +} |
0 commit comments