@@ -4090,18 +4090,14 @@ Instruction *SPIRVToLLVM::transOCLBuiltinFromExtInst(SPIRVExtInst *BC,
4090
4090
assert (BB && " Invalid BB" );
4091
4091
std::string MangledName;
4092
4092
SPIRVWord EntryPoint = BC->getExtOp ();
4093
- bool IsVarArg = false ;
4094
- bool IsPrintf = false ;
4095
4093
std::string UnmangledName;
4096
- auto BArgs = BC->getArguments ();
4094
+ std::vector<SPIRVWord> BArgs = BC->getArguments ();
4097
4095
4098
4096
assert (BM->getBuiltinSet (BC->getExtSetId ()) == SPIRVEIS_OpenCL &&
4099
4097
" Not OpenCL extended instruction" );
4100
- if (EntryPoint == OpenCLLIB::Printf)
4101
- IsPrintf = true ;
4102
- else {
4103
- UnmangledName = OCLExtOpMap::map (static_cast <OCLExtOpKind>(EntryPoint));
4104
- }
4098
+
4099
+ bool IsPrintf = (EntryPoint == OpenCLLIB::Printf);
4100
+ UnmangledName = OCLExtOpMap::map (static_cast <OCLExtOpKind>(EntryPoint));
4105
4101
4106
4102
SPIRVDBG (spvdbgs () << " [transOCLBuiltinFromExtInst] OrigUnmangledName: "
4107
4103
<< UnmangledName << ' \n ' );
@@ -4111,21 +4107,16 @@ Instruction *SPIRVToLLVM::transOCLBuiltinFromExtInst(SPIRVExtInst *BC,
4111
4107
4112
4108
if (IsPrintf) {
4113
4109
MangledName = " printf" ;
4114
- IsVarArg = true ;
4115
4110
ArgTypes.resize (1 );
4116
- } else if (UnmangledName.find (" read_image" ) == 0 ) {
4117
- auto ModifiedArgTypes = ArgTypes;
4118
- ModifiedArgTypes[1 ] = getOrCreateOpaquePtrType (M, " opencl.sampler_t" );
4119
- mangleOpenClBuiltin (UnmangledName, ModifiedArgTypes, MangledName);
4120
4111
} else {
4121
4112
mangleOpenClBuiltin (UnmangledName, ArgTypes, MangledName);
4122
4113
}
4123
4114
SPIRVDBG (spvdbgs () << " [transOCLBuiltinFromExtInst] ModifiedUnmangledName: "
4124
4115
<< UnmangledName << " MangledName: " << MangledName
4125
4116
<< ' \n ' );
4126
4117
4127
- FunctionType *FT =
4128
- FunctionType::get ( transType (BC-> getType ()), ArgTypes, IsVarArg);
4118
+ FunctionType *FT = FunctionType::get ( transType (BC-> getType ()), ArgTypes,
4119
+ /* IsVarArg */ IsPrintf );
4129
4120
Function *F = M->getFunction (MangledName);
4130
4121
if (!F) {
4131
4122
F = Function::Create (FT, GlobalValue::ExternalLinkage, MangledName, M);
0 commit comments