This repository was archived by the owner on Sep 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,16 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
6161 case Instruction::ICmp:
6262 case VPInstruction::ActiveLaneMask:
6363 return inferScalarType (R->getOperand (1 ));
64+ case VPInstruction::ComputeReductionResult: {
65+ auto *PhiR = cast<VPReductionPHIRecipe>(R->getOperand (0 ));
66+ auto *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue ());
67+ return OrigPhi->getType ();
68+ }
6469 case VPInstruction::ExplicitVectorLength:
6570 return Type::getIntNTy (Ctx, 32 );
6671 case VPInstruction::FirstOrderRecurrenceSplice:
6772 case VPInstruction::Not:
73+ case VPInstruction::ResumePhi:
6874 return SetResultTyFromOp ();
6975 case VPInstruction::ExtractFromEnd: {
7076 Type *BaseTy = inferScalarType (R->getOperand (0 ));
Original file line number Diff line number Diff line change @@ -629,7 +629,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
629629 Value *IncomingFromOtherPreds =
630630 State.get (getOperand (1 ), /* IsScalar */ true );
631631 auto *NewPhi =
632- Builder.CreatePHI (IncomingFromOtherPreds-> getType ( ), 2 , Name);
632+ Builder.CreatePHI (State. TypeAnalysis . inferScalarType ( this ), 2 , Name);
633633 BasicBlock *VPlanPred =
634634 State.CFG
635635 .VPBB2IRBB [cast<VPBasicBlock>(getParent ()->getPredecessors ()[0 ])];
You can’t perform that action at this time.
0 commit comments