diff options
author | Galina Kistanova <gkistanova@gmail.com> | 2018-05-18 18:14:06 +0000 |
---|---|---|
committer | Galina Kistanova <gkistanova@gmail.com> | 2018-05-18 18:14:06 +0000 |
commit | 083ea389d673e4dcfa3bee476598440f07d66ce6 (patch) | |
tree | d55b7f1b2fe401f52073ed5b062c55b83c104efe /llvm/lib/Transforms/Vectorize/VPlanValue.h | |
parent | 0edca4f5059b817092435ab4d84705981399a07e (diff) | |
download | bcm5719-llvm-083ea389d673e4dcfa3bee476598440f07d66ce6.tar.gz bcm5719-llvm-083ea389d673e4dcfa3bee476598440f07d66ce6.zip |
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
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlanValue.h')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlanValue.h | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h index 08f142915b4..50966891e0e 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanValue.h +++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h @@ -37,34 +37,13 @@ class VPUser; // 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 @@ public: /// 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 @@ class VPUser : public VPValue { 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 @@ public: 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"); |