File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1375,7 +1375,7 @@ static bool isDefinedInsideLoopRegions(const VPValue *VPV) {
13751375}
13761376
13771377Type *VPValue::getType () const {
1378- assert (isLiveIn ());
1378+ assert (isLiveIn () && " can only return the type for a live-in " );
13791379 return SubclassID == VPSymbolicValueSC ? Ty : getUnderlyingValue ()->getType ();
13801380}
13811381
Original file line number Diff line number Diff line change @@ -3454,7 +3454,7 @@ class VPlan {
34543454 VPlan (Loop *L, Type *InductionTy);
34553455
34563456 // / Construct a VPlan with a new VPBasicBlock as entry, a VPIRBasicBlock
3457- // / wrapping \p ScalarHeaderBB and a trip count of \p TC.
3457+ // / wrapping \p ScalarHeaderBB and a trip count of \p TC. Also creates symbolic VectorTripCount, VF and VFxUF VPValues using \p InductionTy.
34583458 VPlan (BasicBlock *ScalarHeaderBB, VPValue *TC, Type *InductionTy)
34593459 : VectorTripCount(InductionTy), VF(InductionTy), VFxUF(InductionTy) {
34603460 setEntry (createVPBasicBlock (" preheader" ));
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class VPValue {
9292public:
9393 // / Return the underlying Value attached to this VPValue.
9494 Value *getUnderlyingValue () const {
95- return SubclassID == VPSymbolicValueSC ? nullptr : UnderlyingVal;
95+ return isSymbolic () ? nullptr : UnderlyingVal;
9696 }
9797
9898 // / An enumeration for keeping track of the concrete subclass of VPValue that
@@ -181,9 +181,11 @@ class VPValue {
181181 // / Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
182182 bool isLiveIn () const { return !hasDefiningRecipe (); }
183183
184+ // / Returns true if the VPValue is symbolic, that is a live-in without underlying value.
184185 bool isSymbolic () const { return SubclassID == VPSymbolicValueSC; }
185186
186- Type *getType () const ;
187+ // / If the VPValue is a live-in, return its scalar type.
188+ Type *getScalarType () const ;
187189
188190 // / Returns the underlying IR value, if this VPValue is defined outside the
189191 // / scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
You can’t perform that action at this time.
0 commit comments