Reverted r332654 as it has broken some buildbots and left unfixed for a long time.
The introduced problem is:
llvm.src/lib/Transforms/Vectorize/VPlanVerifier.cpp:29:13: error: unused function 'hasDuplicates' [-Werror,-Wunused-function]
static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
^
llvm-svn: 332747
diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h
index 08f1429..5096689 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanValue.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h
@@ -37,34 +37,13 @@
// coming from the input IR, instructions which VPlan will generate if executed
// and live-outs which the VPlan will need to fix accordingly.
class VPValue {
- friend class VPBuilder;
private:
const unsigned char SubclassID; ///< Subclass identifier (for isa/dyn_cast).
SmallVector<VPUser *, 1> Users;
protected:
- // Hold the underlying Value, if any, attached to this VPValue.
- Value *UnderlyingVal;
-
- VPValue(const unsigned char SC, Value *UV = nullptr)
- : SubclassID(SC), UnderlyingVal(UV) {}
-
- // DESIGN PRINCIPLE: Access to the underlying IR must be strictly limited to
- // the front-end and back-end of VPlan so that the middle-end is as
- // independent as possible of the underlying IR. We grant access to the
- // underlying IR using friendship. In that way, we should be able to use VPlan
- // for multiple underlying IRs (Polly?) by providing a new VPlan front-end,
- // back-end and analysis information for the new IR.
-
- /// Return the underlying Value attached to this VPValue.
- Value *getUnderlyingValue() { return UnderlyingVal; }
-
- // Set \p Val as the underlying Value of this VPValue.
- void setUnderlyingValue(Value *Val) {
- assert(!UnderlyingVal && "Underlying Value is already set.");
- UnderlyingVal = Val;
- }
+ VPValue(const unsigned char SC) : SubclassID(SC) {}
public:
/// An enumeration for keeping track of the concrete subclass of VPValue that
@@ -73,7 +52,7 @@
/// type identification.
enum { VPValueSC, VPUserSC, VPInstructionSC };
- VPValue(Value *UV = nullptr) : VPValue(VPValueSC, UV) {}
+ VPValue() : SubclassID(VPValueSC) {}
VPValue(const VPValue &) = delete;
VPValue &operator=(const VPValue &) = delete;
@@ -115,6 +94,11 @@
private:
SmallVector<VPValue *, 2> Operands;
+ void addOperand(VPValue *Operand) {
+ Operands.push_back(Operand);
+ Operand->addUser(*this);
+ }
+
protected:
VPUser(const unsigned char SC) : VPValue(SC) {}
VPUser(const unsigned char SC, ArrayRef<VPValue *> Operands) : VPValue(SC) {
@@ -136,11 +120,6 @@
V->getVPValueID() <= VPInstructionSC;
}
- void addOperand(VPValue *Operand) {
- Operands.push_back(Operand);
- Operand->addUser(*this);
- }
-
unsigned getNumOperands() const { return Operands.size(); }
inline VPValue *getOperand(unsigned N) const {
assert(N < Operands.size() && "Operand index out of bounds");