@@ -439,8 +439,8 @@ unsigned VPInstruction::getNumOperandsForOpcode(unsigned Opcode) {
439439 case VPInstruction::CalculateTripCountMinusVF:
440440 case VPInstruction::CanonicalIVIncrementForPart:
441441 case VPInstruction::ExplicitVectorLength:
442- case VPInstruction::ExtractLastElement :
443- case VPInstruction::ExtractLastLanePerPart :
442+ case VPInstruction::ExtractLastLane :
443+ case VPInstruction::ExtractLastPart :
444444 case VPInstruction::ExtractPenultimateElement:
445445 case VPInstruction::Not:
446446 case VPInstruction::ResumeForEpilogue:
@@ -813,8 +813,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
813813
814814 return ReducedPartRdx;
815815 }
816- case VPInstruction::ExtractLastLanePerPart:
817- case VPInstruction::ExtractLastElement:
816+ case VPInstruction::ExtractLastLane:
818817 case VPInstruction::ExtractPenultimateElement: {
819818 unsigned Offset =
820819 getOpcode () == VPInstruction::ExtractPenultimateElement ? 2 : 1 ;
@@ -825,6 +824,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
825824 // Extract lane VF - Offset from the operand.
826825 Res = State.get (getOperand (0 ), VPLane::getLaneFromEnd (State.VF , Offset));
827826 } else {
827+ // TODO: Remove ExtractLastLane for scalar VFs.
828828 assert (Offset <= 1 && " invalid offset to extract from" );
829829 Res = State.get (getOperand (0 ));
830830 }
@@ -1103,7 +1103,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
11031103 I32Ty, {Arg0Ty, I32Ty, I1Ty});
11041104 return Ctx.TTI .getIntrinsicInstrCost (Attrs, Ctx.CostKind );
11051105 }
1106- case VPInstruction::ExtractLastElement : {
1106+ case VPInstruction::ExtractLastLane : {
11071107 // Add on the cost of extracting the element.
11081108 auto *VecTy = toVectorTy (Ctx.Types .inferScalarType (getOperand (0 )), VF);
11091109 return Ctx.TTI .getIndexedVectorInstrCostFromEnd (Instruction::ExtractElement,
@@ -1123,8 +1123,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
11231123}
11241124
11251125bool VPInstruction::isVectorToScalar () const {
1126- return getOpcode () == VPInstruction::ExtractLastElement ||
1127- getOpcode () == VPInstruction::ExtractLastLanePerPart ||
1126+ return getOpcode () == VPInstruction::ExtractLastLane ||
11281127 getOpcode () == VPInstruction::ExtractPenultimateElement ||
11291128 getOpcode () == Instruction::ExtractElement ||
11301129 getOpcode () == VPInstruction::ExtractLane ||
@@ -1191,8 +1190,8 @@ bool VPInstruction::opcodeMayReadOrWriteFromMemory() const {
11911190 case VPInstruction::CalculateTripCountMinusVF:
11921191 case VPInstruction::CanonicalIVIncrementForPart:
11931192 case VPInstruction::ExtractLane:
1194- case VPInstruction::ExtractLastElement :
1195- case VPInstruction::ExtractLastLanePerPart :
1193+ case VPInstruction::ExtractLastLane :
1194+ case VPInstruction::ExtractLastPart :
11961195 case VPInstruction::ExtractPenultimateElement:
11971196 case VPInstruction::ActiveLaneMask:
11981197 case VPInstruction::ExplicitVectorLength:
@@ -1341,11 +1340,11 @@ void VPInstruction::printRecipe(raw_ostream &O, const Twine &Indent,
13411340 case VPInstruction::ExtractLane:
13421341 O << " extract-lane" ;
13431342 break ;
1344- case VPInstruction::ExtractLastElement :
1345- O << " extract-last-element " ;
1343+ case VPInstruction::ExtractLastLane :
1344+ O << " extract-last-lane " ;
13461345 break ;
1347- case VPInstruction::ExtractLastLanePerPart :
1348- O << " extract-last-lane-per- part" ;
1346+ case VPInstruction::ExtractLastPart :
1347+ O << " extract-last-part" ;
13491348 break ;
13501349 case VPInstruction::ExtractPenultimateElement:
13511350 O << " extract-penultimate-element" ;
@@ -1498,15 +1497,17 @@ InstructionCost VPIRInstruction::computeCost(ElementCount VF,
14981497 return 0 ;
14991498}
15001499
1501- void VPIRInstruction::extractLastLaneOfFirstOperand (VPBuilder &Builder) {
1500+ void VPIRInstruction::extractLastLaneOfLastPartOfFirstOperand (
1501+ VPBuilder &Builder) {
15021502 assert (isa<PHINode>(getInstruction ()) &&
15031503 " can only update exiting operands to phi nodes" );
15041504 assert (getNumOperands () > 0 && " must have at least one operand" );
15051505 VPValue *Exiting = getOperand (0 );
15061506 if (Exiting->isLiveIn ())
15071507 return ;
15081508
1509- Exiting = Builder.createNaryOp (VPInstruction::ExtractLastElement, {Exiting});
1509+ Exiting = Builder.createNaryOp (VPInstruction::ExtractLastPart, Exiting);
1510+ Exiting = Builder.createNaryOp (VPInstruction::ExtractLastLane, Exiting);
15101511 setOperand (0 , Exiting);
15111512}
15121513
0 commit comments