diff options
author | Xin Tong <trent.xin.tong@gmail.com> | 2018-06-18 23:20:08 +0000 |
---|---|---|
committer | Xin Tong <trent.xin.tong@gmail.com> | 2018-06-18 23:20:08 +0000 |
commit | 849db7fa025496cf1bf9cb8a4ac67f875d439039 (patch) | |
tree | f0be9691cd26c2c323895c05a6b149c1a12cf4ba /unittests/Transforms/Utils | |
parent | f976cf4cca0794267f28b54e468007fd476d37d9 (diff) |
Revert "Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor"
This reverts commit f976cf4cca0794267f28b54e468007fd476d37d9.
I am reverting this because it causes break in a few bots and its going
to take me sometime to look at this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Transforms/Utils')
-rw-r--r-- | unittests/Transforms/Utils/BasicBlockUtils.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/unittests/Transforms/Utils/BasicBlockUtils.cpp b/unittests/Transforms/Utils/BasicBlockUtils.cpp index 590e7f6ada6..2d0a9302011 100644 --- a/unittests/Transforms/Utils/BasicBlockUtils.cpp +++ b/unittests/Transforms/Utils/BasicBlockUtils.cpp @@ -50,31 +50,3 @@ TEST(BasicBlockUtils, SplitBlockPredecessors) { SplitBlockPredecessors(&F->getEntryBlock(), {}, "split.entry", &DT); EXPECT_TRUE(DT.verify()); } - -TEST(BasicBlockUtils, MergeBlockIntoPredecessor) { - LLVMContext C; - std::unique_ptr<Module> M = parseIR(C, - R"( - - define i32 @f(i8* %str) { - entry: - %dead = extractvalue [1 x i8*] [ i8* blockaddress(@f, %L0) ], 0 - br label %L0 - L0: - ret i32 0 - } - )"); - - // First remove the dead instruction to empty the usage of the constant - // containing blockaddress(@f, %L0) - Function *F = M->getFunction("f"); - auto BBI = F->begin(); - Instruction *DI = &*((*BBI).begin()); - EXPECT_TRUE(DI->use_empty()); - DI->eraseFromParent(); - - // Get L0 and make sure that it can be merged into entry block. - ++BBI; - BasicBlock *BB = &(*BBI); - EXPECT_TRUE(MergeBlockIntoPredecessor(BB)); -} |