From d09530144a5412a01d222a77257ab2be12d977f1 Mon Sep 17 00:00:00 2001 From: Diego Caballero Date: Mon, 9 Jul 2018 15:57:09 +0000 Subject: [VPlan][LV] Introduce condition bit in VPBlockBase This patch introduces a VPValue in VPBlockBase to represent the condition bit that is used as successor selector when a block has multiple successors. This information wasn't necessary until now, when we are about to introduce outer loop vectorization support in VPlan code gen. Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D48814 llvm-svn: 336554 --- llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp') diff --git a/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp index 282a995da45..e2b8a8ab5d8 100644 --- a/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp +++ b/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp @@ -61,10 +61,11 @@ TEST_F(VPlanHCFGTest, testBuildHCFGInnerLoop) { BasicBlock *LoopHeader = F->getEntryBlock().getSingleSuccessor(); auto Plan = doBuildPlan(LoopHeader); - VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock(); + VPBasicBlock *Entry = Plan->getEntry()->getEntryBasicBlock(); EXPECT_NE(nullptr, Entry->getSingleSuccessor()); EXPECT_EQ(0u, Entry->getNumPredecessors()); EXPECT_EQ(1u, Entry->getNumSuccessors()); + EXPECT_EQ(nullptr, Entry->getCondBit()); VPBasicBlock *VecBB = Entry->getSingleSuccessor()->getEntryBasicBlock(); EXPECT_EQ(7u, VecBB->size()); @@ -105,6 +106,7 @@ TEST_F(VPlanHCFGTest, testBuildHCFGInnerLoop) { EXPECT_EQ(Instruction::ICmp, ICmp->getOpcode()); EXPECT_EQ(2u, ICmp->getNumOperands()); EXPECT_EQ(IndvarAdd, ICmp->getOperand(0)); + EXPECT_EQ(VecBB->getCondBit(), ICmp); LoopVectorizationLegality::InductionList Inductions; SmallPtrSet DeadInstructions; -- cgit v1.2.3