1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 00:12:50 +01:00
llvm-mirror/test/CodeGen/X86/codegen-prepare-extload.ll
Dan Gohman ef1f246d88 Move zext and sext casts fed by loads into the same block as the
load, to help SelectionDAG fold them into the loads, unless
conditions are unfavorable.

llvm-svn: 84271
2009-10-16 20:59:35 +00:00

21 lines
425 B
LLVM

; RUN: llc < %s -march=x86-64 | FileCheck %s
; rdar://7304838
; CodeGenPrepare should move the zext into the block with the load
; so that SelectionDAG can select it with the load.
; CHECK: movzbl (%rdi), %eax
define void @foo(i8* %p, i32* %q) {
entry:
%t = load i8* %p
%a = icmp slt i8 %t, 20
br i1 %a, label %true, label %false
true:
%s = zext i8 %t to i32
store i32 %s, i32* %q
ret void
false:
ret void
}