@@ -73,7 +73,6 @@ bool VPRecipeBase::mayWriteToMemory() const {
7373 case VPBranchOnMaskSC:
7474 case VPScalarIVStepsSC:
7575 case VPPredInstPHISC:
76- case VPSplatSC:
7776 case VPStepVectorSC:
7877 return false ;
7978 case VPBlendSC:
@@ -122,7 +121,6 @@ bool VPRecipeBase::mayReadFromMemory() const {
122121 case VPScalarIVStepsSC:
123122 case VPWidenStoreEVLSC:
124123 case VPWidenStoreSC:
125- case VPSplatSC:
126124 case VPStepVectorSC:
127125 return false ;
128126 case VPBlendSC:
@@ -154,7 +152,6 @@ bool VPRecipeBase::mayHaveSideEffects() const {
154152 case VPPredInstPHISC:
155153 case VPScalarCastSC:
156154 case VPReverseVectorPointerSC:
157- case VPSplatSC:
158155 case VPStepVectorSC:
159156 return false ;
160157 case VPInstructionSC:
@@ -715,6 +712,10 @@ Value *VPInstruction::generate(VPTransformState &State) {
715712 Builder.getInt64Ty (), Mask, true , " first.active.lane" );
716713 return Builder.CreateExtractElement (Vec, Ctz, " early.exit.value" );
717714 }
715+ case VPInstruction::Splat:
716+ return State.Builder .CreateVectorSplat (State.VF ,
717+ State.get (getOperand (0 ), true ));
718+
718719 default :
719720 llvm_unreachable (" Unsupported opcode for instruction" );
720721 }
@@ -826,6 +827,7 @@ bool VPInstruction::opcodeMayReadOrWriteFromMemory() const {
826827 case VPInstruction::LogicalAnd:
827828 case VPInstruction::Not:
828829 case VPInstruction::PtrAdd:
830+ case VPInstruction::Splat:
829831 return false ;
830832 default :
831833 return true ;
@@ -853,6 +855,7 @@ bool VPInstruction::onlyFirstLaneUsed(const VPValue *Op) const {
853855 case VPInstruction::BranchOnCount:
854856 case VPInstruction::BranchOnCond:
855857 case VPInstruction::ResumePhi:
858+ case VPInstruction::Splat:
856859 return true ;
857860 };
858861 llvm_unreachable (" switch should return" );
@@ -944,6 +947,9 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
944947 case VPInstruction::ExtractFirstActive:
945948 O << " extract-first-active" ;
946949 break ;
950+ case VPInstruction::Splat:
951+ O << " splat" ;
952+ break ;
947953 default :
948954 O << Instruction::getOpcodeName (getOpcode ());
949955 }
@@ -2319,22 +2325,6 @@ void VPScalarCastRecipe ::print(raw_ostream &O, const Twine &Indent,
23192325}
23202326#endif
23212327
2322- void VPSplatRecipe::execute (VPTransformState &State) {
2323- Value *Splat =
2324- State.Builder .CreateVectorSplat (State.VF , State.get (getOperand (0 ), true ));
2325- State.set (this , Splat);
2326- }
2327-
2328- #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2329- void VPSplatRecipe::print (raw_ostream &O, const Twine &Indent,
2330- VPSlotTracker &SlotTracker) const {
2331- O << Indent;
2332- printAsOperand (O, SlotTracker);
2333- O << " = SPLAT " ;
2334- printOperands (O, SlotTracker);
2335- }
2336- #endif
2337-
23382328void VPStepVectorRecipe::execute (VPTransformState &State) {
23392329 VectorType *Ty = VectorType::get (ScalarTy, State.VF );
23402330 State.set (this , State.Builder .CreateStepVector (Ty));
0 commit comments