@@ -1035,12 +1035,11 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1035
1035
setVarArg (1 );
1036
1036
else if (NameRef.starts_with (" write_imageui" ))
1037
1037
addUnsignedArg (2 );
1038
- else if (NameRef. equals ( " prefetch" ) ) {
1038
+ else if (NameRef == " prefetch" ) {
1039
1039
addUnsignedArg (1 );
1040
1040
setArgAttr (0 , SPIR::ATTR_CONST);
1041
- } else if (NameRef.equals (" get_kernel_work_group_size" ) ||
1042
- NameRef.equals (
1043
- " get_kernel_preferred_work_group_size_multiple" )) {
1041
+ } else if (NameRef == " get_kernel_work_group_size" ||
1042
+ NameRef == " get_kernel_preferred_work_group_size_multiple" ) {
1044
1043
assert (F && " lack of necessary information" );
1045
1044
const size_t BlockArgIdx = 0 ;
1046
1045
FunctionType *InvokeTy = getBlockInvokeTy (F, BlockArgIdx);
@@ -1049,19 +1048,18 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1049
1048
} else if (NameRef.starts_with (" __enqueue_kernel" )) {
1050
1049
// clang doesn't mangle enqueue_kernel builtins
1051
1050
setAsDontMangle ();
1052
- } else if (NameRef.starts_with (" get_" ) || NameRef. equals ( " nan" ) ||
1053
- NameRef. equals ( " mem_fence" ) || NameRef.starts_with (" shuffle" )) {
1051
+ } else if (NameRef.starts_with (" get_" ) || NameRef == " nan" ||
1052
+ NameRef == " mem_fence" || NameRef.starts_with (" shuffle" )) {
1054
1053
addUnsignedArg (-1 );
1055
1054
if (NameRef.starts_with (kOCLBuiltinName ::GetFence)) {
1056
1055
setArgAttr (0 , SPIR::ATTR_CONST);
1057
1056
addVoidPtrArg (0 );
1058
1057
}
1059
1058
} else if (NameRef.contains (" barrier" )) {
1060
1059
addUnsignedArg (0 );
1061
- if (NameRef.equals (" work_group_barrier" ) ||
1062
- NameRef.equals (" sub_group_barrier" ) ||
1063
- NameRef.equals (" intel_work_group_barrier_arrive" ) ||
1064
- NameRef.equals (" intel_work_group_barrier_wait" ))
1060
+ if (NameRef == " work_group_barrier" || NameRef == " sub_group_barrier" ||
1061
+ NameRef == " intel_work_group_barrier_arrive" ||
1062
+ NameRef == " intel_work_group_barrier_wait" )
1065
1063
setEnumArg (1 , SPIR::PRIMITIVE_MEMORY_SCOPE);
1066
1064
} else if (NameRef.starts_with (" atomic_work_item_fence" )) {
1067
1065
addUnsignedArg (0 );
@@ -1117,35 +1115,33 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1117
1115
NameRef = NameRef.drop_front (1 );
1118
1116
UnmangledName.erase (0 , 1 );
1119
1117
} else if (NameRef.starts_with (" s_" )) {
1120
- if (NameRef. equals ( " s_upsample" ) )
1118
+ if (NameRef == " s_upsample" )
1121
1119
addUnsignedArg (1 );
1122
1120
NameRef = NameRef.drop_front (2 );
1123
1121
} else if (NameRef.starts_with (" u_" )) {
1124
1122
addUnsignedArg (-1 );
1125
1123
NameRef = NameRef.drop_front (2 );
1126
- } else if (NameRef. equals ( " fclamp" ) ) {
1124
+ } else if (NameRef == " fclamp" ) {
1127
1125
NameRef = NameRef.drop_front (1 );
1128
1126
}
1129
1127
// handle [read|write]pipe builtins (plus two i32 literal args
1130
1128
// required by SPIR 2.0 provisional specification):
1131
- else if (NameRef. equals ( " read_pipe_2" ) || NameRef. equals ( " write_pipe_2" ) ) {
1129
+ else if (NameRef == " read_pipe_2" || NameRef == " write_pipe_2" ) {
1132
1130
// with 2 arguments (plus two i32 literals):
1133
1131
// int read_pipe (read_only pipe gentype p, gentype *ptr)
1134
1132
// int write_pipe (write_only pipe gentype p, const gentype *ptr)
1135
1133
addVoidPtrArg (1 );
1136
1134
addUnsignedArg (2 );
1137
1135
addUnsignedArg (3 );
1138
1136
// OpenCL-like representation of blocking pipes
1139
- } else if (NameRef.equals (" read_pipe_2_bl" ) ||
1140
- NameRef.equals (" write_pipe_2_bl" )) {
1137
+ } else if (NameRef == " read_pipe_2_bl" || NameRef == " write_pipe_2_bl" ) {
1141
1138
// with 2 arguments (plus two i32 literals):
1142
1139
// int read_pipe_bl (read_only pipe gentype p, gentype *ptr)
1143
1140
// int write_pipe_bl (write_only pipe gentype p, const gentype *ptr)
1144
1141
addVoidPtrArg (1 );
1145
1142
addUnsignedArg (2 );
1146
1143
addUnsignedArg (3 );
1147
- } else if (NameRef.equals (" read_pipe_4" ) ||
1148
- NameRef.equals (" write_pipe_4" )) {
1144
+ } else if (NameRef == " read_pipe_4" || NameRef == " write_pipe_4" ) {
1149
1145
// with 4 arguments (plus two i32 literals):
1150
1146
// int read_pipe (read_only pipe gentype p, reserve_id_t reserve_id, uint
1151
1147
// index, gentype *ptr) int write_pipe (write_only pipe gentype p,
@@ -1165,10 +1161,10 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1165
1161
// process [|work_group|sub_group]commit[read|write]pipe builtins
1166
1162
addUnsignedArg (2 );
1167
1163
addUnsignedArg (3 );
1168
- } else if (NameRef. equals ( " capture_event_profiling_info" ) ) {
1164
+ } else if (NameRef == " capture_event_profiling_info" ) {
1169
1165
addVoidPtrArg (2 );
1170
1166
setEnumArg (1 , SPIR::PRIMITIVE_CLK_PROFILING_INFO);
1171
- } else if (NameRef. equals ( " enqueue_marker" ) ) {
1167
+ } else if (NameRef == " enqueue_marker" ) {
1172
1168
setArgAttr (2 , SPIR::ATTR_CONST);
1173
1169
addUnsignedArg (1 );
1174
1170
} else if (NameRef.starts_with (" vload" )) {
@@ -1529,7 +1525,7 @@ SPIRV::transSPIRVMemoryScopeIntoOCLMemoryScope(Value *MemScope,
1529
1525
1530
1526
if (auto *CI = dyn_cast<CallInst>(MemScope)) {
1531
1527
Function *F = CI->getCalledFunction ();
1532
- if (F && F->getName (). equals ( kSPIRVName ::TranslateOCLMemScope) ) {
1528
+ if (F && F->getName () == kSPIRVName ::TranslateOCLMemScope) {
1533
1529
// In case the SPIR-V module was created from an OpenCL program by
1534
1530
// *this* SPIR-V generator, we know that the value passed to
1535
1531
// __translate_ocl_memory_scope is what we should pass to the
@@ -1553,7 +1549,7 @@ SPIRV::transSPIRVMemorySemanticsIntoOCLMemoryOrder(Value *MemorySemantics,
1553
1549
1554
1550
if (auto *CI = dyn_cast<CallInst>(MemorySemantics)) {
1555
1551
Function *F = CI->getCalledFunction ();
1556
- if (F && F->getName (). equals ( kSPIRVName ::TranslateOCLMemOrder) ) {
1552
+ if (F && F->getName () == kSPIRVName ::TranslateOCLMemOrder) {
1557
1553
// In case the SPIR-V module was created from an OpenCL program by
1558
1554
// *this* SPIR-V generator, we know that the value passed to
1559
1555
// __translate_ocl_memory_order is what we should pass to the
0 commit comments