Skip to content

Commit 10b18e1

Browse files
committed
Remove commented-out code; add integer/literal test
1 parent 6c4ae27 commit 10b18e1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2919,8 +2919,6 @@ static SPIRVType *getInlineSpirvType(const TargetExtType *ExtensionType,
29192919
}
29202920
return Instr;
29212921
});
2922-
2923-
// GR->getOrCreateSPIRVArrayType();
29242922
}
29252923

29262924
namespace SPIRV {

llvm/test/CodeGen/SPIRV/inline/type.ll

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
; CHECK: [[image_t:%[0-9]+]] = OpTypeImage %3 2D 2 0 0 1 Unknown
88
%type_2d_image = type target("spirv.Image", float, 1, 2, 0, 0, 1, 0)
99

10-
%literal_false = type target("spirv.Literal", 0)
11-
%literal_8 = type target("spirv.Literal", 8)
10+
%literal_true = type target("spirv.Literal", 1)
11+
%literal_32 = type target("spirv.Literal", 32)
1212

1313
; CHECK: [[uint32_4:%[0-9]+]] = OpConstant [[uint32_t]] 4
1414
%integral_constant_4 = type target("spirv.IntegralConstant", i32, 4)
@@ -18,15 +18,26 @@
1818

1919
; CHECK: [[getTexArray_t:%[0-9]+]] = OpTypeFunction [[array_t]]
2020

21+
; CHECK: !0x40015 [[int_t:%[0-9]+]] 32 1
22+
%int_t = type target("spirv.Type", %literal_32, %literal_true, 21, 0, 0)
23+
24+
; CHECK: [[getInt_t:%[0-9]+]] = OpTypeFunction [[int_t]]
25+
2126
; CHECK: [[getTexArray:%[0-9]+]] = OpFunction [[array_t]] None [[getTexArray_t]]
2227
declare %ArrayTex2D @getTexArray()
2328

29+
; CHECK: [[getInt:%[0-9]+]] = OpFunction [[int_t]] None [[getInt_t]]
30+
declare %int_t @getInt()
31+
2432
define void @main() #1 {
2533
entry:
2634
%images = alloca %ArrayTex2D
2735

2836
; CHECK: {{%[0-9]+}} = OpFunctionCall [[array_t]] [[getTexArray]]
2937
%retTex = call %ArrayTex2D @getTexArray()
3038

39+
; CHECK: {{%[0-9]+}} = OpFunctionCall [[int_t]] [[getInt]]
40+
%i = call %int_t @getInt()
41+
3142
ret void
3243
}

0 commit comments

Comments
 (0)