From 11d3314241e056748da065b865ad9bf2496cbf76 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Thu, 24 Jan 2019 05:05:55 +0000 Subject: [PATCH] [NFC] Add a failing test on live block markup in term folding llvm-svn: 352023 --- .../LoopSimplifyCFG/live_block_marking.ll | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 llvm/test/Transforms/LoopSimplifyCFG/live_block_marking.ll diff --git a/llvm/test/Transforms/LoopSimplifyCFG/live_block_marking.ll b/llvm/test/Transforms/LoopSimplifyCFG/live_block_marking.ll new file mode 100644 index 000000000000..a4c0bac41214 --- /dev/null +++ b/llvm/test/Transforms/LoopSimplifyCFG/live_block_marking.ll @@ -0,0 +1,40 @@ +; XFAIL: * +; REQUIRES: asserts +; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -indvars -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,loop(indvars,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 -indvars -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 + +; This test demonstrates a bug in live blocks markup that is only catchable in +; inter-pass interaction. +define void @test(i1 %c) { + +; CHECK-LABEL: @test( + +entry: + br label %outer + +outer: + br i1 %c, label %to_fold, label %latch + +to_fold: + br i1 %c, label %latch, label %inner + +inner: + %iv = phi i32 [0, %to_fold], [%iv.next, %inner_latch] + %never = icmp sgt i32 %iv, 40 + br i1 %never, label %inner_latch, label %undead + +inner_latch: + %iv.next = add i32 %iv, 1 + %cmp = icmp slt i32 %iv.next, 10 + br i1 %cmp, label %inner, label %latch + +undead: + br label %latch + +latch: + br i1 true, label %outer, label %dead_exit + +dead_exit: + ret void +}