Skip to content

Commit

Permalink
[CIR][Bugfix] renames minor/major parameters of the OpenCLVersionAttr
Browse files Browse the repository at this point in the history
  • Loading branch information
gitoleg committed Sep 13, 2024
1 parent 05fb5a2 commit 0935863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/CIR/Dialect/IR/CIROpenCLAttrs.td
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def OpenCLKernelArgMetadataAttr

def OpenCLVersionAttr : CIR_Attr<"OpenCLVersion", "cl.version"> {
let summary = "OpenCL version";
let parameters = (ins "int32_t":$major, "int32_t":$minor);
let parameters = (ins "int32_t":$major_version, "int32_t":$minor_version);
let description = [{
Represents the version of OpenCL.

Expand All @@ -165,7 +165,7 @@ def OpenCLVersionAttr : CIR_Attr<"OpenCLVersion", "cl.version"> {
module attributes {cir.cl.version = cir.cl.version<3, 0>} {}
```
}];
let assemblyFormat = "`<` $major `,` $minor `>`";
let assemblyFormat = "`<` $major_version `,` $minor_version `>`";
}

#endif // MLIR_CIR_DIALECT_CIR_OPENCL_ATTRS
4 changes: 2 additions & 2 deletions clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVMIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class CIRDialectLLVMIRTranslationInterface
auto *int32Ty = llvm::IntegerType::get(llvmContext, 32);
llvm::Metadata *oclVerElts[] = {
llvm::ConstantAsMetadata::get(
llvm::ConstantInt::get(int32Ty, openclVersionAttr.getMajor())),
llvm::ConstantInt::get(int32Ty, openclVersionAttr.getMajorVersion())),
llvm::ConstantAsMetadata::get(
llvm::ConstantInt::get(int32Ty, openclVersionAttr.getMinor()))};
llvm::ConstantInt::get(int32Ty, openclVersionAttr.getMinorVersion()))};
llvm::NamedMDNode *oclVerMD =
llvmModule->getOrInsertNamedMetadata("opencl.ocl.version");
oclVerMD->addOperand(llvm::MDNode::get(llvmContext, oclVerElts));
Expand Down

0 comments on commit 0935863

Please sign in to comment.