1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/Transforms/ADCE/broken-loop-info.ll
Max Kazantsev d0c2ba9604 [ADCE] Fix incorrect reporting of CFG changes
This patch fixes 2 related bugs in ADCE:
- `performDeadCodeElimination` does not report changes if it did ONLY
  CFG changes (affects both old and new pass managers);
- When control flow removal is enabled, new pass manager does not
  drop CFG analyses.

Both can lead to incorrect loop info after ADCE that does only CFG changes.

Differential Revision: https://reviews.llvm.org/D78103
Reviewed By: Denis Antrushin
2020-04-14 20:26:13 +07:00

38 lines
1.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -licm -adce -licm -S < %s | FileCheck %s
; RUN: opt -passes='loop(licm),adce,loop(licm)' -S < %s | FileCheck %s
;
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"
define void @test() {
; CHECK-LABEL: @test(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: ret void
; CHECK: bb2:
; CHECK-NEXT: br label [[BB4:%.*]]
; CHECK: bb3:
; CHECK-NEXT: unreachable
; CHECK: bb4:
; CHECK-NEXT: br i1 true, label [[BB1:%.*]], label [[BB2]]
;
bb:
br label %bb2
bb1: ; preds = %bb4
ret void
bb2: ; preds = %bb4, %bb
br i1 undef, label %bb4, label %bb3
bb3: ; preds = %bb2
br label %bb4
bb4: ; preds = %bb3, %bb2
br i1 undef, label %bb1, label %bb2
}