From d19851ac7edaf7c6c9290a493a79d02fd18d2be3 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Fri, 14 Sep 2018 02:02:57 +0000 Subject: Fix for the buildbot failure http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/23635 from the commit (r342197) of https://reviews.llvm.org/D50820. llvm-svn: 342201 --- llvm/lib/Transforms/Vectorize/VPlan.cpp | 4 ---- llvm/lib/Transforms/Vectorize/VPlan.h | 10 ++++++++++ llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize') diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 511b31a28c3..09d20fbdefe 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -205,10 +205,6 @@ void VPBasicBlock::execute(VPTransformState *State) { Value *IRCBV = CBV->getUnderlyingValue(); assert(IRCBV && "Unexpected null underlying value for condition bit"); - // Delete the condition bit at this point - it should be no longer needed. - delete CBV; - setCondBit(nullptr); - // Condition bit value in a VPBasicBlock is used as the branch selector. In // the VPlan-native path case, since all branches are uniform we generate a // branch instruction using the condition value from vector lane 0 and dummy diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 8d544034e94..c3123b41600 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -1118,6 +1118,9 @@ private: /// Holds the VPLoopInfo analysis for this VPlan. VPLoopInfo VPLInfo; + /// Holds the condition bit values built during VPInstruction to VPRecipe transformation. + SmallVector VPCBVs; + public: VPlan(VPBlockBase *Entry = nullptr) : Entry(Entry) {} @@ -1128,6 +1131,8 @@ public: delete MapEntry.second; for (VPValue *Def : VPExternalDefs) delete Def; + for (VPValue *CBV : VPCBVs) + delete CBV; } /// Generate the IR code for this VPlan. @@ -1152,6 +1157,11 @@ public: VPExternalDefs.insert(VPVal); } + /// Add \p CBV to the vector of condition bit values. + void addCBV(VPValue *CBV) { + VPCBVs.push_back(CBV); + } + void addVPValue(Value *V) { assert(V && "Trying to add a null Value to VPlan"); assert(!Value2VPValue.count(V) && "Value already exists in VPlan"); diff --git a/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp index 910d0f509ce..3ad7fc7e7b9 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp @@ -33,6 +33,7 @@ void VPlanHCFGTransforms::VPInstructionsToVPRecipes( if (auto *CondBit = VPBB->getCondBit()) { auto *NCondBit = new VPValue(CondBit->getUnderlyingValue()); VPBB->setCondBit(NCondBit); + Plan->addCBV(NCondBit); } } for (VPBlockBase *Base : RPOT) { -- cgit v1.2.3