1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/Transforms/LoopDeletion/use-in-unreachable.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

25 lines
577 B
LLVM

; RUN: opt < %s -loop-deletion -S | FileCheck %s
; Checking that possible users of instruction from the loop in
; unreachable blocks are handled.
define i64 @foo() {
entry:
br label %invloop
; CHECK-LABEL-NOT: invloop
invloop:
%indvar1 = phi i64 [ 3, %entry ], [ %indvar2, %invloop_iter ]
%check = icmp ult i64 %indvar1, 400
br i1 %check, label %invloop_iter, label %loopexit
invloop_iter:
%indvar2 = add i64 %indvar1, 1
%baddef = add i64 0, 0
br label %invloop
loopexit:
ret i64 0
deadcode:
; CHECK-LABEL: deadcode
; CHECK: ret i64 undef
ret i64 %baddef
}