diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-16 20:59:35 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-16 20:59:35 +0000 |
commit | b00f236b03ea57520f94823780896ebdbc5d8bdc (patch) | |
tree | d023b7481f8606f36efb2bf30f796d830a7eb2f3 /test/CodeGen/X86/codegen-prepare-extload.ll | |
parent | a43d46f523dff4b784ee28a3b196a065a15d90f2 (diff) | |
download | external_llvm-b00f236b03ea57520f94823780896ebdbc5d8bdc.zip external_llvm-b00f236b03ea57520f94823780896ebdbc5d8bdc.tar.gz external_llvm-b00f236b03ea57520f94823780896ebdbc5d8bdc.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/codegen-prepare-extload.ll')
-rw-r--r-- | test/CodeGen/X86/codegen-prepare-extload.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/codegen-prepare-extload.ll b/test/CodeGen/X86/codegen-prepare-extload.ll new file mode 100644 index 0000000..9f57d53 --- /dev/null +++ b/test/CodeGen/X86/codegen-prepare-extload.ll @@ -0,0 +1,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 +} |