[llvm] [VPlan] Handle some VPInstructions in may{Read,Write}FromMemory (PR #120058)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 13:44:17 PST 2025


================
@@ -1351,6 +1351,27 @@ class VPInstruction : public VPRecipeWithIRFlags,
     }
   }
 
+  /// Returns true if the underlying opcode may read from or write to memory.
+  bool opcodeMayReadOrWriteFromMemory() const {
+    if (Instruction::isBinaryOp(getOpcode()))
+      return false;
+    switch (getOpcode()) {
+    case Instruction::ICmp:
+    case Instruction::Select:
+    case VPInstruction::AnyOf:
+    case VPInstruction::Not:
+    case VPInstruction::CalculateTripCountMinusVF:
+    case VPInstruction::CanonicalIVIncrementForPart:
+    case VPInstruction::ExtractFromEnd:
+    case VPInstruction::FirstOrderRecurrenceSplice:
+    case VPInstruction::LogicalAnd:
+    case VPInstruction::PtrAdd:
----------------
fhahn wrote:

while you are here, might be worth to also order this alphabetically.

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


More information about the llvm-commits mailing list