aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/codegen-prepare-extload.ll
blob: 9f57d53178f3d14081529f0eccd7f5cd2de277d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; 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
}