diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2018-11-27 06:17:21 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-11-27 06:17:21 +0000 |
commit | c4e4d6449a58d479df6404d6358c679917fa990c (patch) | |
tree | 3d1f9b7a8aee2b6bbc736c047b5c8a662d6304ef /llvm/test/Transforms | |
parent | fe962736505ce2903b97ec774d5f56123477392a (diff) | |
download | bcm5719-llvm-c4e4d6449a58d479df6404d6358c679917fa990c.tar.gz bcm5719-llvm-c4e4d6449a58d479df6404d6358c679917fa990c.zip |
[LoopSimplifyCFG] Fix corner case with duplicating successors
It fixes a bug that doesn't update Phi inputs of the only live successor that
is in the list of block's successors more than once.
Thanks @uabelho for finding this.
Differential Revision: https://reviews.llvm.org/D54849
Reviewed By: anna
llvm-svn: 347640
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/LoopSimplifyCFG/phi_with_duplicating_inputs.ll | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/test/Transforms/LoopSimplifyCFG/phi_with_duplicating_inputs.ll b/llvm/test/Transforms/LoopSimplifyCFG/phi_with_duplicating_inputs.ll index 6158fcda403..3341571030d 100644 --- a/llvm/test/Transforms/LoopSimplifyCFG/phi_with_duplicating_inputs.ll +++ b/llvm/test/Transforms/LoopSimplifyCFG/phi_with_duplicating_inputs.ll @@ -1,6 +1,6 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; This is currently failing because of bug in LoopSimplifyCFG. It does not update ; duplicating Phi inputs properly. -; XFAIL: * ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(simplify-cfg)' -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -enable-mssa-loop-dependency=true -verify-memoryssa -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s @@ -9,9 +9,20 @@ target datalayout = "P40" @a = external global i16, align 1 -; CHECK-LABEL: @f1( - define void @f1(i1 %cond) { +; CHECK-LABEL: @f1( +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[FOR_COND:%.*]] +; CHECK: for.cond: +; CHECK-NEXT: br i1 [[COND:%.*]], label [[IF_THEN:%.*]], label [[FOR_INC:%.*]] +; CHECK: if.then: +; CHECK-NEXT: [[TMP0:%.*]] = load i16, i16* @a, align 1 +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i16 [[TMP0]], 0 +; CHECK-NEXT: br label [[FOR_INC]] +; CHECK: for.inc: +; CHECK-NEXT: [[C_1:%.*]] = phi i16 [ 2, [[IF_THEN]] ], [ 1, [[FOR_COND]] ] +; CHECK-NEXT: br label [[FOR_COND]] +; entry: br label %for.cond |