Skip to content

Commit 3f6d148

Browse files
author
Dmitry Sidorov
committed
Adjust mini-float conversions mangling for LLVM 15
Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
1 parent 8968573 commit 3f6d148

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lib/SPIRV/SPIRVReader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@ Value *SPIRVToLLVM::transConvertInst(SPIRVValue *BV, Function *F,
12601260
Type *ElementTy = transType(PtrTy->getPointerElementType());
12611261
// LLVM 15 uses typed pointers natively
12621262
OpsTys.emplace_back(PointerType::get(ElementTy, AS));
1263+
Info.getTypeMangleInfo(2).PointerElementType.setPointer(ElementTy);
12631264
MangledName = mangleBuiltin(BuiltinName, OpsTys, &Info);
12641265
}
12651266
}

test/extensions/SPV_INTEL_fp_conversions/spv_intel_fp_conversions.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,17 @@ declare dso_local spir_func i8 @_Z51__builtin_spirv_ClampStochasticRoundBF16ToE5
305305

306306
; CHECK-LLVM-LABEL: hf16_bf8_stochastic_last_seed
307307
; CHECK-LLVM: %[[#Ptr:]] = alloca i32
308-
; CHECK-LLVM: %[[#Call:]] = call i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INTELDhiPc(half 0xH3C00, i32 1, i32* %[[#Ptr]])
308+
; CHECK-LLVM: %[[#Call:]] = call i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INTELDhiPi(half 0xH3C00, i32 1, i32* %[[#Ptr]])
309309
; CHECK-LLVM: ret i8 %[[#Call]]
310310

311311
define spir_func i8 @hf16_bf8_stochastic_last_seed() {
312312
entry:
313313
%0 = alloca i32
314-
%1 = call i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INTELDhiPc(half 1.0, i32 1, i32* %0)
314+
%1 = call i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INTELDhiPi(half 1.0, i32 1, i32* %0)
315315
ret i8 %1
316316
}
317317

318-
declare dso_local spir_func i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INTELDhiPc(half, i32, i32*)
318+
declare dso_local spir_func i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INTELDhiPi(half, i32, i32*)
319319

320320
; CHECK-SPIRV: Function [[#]] [[#hf16_int4_stochastic_last_seed]] [[#]]
321321
; CHECK-SPIRV: Variable [[#]] [[#Ptr:]]
@@ -324,17 +324,17 @@ declare dso_local spir_func i8 @_Z46__builtin_spirv_StochasticRoundFP16ToE5M2INT
324324

325325
; CHECK-LLVM-LABEL: hf16_int4_stochastic_last_seed
326326
; CHECK-LLVM: %[[#Ptr:]] = alloca i32
327-
; CHECK-LLVM: %[[#Call:]] = call i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToInt4INTELDhiPc(half 0xH3C00, i32 1, i32* %[[#Ptr]])
327+
; CHECK-LLVM: %[[#Call:]] = call i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToInt4INTELDhiPi(half 0xH3C00, i32 1, i32* %[[#Ptr]])
328328
; CHECK-LLVM: ret i4 %[[#Call]]
329329

330330
define spir_func i4 @hf16_int4_stochastic_last_seed() {
331331
entry:
332332
%0 = alloca i32
333-
%1 = call i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToInt4INTELDhiPc(half 1.0, i32 1, i32* %0)
333+
%1 = call i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToInt4INTELDhiPi(half 1.0, i32 1, i32* %0)
334334
ret i4 %1
335335
}
336336

337-
declare dso_local spir_func i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToInt4INTELDhiPc(half, i32, i32*)
337+
declare dso_local spir_func i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToInt4INTELDhiPi(half, i32, i32*)
338338

339339
; CHECK-SPIRV: Function [[#]] [[#hf16_bf8_clamp_stochastic_last_seed]] [[#]]
340340
; CHECK-SPIRV: Variable [[#]] [[#Ptr:]]
@@ -344,14 +344,14 @@ declare dso_local spir_func i4 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToIn
344344

345345
; CHECK-LLVM-LABEL: hf16_bf8_clamp_stochastic_last_seed
346346
; CHECK-LLVM: %[[#Ptr:]] = alloca i32
347-
; CHECK-LLVM: %[[#Call:]] = call i8 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToE5M2INTELDhiPc(half 0xH3C00, i32 1, i32* %[[#Ptr]])
347+
; CHECK-LLVM: %[[#Call:]] = call i8 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToE5M2INTELDhiPi(half 0xH3C00, i32 1, i32* %[[#Ptr]])
348348
; CHECK-LLVM: ret i8 %[[#Call]]
349349

350350
define spir_func i8 @hf16_bf8_clamp_stochastic_last_seed() {
351351
entry:
352352
%0 = alloca i32
353-
%1 = call i8 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToE5M2INTELDhiPc(half 1.0, i32 1, i32* %0)
353+
%1 = call i8 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToE5M2INTELDhiPi(half 1.0, i32 1, i32* %0)
354354
ret i8 %1
355355
}
356356

357-
declare dso_local spir_func i8 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToE5M2INTELDhiPc(half, i32, i32*)
357+
declare dso_local spir_func i8 @_Z51__builtin_spirv_ClampStochasticRoundFP16ToE5M2INTELDhiPi(half, i32, i32*)

0 commit comments

Comments
 (0)