File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -358,12 +358,19 @@ static inline void reportFatalOnTokenType(const Instruction *I) {
358358
359359static void emitAssignName (Instruction *I, IRBuilder<> &B) {
360360 if (!I->hasName () || I->getType ()->isAggregateType () ||
361- expectIgnoredInIRTranslation (I) ||
362- // TODO: this is a temporary workaround meant to prevent inserting
363- // internal noise into the generated binary; remove once we rework
364- // the entire aggregate removal machinery.
365- I->getName ().starts_with (" spv.mutated_callsite" ))
361+ expectIgnoredInIRTranslation (I))
366362 return ;
363+
364+ if (isa<CallBase>(I)) {
365+ // TODO: this is a temporary workaround meant to prevent inserting internal
366+ // noise into the generated binary; remove once we rework the entire
367+ // aggregate removal machinery.
368+ StringRef Name = I->getName ();
369+ if (Name.starts_with (" spv.mutated_callsite" ))
370+ return ;
371+ if (Name.starts_with (" spv.named_mutated_callsite" ))
372+ I->setName (Name.substr (Name.rfind (' .' ) + 1 ));
373+ }
367374 reportFatalOnTokenType (I);
368375 setInsertPointAfterDef (B, I);
369376 LLVMContext &Ctx = I->getContext ();
Original file line number Diff line number Diff line change @@ -606,7 +606,10 @@ bool SPIRVPrepareFunctions::removeAggregateTypesFromCalls(Function *F) {
606606 CB->getFunctionType ()->isVarArg ());
607607
608608 if (!CB->hasName ())
609- CB->setName (" spv.mutated_callsite" );
609+ CB->setName (" spv.mutated_callsite." + F->getName ());
610+ else
611+ CB->setName (
612+ " spv.named_mutated_callsite." + F->getName () + " ." + CB->getName ());
610613
611614 addFunctionTypeMutation (
612615 F->getParent ()->getOrInsertNamedMetadata (" spv.mutated_callsites" ),
You can’t perform that action at this time.
0 commit comments