mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
1512bd9998
as MachineSink, but it isn't constrained by MachineInstr-level details. llvm-svn: 103257
23 lines
434 B
LLVM
23 lines
434 B
LLVM
; RUN: opt < %s -sink -S | FileCheck %s
|
|
|
|
@A = external global i32
|
|
@B = external global i32
|
|
|
|
; Sink should sink the load past the store (which doesn't overlap) into
|
|
; the block that uses it.
|
|
|
|
; CHECK: @foo
|
|
; CHECK: true:
|
|
; CHECK-NEXT: %l = load i32* @A
|
|
; CHECK-NEXT: ret i32 %l
|
|
|
|
define i32 @foo(i1 %z) {
|
|
%l = load i32* @A
|
|
store i32 0, i32* @B
|
|
br i1 %z, label %true, label %false
|
|
true:
|
|
ret i32 %l
|
|
false:
|
|
ret i32 0
|
|
}
|