@@ -2592,40 +2592,39 @@ void CodeGenModule::GenKernelArgMetadata(llvm::Function *Fn,
2592
2592
}
2593
2593
}
2594
2594
2595
- bool IsEsimdFunction = FD && FD->hasAttr <SYCLSimdAttr>();
2596
-
2597
- if (LangOpts.SYCLIsDevice && !IsEsimdFunction) {
2598
- Fn->setMetadata (" kernel_arg_buffer_location" ,
2599
- llvm::MDNode::get (VMContext, argSYCLBufferLocationAttr));
2600
- // Generate this metadata only if atleast one kernel argument is an
2601
- // accessor.
2602
- if (isKernelArgAnAccessor) {
2603
- Fn->setMetadata (" kernel_arg_runtime_aligned" ,
2604
- llvm::MDNode::get (VMContext, argSYCLAccessorPtrs));
2605
- Fn->setMetadata (" kernel_arg_exclusive_ptr" ,
2595
+ if (getLangOpts ().SYCLIsDevice ) {
2596
+ if (FD && FD->hasAttr <SYCLSimdAttr>()) {
2597
+ Fn->setMetadata (" kernel_arg_accessor_ptr" ,
2606
2598
llvm::MDNode::get (VMContext, argSYCLAccessorPtrs));
2607
- }
2608
- } else {
2609
- if (getLangOpts ().OpenCL || getLangOpts ().SYCLIsDevice ) {
2610
- Fn->setMetadata (" kernel_arg_addr_space" ,
2611
- llvm::MDNode::get (VMContext, addressQuals));
2612
- Fn->setMetadata (" kernel_arg_access_qual" ,
2613
- llvm::MDNode::get (VMContext, accessQuals));
2614
- Fn->setMetadata (" kernel_arg_type" ,
2615
- llvm::MDNode::get (VMContext, argTypeNames));
2616
- Fn->setMetadata (" kernel_arg_base_type" ,
2617
- llvm::MDNode::get (VMContext, argBaseTypeNames));
2618
- Fn->setMetadata (" kernel_arg_type_qual" ,
2619
- llvm::MDNode::get (VMContext, argTypeQuals));
2620
- if (IsEsimdFunction)
2621
- Fn->setMetadata (" kernel_arg_accessor_ptr" ,
2599
+ } else {
2600
+ Fn->setMetadata (" kernel_arg_buffer_location" ,
2601
+ llvm::MDNode::get (VMContext, argSYCLBufferLocationAttr));
2602
+ // Generate this metadata only if at least one kernel argument is an
2603
+ // accessor.
2604
+ if (isKernelArgAnAccessor) {
2605
+ Fn->setMetadata (" kernel_arg_runtime_aligned" ,
2622
2606
llvm::MDNode::get (VMContext, argSYCLAccessorPtrs));
2607
+ Fn->setMetadata (" kernel_arg_exclusive_ptr" ,
2608
+ llvm::MDNode::get (VMContext, argSYCLAccessorPtrs));
2609
+ }
2623
2610
}
2624
- if (getCodeGenOpts ().EmitOpenCLArgMetadata ||
2625
- getCodeGenOpts ().HIPSaveKernelArgName )
2626
- Fn->setMetadata (" kernel_arg_name" ,
2627
- llvm::MDNode::get (VMContext, argNames));
2628
2611
}
2612
+
2613
+ if (getLangOpts ().OpenCL ) {
2614
+ Fn->setMetadata (" kernel_arg_addr_space" ,
2615
+ llvm::MDNode::get (VMContext, addressQuals));
2616
+ Fn->setMetadata (" kernel_arg_access_qual" ,
2617
+ llvm::MDNode::get (VMContext, accessQuals));
2618
+ Fn->setMetadata (" kernel_arg_type" ,
2619
+ llvm::MDNode::get (VMContext, argTypeNames));
2620
+ Fn->setMetadata (" kernel_arg_base_type" ,
2621
+ llvm::MDNode::get (VMContext, argBaseTypeNames));
2622
+ Fn->setMetadata (" kernel_arg_type_qual" ,
2623
+ llvm::MDNode::get (VMContext, argTypeQuals));
2624
+ }
2625
+ if (getCodeGenOpts ().EmitOpenCLArgMetadata ||
2626
+ getCodeGenOpts ().HIPSaveKernelArgName )
2627
+ Fn->setMetadata (" kernel_arg_name" , llvm::MDNode::get (VMContext, argNames));
2629
2628
}
2630
2629
2631
2630
// / Determines whether the language options require us to model
0 commit comments