Skip to content

Commit a313a91

Browse files
committed
Move definition into VPlanRecipes.cpp
1 parent e620fce commit a313a91

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,25 +1352,7 @@ class VPInstruction : public VPRecipeWithIRFlags,
13521352
}
13531353

13541354
/// Returns true if the underlying opcode may read from or write to memory.
1355-
bool opcodeMayReadOrWriteFromMemory() const {
1356-
if (Instruction::isBinaryOp(getOpcode()))
1357-
return false;
1358-
switch (getOpcode()) {
1359-
case Instruction::ICmp:
1360-
case Instruction::Select:
1361-
case VPInstruction::AnyOf:
1362-
case VPInstruction::Not:
1363-
case VPInstruction::CalculateTripCountMinusVF:
1364-
case VPInstruction::CanonicalIVIncrementForPart:
1365-
case VPInstruction::ExtractFromEnd:
1366-
case VPInstruction::FirstOrderRecurrenceSplice:
1367-
case VPInstruction::LogicalAnd:
1368-
case VPInstruction::PtrAdd:
1369-
return false;
1370-
default:
1371-
return true;
1372-
}
1373-
}
1355+
bool opcodeMayReadOrWriteFromMemory() const;
13741356

13751357
/// Returns true if the recipe only uses the first lane of operand \p Op.
13761358
bool onlyFirstLaneUsed(const VPValue *Op) const override;

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,26 @@ void VPInstruction::execute(VPTransformState &State) {
692692
/*IsScalar*/ GeneratesPerFirstLaneOnly);
693693
}
694694

695+
bool VPInstruction::opcodeMayReadOrWriteFromMemory() const {
696+
if (Instruction::isBinaryOp(getOpcode()))
697+
return false;
698+
switch (getOpcode()) {
699+
case Instruction::ICmp:
700+
case Instruction::Select:
701+
case VPInstruction::AnyOf:
702+
case VPInstruction::Not:
703+
case VPInstruction::CalculateTripCountMinusVF:
704+
case VPInstruction::CanonicalIVIncrementForPart:
705+
case VPInstruction::ExtractFromEnd:
706+
case VPInstruction::FirstOrderRecurrenceSplice:
707+
case VPInstruction::LogicalAnd:
708+
case VPInstruction::PtrAdd:
709+
return false;
710+
default:
711+
return true;
712+
}
713+
}
714+
695715
bool VPInstruction::onlyFirstLaneUsed(const VPValue *Op) const {
696716
assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
697717
if (Instruction::isBinaryOp(getOpcode()))

0 commit comments

Comments
 (0)