mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-09 15:57:28 +00:00
9aafdcf20d
Upgrade to use new Tcl exec based test harness. This exposes 3 bugs that were previously not being reported: test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll test/Transforms/GlobalOpt/memset.ll test/Transforms/IndVarsSimplify/exit_value_tests.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36065 91177308-0d34-0410-b5e6-96231b3b80d8
34 lines
870 B
LLVM
34 lines
870 B
LLVM
; The unify-function-exit-nodes pass often makes basic blocks that just contain
|
|
; a PHI node and a return. Make sure the simplify cfg can straighten out this
|
|
; important case. This is basically the most trivial form of tail-duplication.
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \
|
|
; RUN: not grep {br label}
|
|
|
|
int %test(bool %B, int %A, int %B) {
|
|
br bool %B, label %T, label %F
|
|
T:
|
|
br label %ret
|
|
F:
|
|
br label %ret
|
|
ret:
|
|
%X = phi int [%A, %F], [%B, %T]
|
|
ret int %X
|
|
}
|
|
|
|
; Make sure it's willing to move unconditional branches to return instructions
|
|
; as well, even if the return block is shared and the source blocks are
|
|
; non-empty.
|
|
int %test2(bool %B, int %A, int %B) {
|
|
br bool %B, label %T, label %F
|
|
T:
|
|
call int %test(bool true, int 5, int 8)
|
|
br label %ret
|
|
F:
|
|
call int %test(bool true, int 5, int 8)
|
|
br label %ret
|
|
ret:
|
|
ret int %A
|
|
}
|
|
|