@@ -48,32 +48,10 @@ extern cl::opt<unsigned> ForceTargetInstructionCost;
4848#define LV_NAME " loop-vectorize"
4949#define DEBUG_TYPE LV_NAME
5050
51- static bool opcodeMayReadOrWriteFromMemory (unsigned Opcode) {
52- if (Instruction::isBinaryOp (Opcode))
53- return false ;
54- switch (Opcode) {
55- case Instruction::Or:
56- case Instruction::ICmp:
57- case Instruction::Select:
58- case VPInstruction::AnyOf:
59- case VPInstruction::Not:
60- case VPInstruction::CalculateTripCountMinusVF:
61- case VPInstruction::CanonicalIVIncrementForPart:
62- case VPInstruction::ExtractFromEnd:
63- case VPInstruction::FirstOrderRecurrenceSplice:
64- case VPInstruction::LogicalAnd:
65- case VPInstruction::PtrAdd:
66- return false ;
67- default :
68- return true ;
69- }
70- }
71-
7251bool VPRecipeBase::mayWriteToMemory () const {
7352 switch (getVPDefID ()) {
7453 case VPInstructionSC:
75- return opcodeMayReadOrWriteFromMemory (
76- cast<VPInstruction>(this )->getOpcode ());
54+ return cast<VPInstruction>(this )->opcodeMayReadOrWriteFromMemory ();
7755 case VPInterleaveSC:
7856 return cast<VPInterleaveRecipe>(this )->getNumStoreOperands () > 0 ;
7957 case VPWidenStoreEVLSC:
@@ -121,8 +99,7 @@ bool VPRecipeBase::mayWriteToMemory() const {
12199bool VPRecipeBase::mayReadFromMemory () const {
122100 switch (getVPDefID ()) {
123101 case VPInstructionSC:
124- return opcodeMayReadOrWriteFromMemory (
125- cast<VPInstruction>(this )->getOpcode ());
102+ return cast<VPInstruction>(this )->opcodeMayReadOrWriteFromMemory ();
126103 case VPWidenLoadEVLSC:
127104 case VPWidenLoadSC:
128105 return true ;
0 commit comments