Skip to content

Commit dae4222

Browse files
committed
[LLVM 16] Add workaround to translate casts from target ext types to int
This patch should be reverted in the future as it supports translation of invalid SPIR-V modules. Signed-off-by: Sidorov, Dmitry <[email protected]>
1 parent 2e666b9 commit dae4222

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SPIRV/SPIRVReader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,12 @@ Value *SPIRVToLLVM::transConvertInst(SPIRVValue *BV, Function *F,
12041204
CO = Instruction::IntToPtr;
12051205
}
12061206
break;
1207+
// TODO: remove this as it's invalid SPIR-V.
1208+
case OpConvertPtrToU: {
1209+
if (Src->getType()->isTargetExtTy())
1210+
return transSPIRVBuiltinFromInst(BC, BB);
1211+
[[fallthrough]];
1212+
}
12071213
default:
12081214
CO = static_cast<CastInst::CastOps>(OpCodeMap::rmap(BC->getOpCode()));
12091215
}

0 commit comments

Comments
 (0)