1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/test/CodeGen/X86/isel-sink.ll
Eli Friedman 7b09a0aa53 Turn on -addr-sink-using-gep by default.
The new codepath has been in the tree for years, and there isn't any
reason to use two codepaths here.

Differential Revision: https://reviews.llvm.org/D30596

llvm-svn: 299723
2017-04-06 22:42:18 +00:00

23 lines
488 B
LLVM

; RUN: llc < %s -march=x86 | FileCheck %s
define i32 @test(i32* %X, i32 %B) {
; CHECK-LABEL: test:
; CHECK-NOT: ret
; CHECK-NOT: lea
; CHECK: mov{{.}} $4, ({{.*}},{{.*}},4)
; CHECK: ret
; CHECK: mov{{.}} ({{.*}},{{.*}},4),
; CHECK: ret
; This gep should be sunk out of this block into the load/store users.
%P = getelementptr i32, i32* %X, i32 %B
%G = icmp ult i32 %B, 1234
br i1 %G, label %T, label %F
T:
store i32 4, i32* %P
ret i32 141
F:
%V = load i32, i32* %P
ret i32 %V
}