[llvm] [VPlan] Handle some VPInstructions in mayReadFromMemory (PR #120058)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 18 02:04:54 PST 2024
================
@@ -115,6 +115,25 @@ bool VPRecipeBase::mayWriteToMemory() const {
bool VPRecipeBase::mayReadFromMemory() const {
switch (getVPDefID()) {
+ case VPInstructionSC:
+ if (Instruction::isBinaryOp(cast<VPInstruction>(this)->getOpcode()))
+ return false;
+ switch (cast<VPInstruction>(this)->getOpcode()) {
+ case Instruction::Or:
+ 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:
+ return false;
+ default:
+ return true;
+ }
----------------
lukel97 wrote:
I've pulled it out into a static function to avoid exposing another interface for it, but happy to rework it however
https://github.com/llvm/llvm-project/pull/120058
More information about the llvm-commits
mailing list