[PATCH] D157451: [AMDGPU] Do not deduce access qualifiers from IR attributes
Changpeng Fang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 12:16:24 PDT 2023
cfang updated this revision to Diff 548730.
cfang added a comment.
Update the LIT tests with kernel_arg_access_qual specified to "read_only: for the first argument.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157451/new/
https://reviews.llvm.org/D157451
Files:
llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg-v3.ll
llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg.ll
Index: llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg.ll
+++ llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg.ll
@@ -27,7 +27,7 @@
}
!0 = !{i32 1, i32 1}
-!1 = !{!"none", !"none"}
+!1 = !{!"read_only", !"none"}
!2 = !{!"float*", !"float*"}
!3 = !{!"const restrict", !""}
Index: llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg-v3.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg-v3.ll
+++ llvm/test/CodeGen/AMDGPU/hsa-metadata-deduce-ro-arg-v3.ll
@@ -26,6 +26,6 @@
}
!0 = !{i32 1, i32 1}
-!1 = !{!"none", !"none"}
+!1 = !{!"read_only", !"none"}
!2 = !{!"float*", !"float*"}
!3 = !{!"const restrict", !""}
Index: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
@@ -308,14 +308,9 @@
BaseTypeName = cast<MDString>(Node->getOperand(ArgNo))->getString();
StringRef AccQual;
- if (Arg.getType()->isPointerTy() && Arg.onlyReadsMemory() &&
- Arg.hasNoAliasAttr()) {
- AccQual = "read_only";
- } else {
- Node = Func->getMetadata("kernel_arg_access_qual");
- if (Node && ArgNo < Node->getNumOperands())
- AccQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
- }
+ Node = Func->getMetadata("kernel_arg_access_qual");
+ if (Node && ArgNo < Node->getNumOperands())
+ AccQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
StringRef TypeQual;
Node = Func->getMetadata("kernel_arg_type_qual");
@@ -715,14 +710,9 @@
BaseTypeName = cast<MDString>(Node->getOperand(ArgNo))->getString();
StringRef AccQual;
- if (Arg.getType()->isPointerTy() && Arg.onlyReadsMemory() &&
- Arg.hasNoAliasAttr()) {
- AccQual = "read_only";
- } else {
- Node = Func->getMetadata("kernel_arg_access_qual");
- if (Node && ArgNo < Node->getNumOperands())
- AccQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
- }
+ Node = Func->getMetadata("kernel_arg_access_qual");
+ if (Node && ArgNo < Node->getNumOperands())
+ AccQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
StringRef TypeQual;
Node = Func->getMetadata("kernel_arg_type_qual");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157451.548730.patch
Type: text/x-patch
Size: 2447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230809/86849a51/attachment.bin>
More information about the llvm-commits
mailing list