Skip to content

Commit 7f9235c

Browse files
committed
!fixup address latest comments, thanks
1 parent 33813d3 commit 7f9235c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ static bool isDefinedInsideLoopRegions(const VPValue *VPV) {
13751375
}
13761376

13771377
Type *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

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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"));

llvm/lib/Transforms/Vectorize/VPlanValue.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class VPValue {
9292
public:
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

0 commit comments

Comments
 (0)