forked from OSchip/llvm-project
[VPlan] Add getLiveInIRValue accessor to VPValue.
This patch adds a new getLiveInIRValue accessor to VPValue, which returns the underlying value, if the VPValue is defined outside of VPlan. This is required to handle scalars in VPTransformState, which requires dealing with scalars defined outside of VPlan. We can simply check VPValue::Def to determine if the value is defined inside a VPlan. Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D92281
This commit is contained in:
parent
74438eff51
commit
0ce5f402e0
|
@ -166,6 +166,15 @@ public:
|
|||
void replaceAllUsesWith(VPValue *New);
|
||||
|
||||
VPDef *getDef() { return Def; }
|
||||
|
||||
/// Returns the underlying IR value, if this VPValue is defined outside the
|
||||
/// scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
|
||||
/// inside a VPlan.
|
||||
Value *getLiveInIRValue() {
|
||||
assert(!getDef() &&
|
||||
"VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
|
||||
return getUnderlyingValue();
|
||||
}
|
||||
};
|
||||
|
||||
typedef DenseMap<Value *, VPValue *> Value2VPValueTy;
|
||||
|
|
Loading…
Reference in New Issue