@@ -73,7 +73,6 @@ bool VPRecipeBase::mayWriteToMemory() const {
7373 case VPBranchOnMaskSC:
7474 case VPScalarIVStepsSC:
7575 case VPPredInstPHISC:
76- case VPStepVectorSC:
7776 return false ;
7877 case VPBlendSC:
7978 case VPReductionEVLSC:
@@ -121,7 +120,6 @@ bool VPRecipeBase::mayReadFromMemory() const {
121120 case VPScalarIVStepsSC:
122121 case VPWidenStoreEVLSC:
123122 case VPWidenStoreSC:
124- case VPStepVectorSC:
125123 return false ;
126124 case VPBlendSC:
127125 case VPReductionEVLSC:
@@ -152,7 +150,6 @@ bool VPRecipeBase::mayHaveSideEffects() const {
152150 case VPPredInstPHISC:
153151 case VPScalarCastSC:
154152 case VPReverseVectorPointerSC:
155- case VPStepVectorSC:
156153 return false ;
157154 case VPInstructionSC:
158155 return mayWriteToMemory ();
@@ -712,6 +709,10 @@ Value *VPInstruction::generate(VPTransformState &State) {
712709 Builder.getInt64Ty (), Mask, true , " first.active.lane" );
713710 return Builder.CreateExtractElement (Vec, Ctz, " early.exit.value" );
714711 }
712+ case VPInstruction::StepVector: {
713+ Type *EltTy = State.get (getOperand (0 ), true )->getType ();
714+ return State.Builder .CreateStepVector (VectorType::get (EltTy, State.VF ));
715+ }
715716
716717 default :
717718 llvm_unreachable (" Unsupported opcode for instruction" );
@@ -824,6 +825,7 @@ bool VPInstruction::opcodeMayReadOrWriteFromMemory() const {
824825 case VPInstruction::LogicalAnd:
825826 case VPInstruction::Not:
826827 case VPInstruction::PtrAdd:
828+ case VPInstruction::StepVector:
827829 return false ;
828830 default :
829831 return true ;
@@ -851,6 +853,7 @@ bool VPInstruction::onlyFirstLaneUsed(const VPValue *Op) const {
851853 case VPInstruction::BranchOnCount:
852854 case VPInstruction::BranchOnCond:
853855 case VPInstruction::ResumePhi:
856+ case VPInstruction::StepVector:
854857 return true ;
855858 };
856859 llvm_unreachable (" switch should return" );
@@ -942,6 +945,9 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
942945 case VPInstruction::ExtractFirstActive:
943946 O << " extract-first-active" ;
944947 break ;
948+ case VPInstruction::StepVector:
949+ O << " step-vector" ;
950+ break ;
945951 default :
946952 O << Instruction::getOpcodeName (getOpcode ());
947953 }
@@ -2291,7 +2297,7 @@ Value *VPScalarCastRecipe ::generate(VPTransformState &State) {
22912297 case Instruction::ZExt:
22922298 case Instruction::Trunc:
22932299 case Instruction::UIToFP: {
2294- // Note: SExt not used yet.
2300+ // Note: SExt/ZExt not used yet.
22952301 Value *Op = State.get (getOperand (0 ), VPLane (0 ));
22962302 return State.Builder .CreateCast (Instruction::CastOps (Opcode), Op, ResultTy);
22972303 }
@@ -2315,20 +2321,6 @@ void VPScalarCastRecipe ::print(raw_ostream &O, const Twine &Indent,
23152321}
23162322#endif
23172323
2318- void VPStepVectorRecipe::execute (VPTransformState &State) {
2319- VectorType *Ty = VectorType::get (ScalarTy, State.VF );
2320- State.set (this , State.Builder .CreateStepVector (Ty));
2321- }
2322-
2323- #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2324- void VPStepVectorRecipe::print (raw_ostream &O, const Twine &Indent,
2325- VPSlotTracker &SlotTracker) const {
2326- O << Indent;
2327- printAsOperand (O, SlotTracker);
2328- O << " = STEP-VECTOR" ;
2329- }
2330- #endif
2331-
23322324void VPBranchOnMaskRecipe::execute (VPTransformState &State) {
23332325 assert (State.Lane && " Branch on Mask works only on single instance." );
23342326
0 commit comments