mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 00:32:23 +00:00
de7465af34
`LoopUnrollPass` says that it preserves `LoopInfo` -- make it so. In particular, tell `LoopInfo` about copies of inner loops when unrolling the outer loop. Conservatively, also tell `ScalarEvolution` to forget about the original versions of these loops, since their inputs may have changed. Fixes PR20987. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219241 91177308-0d34-0410-b5e6-96231b3b80d8
36 lines
636 B
LLVM
36 lines
636 B
LLVM
; RUN: opt -S < %s -loop-unroll -block-freq | FileCheck %s
|
|
; Crasher from PR20987.
|
|
|
|
; CHECK: define void @update_loop_info_in_subloops
|
|
; CHECK: entry:
|
|
; CHECK: L:
|
|
; CHECK: L.inner:
|
|
; CHECK: L.inner.latch:
|
|
; CHECK: L.latch:
|
|
; CHECK: L.inner.1:
|
|
; CHECK: L.inner.latch.1:
|
|
; CHECK: L.latch.1:
|
|
|
|
define void @update_loop_info_in_subloops() {
|
|
entry:
|
|
br label %L
|
|
|
|
L:
|
|
%0 = phi i64 [ 1, %entry ], [ %1, %L.latch ]
|
|
br label %L.inner
|
|
|
|
L.inner:
|
|
br label %L.inner.latch
|
|
|
|
L.inner.latch:
|
|
br i1 false, label %L.latch, label %L.inner
|
|
|
|
L.latch:
|
|
%1 = add i64 %0, 1
|
|
%2 = icmp eq i64 %1, 3
|
|
br i1 %2, label %exit, label %L
|
|
|
|
exit:
|
|
ret void
|
|
}
|