[PATCH] D125968: [AMDGPU] Mark s_getreg as having side effects instead of reading memory
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 19 13:26:25 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG86b55edab687: [AMDGPU] Mark s_getreg as having side effects instead of reading memory (authored by foad).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125968/new/
https://reviews.llvm.org/D125968
Files:
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/Target/AMDGPU/SOPInstructions.td
Index: llvm/lib/Target/AMDGPU/SOPInstructions.td
===================================================================
--- llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -873,9 +873,7 @@
"$sdst, $simm16"
>;
-let mayLoad = 1 in {
-// s_getreg_b32 should use hasSideEffects = 1 for tablegen to allow
-// its use in the readcyclecounter selection.
+// This is hasSideEffects to allow its use in readcyclecounter selection.
// FIXME: Need to truncate immediate to 16-bits.
def S_GETREG_B32 : SOPK_Pseudo <
"s_getreg_b32",
@@ -885,7 +883,6 @@
let SOPKZext = 1;
let hasSideEffects = 1;
}
-} // End mayLoad = 1
let Defs = [MODE], Uses = [MODE] in {
Index: llvm/include/llvm/IR/IntrinsicsAMDGPU.td
===================================================================
--- llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+++ llvm/include/llvm/IR/IntrinsicsAMDGPU.td
@@ -1379,11 +1379,11 @@
Intrinsic<[], [llvm_i16_ty], [ImmArg<ArgIndex<0>>, IntrNoMem,
IntrHasSideEffects, IntrWillReturn]>;
+// This is IntrHasSideEffects so it can be used to read cycle counters.
def int_amdgcn_s_getreg :
GCCBuiltin<"__builtin_amdgcn_s_getreg">,
Intrinsic<[llvm_i32_ty], [llvm_i32_ty],
- [IntrInaccessibleMemOnly, IntrReadMem, IntrSpeculatable,
- IntrWillReturn, ImmArg<ArgIndex<0>>]
+ [IntrNoMem, IntrHasSideEffects, IntrWillReturn, ImmArg<ArgIndex<0>>]
>;
// Note this can be used to set FP environment properties that are
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125968.430789.patch
Type: text/x-patch
Size: 1509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220519/5cc76a66/attachment.bin>
More information about the llvm-commits
mailing list