@@ -1027,12 +1027,11 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1027
1027
setVarArg (1 );
1028
1028
else if (NameRef.starts_with (" write_imageui" ))
1029
1029
addUnsignedArg (2 );
1030
- else if (NameRef. equals ( " prefetch" ) ) {
1030
+ else if (NameRef == " prefetch" ) {
1031
1031
addUnsignedArg (1 );
1032
1032
setArgAttr (0 , SPIR::ATTR_CONST);
1033
- } else if (NameRef.equals (" get_kernel_work_group_size" ) ||
1034
- NameRef.equals (
1035
- " get_kernel_preferred_work_group_size_multiple" )) {
1033
+ } else if (NameRef == " get_kernel_work_group_size" ||
1034
+ NameRef == " get_kernel_preferred_work_group_size_multiple" ) {
1036
1035
assert (F && " lack of necessary information" );
1037
1036
const size_t BlockArgIdx = 0 ;
1038
1037
FunctionType *InvokeTy = getBlockInvokeTy (F, BlockArgIdx);
@@ -1041,19 +1040,18 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1041
1040
} else if (NameRef.starts_with (" __enqueue_kernel" )) {
1042
1041
// clang doesn't mangle enqueue_kernel builtins
1043
1042
setAsDontMangle ();
1044
- } else if (NameRef.starts_with (" get_" ) || NameRef. equals ( " nan" ) ||
1045
- NameRef. equals ( " mem_fence" ) || NameRef.starts_with (" shuffle" )) {
1043
+ } else if (NameRef.starts_with (" get_" ) || NameRef == " nan" ||
1044
+ NameRef == " mem_fence" || NameRef.starts_with (" shuffle" )) {
1046
1045
addUnsignedArg (-1 );
1047
1046
if (NameRef.starts_with (kOCLBuiltinName ::GetFence)) {
1048
1047
setArgAttr (0 , SPIR::ATTR_CONST);
1049
1048
addVoidPtrArg (0 );
1050
1049
}
1051
1050
} else if (NameRef.contains (" barrier" )) {
1052
1051
addUnsignedArg (0 );
1053
- if (NameRef.equals (" work_group_barrier" ) ||
1054
- NameRef.equals (" sub_group_barrier" ) ||
1055
- NameRef.equals (" intel_work_group_barrier_arrive" ) ||
1056
- NameRef.equals (" intel_work_group_barrier_wait" ))
1052
+ if (NameRef == " work_group_barrier" || NameRef == " sub_group_barrier" ||
1053
+ NameRef == " intel_work_group_barrier_arrive" ||
1054
+ NameRef == " intel_work_group_barrier_wait" )
1057
1055
setEnumArg (1 , SPIR::PRIMITIVE_MEMORY_SCOPE);
1058
1056
} else if (NameRef.starts_with (" atomic_work_item_fence" )) {
1059
1057
addUnsignedArg (0 );
@@ -1109,35 +1107,33 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1109
1107
NameRef = NameRef.drop_front (1 );
1110
1108
UnmangledName.erase (0 , 1 );
1111
1109
} else if (NameRef.starts_with (" s_" )) {
1112
- if (NameRef. equals ( " s_upsample" ) )
1110
+ if (NameRef == " s_upsample" )
1113
1111
addUnsignedArg (1 );
1114
1112
NameRef = NameRef.drop_front (2 );
1115
1113
} else if (NameRef.starts_with (" u_" )) {
1116
1114
addUnsignedArg (-1 );
1117
1115
NameRef = NameRef.drop_front (2 );
1118
- } else if (NameRef. equals ( " fclamp" ) ) {
1116
+ } else if (NameRef == " fclamp" ) {
1119
1117
NameRef = NameRef.drop_front (1 );
1120
1118
}
1121
1119
// handle [read|write]pipe builtins (plus two i32 literal args
1122
1120
// required by SPIR 2.0 provisional specification):
1123
- else if (NameRef. equals ( " read_pipe_2" ) || NameRef. equals ( " write_pipe_2" ) ) {
1121
+ else if (NameRef == " read_pipe_2" || NameRef == " write_pipe_2" ) {
1124
1122
// with 2 arguments (plus two i32 literals):
1125
1123
// int read_pipe (read_only pipe gentype p, gentype *ptr)
1126
1124
// int write_pipe (write_only pipe gentype p, const gentype *ptr)
1127
1125
addVoidPtrArg (1 );
1128
1126
addUnsignedArg (2 );
1129
1127
addUnsignedArg (3 );
1130
1128
// OpenCL-like representation of blocking pipes
1131
- } else if (NameRef.equals (" read_pipe_2_bl" ) ||
1132
- NameRef.equals (" write_pipe_2_bl" )) {
1129
+ } else if (NameRef == " read_pipe_2_bl" || NameRef == " write_pipe_2_bl" ) {
1133
1130
// with 2 arguments (plus two i32 literals):
1134
1131
// int read_pipe_bl (read_only pipe gentype p, gentype *ptr)
1135
1132
// int write_pipe_bl (write_only pipe gentype p, const gentype *ptr)
1136
1133
addVoidPtrArg (1 );
1137
1134
addUnsignedArg (2 );
1138
1135
addUnsignedArg (3 );
1139
- } else if (NameRef.equals (" read_pipe_4" ) ||
1140
- NameRef.equals (" write_pipe_4" )) {
1136
+ } else if (NameRef == " read_pipe_4" || NameRef == " write_pipe_4" ) {
1141
1137
// with 4 arguments (plus two i32 literals):
1142
1138
// int read_pipe (read_only pipe gentype p, reserve_id_t reserve_id, uint
1143
1139
// index, gentype *ptr) int write_pipe (write_only pipe gentype p,
@@ -1157,10 +1153,10 @@ class OCLBuiltinFuncMangleInfo : public SPIRV::BuiltinFuncMangleInfo {
1157
1153
// process [|work_group|sub_group]commit[read|write]pipe builtins
1158
1154
addUnsignedArg (2 );
1159
1155
addUnsignedArg (3 );
1160
- } else if (NameRef. equals ( " capture_event_profiling_info" ) ) {
1156
+ } else if (NameRef == " capture_event_profiling_info" ) {
1161
1157
addVoidPtrArg (2 );
1162
1158
setEnumArg (1 , SPIR::PRIMITIVE_CLK_PROFILING_INFO);
1163
- } else if (NameRef. equals ( " enqueue_marker" ) ) {
1159
+ } else if (NameRef == " enqueue_marker" ) {
1164
1160
setArgAttr (2 , SPIR::ATTR_CONST);
1165
1161
addUnsignedArg (1 );
1166
1162
} else if (NameRef.starts_with (" vload" )) {
@@ -1521,7 +1517,7 @@ SPIRV::transSPIRVMemoryScopeIntoOCLMemoryScope(Value *MemScope,
1521
1517
1522
1518
if (auto *CI = dyn_cast<CallInst>(MemScope)) {
1523
1519
Function *F = CI->getCalledFunction ();
1524
- if (F && F->getName (). equals ( kSPIRVName ::TranslateOCLMemScope) ) {
1520
+ if (F && F->getName () == kSPIRVName ::TranslateOCLMemScope) {
1525
1521
// In case the SPIR-V module was created from an OpenCL program by
1526
1522
// *this* SPIR-V generator, we know that the value passed to
1527
1523
// __translate_ocl_memory_scope is what we should pass to the
@@ -1545,7 +1541,7 @@ SPIRV::transSPIRVMemorySemanticsIntoOCLMemoryOrder(Value *MemorySemantics,
1545
1541
1546
1542
if (auto *CI = dyn_cast<CallInst>(MemorySemantics)) {
1547
1543
Function *F = CI->getCalledFunction ();
1548
- if (F && F->getName (). equals ( kSPIRVName ::TranslateOCLMemOrder) ) {
1544
+ if (F && F->getName () == kSPIRVName ::TranslateOCLMemOrder) {
1549
1545
// In case the SPIR-V module was created from an OpenCL program by
1550
1546
// *this* SPIR-V generator, we know that the value passed to
1551
1547
// __translate_ocl_memory_order is what we should pass to the
0 commit comments