File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3575,6 +3575,14 @@ SPIRVToLLVM::transKernelMetadata()
35753575 SPIRVFunction *BF = BM->getFunction (I);
35763576 Function *F = static_cast <Function *>(getTranslatedValue (BF));
35773577 assert (F && " Invalid translated function" );
3578+
3579+ // __attribute__((annotate("some_user_annotation"))) are passed via
3580+ // UserSemantic decoration on functions.
3581+ if (BF->hasDecorate (DecorationUserSemantic)) {
3582+ auto &funcInfo = MD.FuncMD [F];
3583+ funcInfo.UserAnnotations = BF->getDecorationStringLiteral (DecorationUserSemantic);
3584+ }
3585+
35783586 if (F->getCallingConv () != CallingConv::SPIR_KERNEL || F->isDeclaration ())
35793587 continue ;
35803588 std::vector<llvm::Metadata*> KernelMD;
@@ -3739,12 +3747,6 @@ SPIRVToLLVM::transKernelMetadata()
37393747 }
37403748 }
37413749
3742- // __attribute__((annotate("some_user_annotation"))) are passed via
3743- // UserSemantic decoration on functions.
3744- if (BF->hasDecorate (DecorationUserSemantic)) {
3745- funcInfo.UserAnnotations = BF->getDecorationStringLiteral (DecorationUserSemantic);
3746- }
3747-
37483750 llvm::MDNode *Node = MDNode::get (*Context, KernelMD);
37493751 KernelMDs->addOperand (Node);
37503752 }
You can’t perform that action at this time.
0 commit comments