Miguel Saldivar 2c7cf896be
[llvm][UnifyLoopExits] Avoid optimization if no exit block is found (#165343)
If there is not an exit block, we should not try unify the loops.
Instead we should just return.

Fixes #165252
2026-01-26 01:31:28 +01:00

16 lines
292 B
LLVM

; RUN: opt -passes=unify-loop-exits -S %s
; Based from this issue: https://github.com/llvm/llvm-project/issues/165252
define void @test() {
entry:
br i1 true, label %end, label %Loop
Loop:
%V = phi i32 [0, %entry], [%V1, %Loop]
%V1 = add i32 %V, 1
br label %Loop
end:
ret void
}