1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/Transforms/LICM/PR24013.ll
David Majnemer 243b5516a7 [LICM] Don't try to sink values out of loops without any exits
There is no suitable basic block to sink instructions in loops without
exits.  The only way an instruction in a loop without exits can be used
is as an incoming value to a PHI.  In such cases, the incoming block for
the corresponding value is unreachable.

This fixes PR24013.

Differential Revision: http://reviews.llvm.org/D10903

llvm-svn: 241987
2015-07-12 03:53:05 +00:00

20 lines
545 B
LLVM

; RUN: opt -licm -S < %s | FileCheck %s
define void @f(i1 zeroext %p1) {
; CHECK-LABEL: @f(
entry:
br label %lbl
lbl.loopexit: ; No predecessors!
br label %lbl
lbl: ; preds = %lbl.loopexit, %entry
%phi = phi i32 [ %conv, %lbl.loopexit ], [ undef, %entry ]
; CHECK: phi i32 [ undef, {{.*}} ], [ undef
br label %if.then.5
if.then.5: ; preds = %if.then.5, %lbl
%conv = zext i1 undef to i32
br label %if.then.5
}