File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3575,6 +3575,14 @@ SPIRVToLLVM::transKernelMetadata()
3575
3575
SPIRVFunction *BF = BM->getFunction (I);
3576
3576
Function *F = static_cast <Function *>(getTranslatedValue (BF));
3577
3577
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
+
3578
3586
if (F->getCallingConv () != CallingConv::SPIR_KERNEL || F->isDeclaration ())
3579
3587
continue ;
3580
3588
std::vector<llvm::Metadata*> KernelMD;
@@ -3739,12 +3747,6 @@ SPIRVToLLVM::transKernelMetadata()
3739
3747
}
3740
3748
}
3741
3749
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
-
3748
3750
llvm::MDNode *Node = MDNode::get (*Context, KernelMD);
3749
3751
KernelMDs->addOperand (Node);
3750
3752
}
You can’t perform that action at this time.
0 commit comments