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

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 10:53:07 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;
----------------
rampitec wrote:

I do not really think mayStore is applicable, but for the compatibility with SDag it needs to match. hasSideEffects is probably OK just to reduce possibilities of reordering, but deserves a comment about this, similar to the description of the IntrInaccessibleMemOrArgMemOnly on the intrinsic.

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


More information about the llvm-commits mailing list