@@ -437,8 +437,8 @@ unsigned VPInstruction::getNumOperandsForOpcode(unsigned Opcode) {
437437 case VPInstruction::CalculateTripCountMinusVF:
438438 case VPInstruction::CanonicalIVIncrementForPart:
439439 case VPInstruction::ExplicitVectorLength:
440- case VPInstruction::ExtractLastElement :
441- case VPInstruction::ExtractLastLanePerPart :
440+ case VPInstruction::ExtractLastLane :
441+ case VPInstruction::ExtractLastPart :
442442 case VPInstruction::ExtractPenultimateElement:
443443 case VPInstruction::Not:
444444 case VPInstruction::ResumeForEpilogue:
@@ -815,8 +815,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
815815
816816 return ReducedPartRdx;
817817 }
818- case VPInstruction::ExtractLastLanePerPart:
819- case VPInstruction::ExtractLastElement:
818+ case VPInstruction::ExtractLastLane:
820819 case VPInstruction::ExtractPenultimateElement: {
821820 unsigned Offset =
822821 getOpcode () == VPInstruction::ExtractPenultimateElement ? 2 : 1 ;
@@ -827,6 +826,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
827826 // Extract lane VF - Offset from the operand.
828827 Res = State.get (getOperand (0 ), VPLane::getLaneFromEnd (State.VF , Offset));
829828 } else {
829+ // TODO: Remove ExtractLastLane for scalar VFs.
830830 assert (Offset <= 1 && " invalid offset to extract from" );
831831 Res = State.get (getOperand (0 ));
832832 }
@@ -1107,7 +1107,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
11071107 I32Ty, {Arg0Ty, I32Ty, I1Ty});
11081108 return Ctx.TTI .getIntrinsicInstrCost (Attrs, Ctx.CostKind );
11091109 }
1110- case VPInstruction::ExtractLastElement : {
1110+ case VPInstruction::ExtractLastLane : {
11111111 // Add on the cost of extracting the element.
11121112 auto *VecTy = toVectorTy (Ctx.Types .inferScalarType (getOperand (0 )), VF);
11131113 return Ctx.TTI .getIndexedVectorInstrCostFromEnd (Instruction::ExtractElement,
@@ -1127,8 +1127,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
11271127}
11281128
11291129bool VPInstruction::isVectorToScalar () const {
1130- return getOpcode () == VPInstruction::ExtractLastElement ||
1131- getOpcode () == VPInstruction::ExtractLastLanePerPart ||
1130+ return getOpcode () == VPInstruction::ExtractLastLane ||
11321131 getOpcode () == VPInstruction::ExtractPenultimateElement ||
11331132 getOpcode () == Instruction::ExtractElement ||
11341133 getOpcode () == VPInstruction::ExtractLane ||
@@ -1195,8 +1194,8 @@ bool VPInstruction::opcodeMayReadOrWriteFromMemory() const {
11951194 case VPInstruction::CalculateTripCountMinusVF:
11961195 case VPInstruction::CanonicalIVIncrementForPart:
11971196 case VPInstruction::ExtractLane:
1198- case VPInstruction::ExtractLastElement :
1199- case VPInstruction::ExtractLastLanePerPart :
1197+ case VPInstruction::ExtractLastLane :
1198+ case VPInstruction::ExtractLastPart :
12001199 case VPInstruction::ExtractPenultimateElement:
12011200 case VPInstruction::ActiveLaneMask:
12021201 case VPInstruction::ExplicitVectorLength:
@@ -1345,11 +1344,11 @@ void VPInstruction::printRecipe(raw_ostream &O, const Twine &Indent,
13451344 case VPInstruction::ExtractLane:
13461345 O << " extract-lane" ;
13471346 break ;
1348- case VPInstruction::ExtractLastElement :
1349- O << " extract-last-element " ;
1347+ case VPInstruction::ExtractLastLane :
1348+ O << " extract-last-lane " ;
13501349 break ;
1351- case VPInstruction::ExtractLastLanePerPart :
1352- O << " extract-last-lane-per- part" ;
1350+ case VPInstruction::ExtractLastPart :
1351+ O << " extract-last-part" ;
13531352 break ;
13541353 case VPInstruction::ExtractPenultimateElement:
13551354 O << " extract-penultimate-element" ;
@@ -1502,15 +1501,16 @@ InstructionCost VPIRInstruction::computeCost(ElementCount VF,
15021501 return 0 ;
15031502}
15041503
1505- void VPIRInstruction::extractLastLaneOfFirstOperand (VPBuilder &Builder) {
1504+ void VPIRInstruction::extractFinalLaneOfFirstOperand (VPBuilder &Builder) {
15061505 assert (isa<PHINode>(getInstruction ()) &&
15071506 " can only update exiting operands to phi nodes" );
15081507 assert (getNumOperands () > 0 && " must have at least one operand" );
15091508 VPValue *Exiting = getOperand (0 );
15101509 if (Exiting->isLiveIn ())
15111510 return ;
15121511
1513- Exiting = Builder.createNaryOp (VPInstruction::ExtractLastElement, {Exiting});
1512+ Exiting = Builder.createNaryOp (VPInstruction::ExtractLastPart, Exiting);
1513+ Exiting = Builder.createNaryOp (VPInstruction::ExtractLastLane, Exiting);
15141514 setOperand (0 , Exiting);
15151515}
15161516
0 commit comments