@@ -4256,6 +4256,8 @@ Instruction *SPIRVToLLVM::transOCLBuiltinFromExtInst(SPIRVExtInst *BC,
42564256 F->setCallingConv (CallingConv::SPIR_FUNC);
42574257 if (isFuncNoUnwind ())
42584258 F->addFnAttr (Attribute::NoUnwind);
4259+ if (isFuncReadNone (UnmangledName))
4260+ F->addFnAttr (Attribute::ReadNone);
42594261 }
42604262 auto Args = transValue (BC->getValues (BArgs), F, BB);
42614263 SPIRVDBG (dbgs () << " [transOCLBuiltinFromExtInst] Function: " << *F
@@ -4567,3 +4569,34 @@ bool llvm::getSpecConstInfo(std::istream &IS,
45674569 }
45684570 return !IS.fail ();
45694571}
4572+
4573+ // clang-format off
4574+ const StringSet<> SPIRVToLLVM::BuiltInConstFunc {
4575+ " convert" , " get_work_dim" , " get_global_size" , " sub_group_ballot_bit_count" ,
4576+ " get_global_id" , " get_local_size" , " get_local_id" , " get_num_groups" ,
4577+ " get_group_id" , " get_global_offset" , " acos" , " acosh" , " acospi" ,
4578+ " asin" , " asinh" , " asinpi" , " atan" , " atan2" , " atanh" , " atanpi" ,
4579+ " atan2pi" , " cbrt" , " ceil" , " copysign" , " cos" , " cosh" , " cospi" ,
4580+ " erfc" , " erf" , " exp" , " exp2" , " exp10" , " expm1" , " fabs" , " fdim" ,
4581+ " floor" , " fma" , " fmax" , " fmin" , " fmod" , " ilogb" , " ldexp" , " lgamma" ,
4582+ " log" , " log2" , " log10" , " log1p" , " logb" , " mad" , " maxmag" , " minmag" ,
4583+ " nan" , " nextafter" , " pow" , " pown" , " powr" , " remainder" , " rint" ,
4584+ " rootn" , " round" , " rsqrt" , " sin" , " sinh" , " sinpi" , " sqrt" , " tan" ,
4585+ " tanh" , " tanpi" , " tgamma" , " trunc" , " half_cos" , " half_divide" , " half_exp" ,
4586+ " half_exp2" , " half_exp10" , " half_log" , " half_log2" , " half_log10" , " half_powr" ,
4587+ " half_recip" , " half_rsqrt" , " half_sin" , " half_sqrt" , " half_tan" , " native_cos" ,
4588+ " native_divide" , " native_exp" , " native_exp2" , " native_exp10" , " native_log" ,
4589+ " native_log2" , " native_log10" , " native_powr" , " native_recip" , " native_rsqrt" ,
4590+ " native_sin" , " native_sqrt" , " native_tan" , " abs" , " abs_diff" , " add_sat" , " hadd" ,
4591+ " rhadd" , " clamp" , " clz" , " mad_hi" , " mad_sat" , " max" , " min" , " mul_hi" , " rotate" ,
4592+ " sub_sat" , " upsample" , " popcount" , " mad24" , " mul24" , " degrees" , " mix" , " radians" ,
4593+ " step" , " smoothstep" , " sign" , " cross" , " dot" , " distance" , " length" , " normalize" ,
4594+ " fast_distance" , " fast_length" , " fast_normalize" , " isequal" , " isnotequal" ,
4595+ " isgreater" , " isgreaterequal" , " isless" , " islessequal" , " islessgreater" ,
4596+ " isfinite" , " isinf" , " isnan" , " isnormal" , " isordered" , " isunordered" , " signbit" ,
4597+ " any" , " all" , " bitselect" , " select" , " shuffle" , " shuffle2" , " get_image_width" ,
4598+ " get_image_height" , " get_image_depth" , " get_image_channel_data_type" ,
4599+ " get_image_channel_order" , " get_image_dim" , " get_image_array_size" ,
4600+ " get_image_array_size" , " sub_group_inverse_ballot" , " sub_group_ballot_bit_extract" ,
4601+ };
4602+ // clang-format on
0 commit comments