[llvm] [GlobalISel] Add G_PREFETCH (PR #74863)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 08:52:24 PST 2023


================
@@ -1209,6 +1209,15 @@ def G_FENCE : GenericInstruction {
   let hasSideEffects = true;
 }
 
+// Generic opcode equivalent to the llvm.prefetch intrinsic.
+def G_PREFETCH : GenericInstruction {
+  let OutOperandList = (outs);
+  let InOperandList = (ins ptype0:$address, i32imm:$rw, i32imm:$locality, i32imm:$cachetype);
+  let hasSideEffects = true;
+  let mayLoad = true;
+  let mayStore = true;
----------------
jayfoad wrote:

I am not sure about these properties. The DAG opcode has `SDNPHasChain, SDNPMayLoad, SDNPMayStore`. The intrinsic has `DefaultAttrs` and `IntrInaccessibleMemOrArgMemOnly` and `ReadOnly<ArgIndex<0>>`.

https://github.com/llvm/llvm-project/pull/74863


More information about the llvm-commits mailing list