
Logic in this pass assumes that all users of loop instructions are either in the same loop or are LCSSA Phis. In fact, there can also be users in unreachable blocks that currently break assertions. Such users don't need to go to the next round of simplifications. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D124368
24 lines
678 B
LLVM
24 lines
678 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt -S %s -passes=loop-instsimplify | FileCheck %s
|
|
; RUN: opt -S %s -passes='loop-mssa(loop-instsimplify)' -verify-memoryssa | FileCheck %s
|
|
|
|
define i32 @test_01() {
|
|
; CHECK-LABEL: @test_01(
|
|
; CHECK-NEXT: bb:
|
|
; CHECK-NEXT: br label [[LOOP:%.*]]
|
|
; CHECK: loop:
|
|
; CHECK-NEXT: br label [[LOOP]]
|
|
; CHECK: unreached:
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
bb:
|
|
br label %loop
|
|
|
|
loop: ; preds = %bb, %loop
|
|
%tmp = lshr exact i32 undef, 16
|
|
br label %loop
|
|
|
|
unreached: ; No predecessors!
|
|
ret i32 %tmp
|
|
}
|