diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-26 14:59:13 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-26 14:59:13 +0000 |
commit | 6c23fa2442fea1fd38c0f4e5f7231c09e67ca5a7 (patch) | |
tree | 653575a566c8db990fb925757baf3fb7c3c67108 /llvm/test/CodeGen/X86 | |
parent | d926b985df604751a982d96d1ee328cffde716fd (diff) | |
download | bcm5719-llvm-6c23fa2442fea1fd38c0f4e5f7231c09e67ca5a7.tar.gz bcm5719-llvm-6c23fa2442fea1fd38c0f4e5f7231c09e67ca5a7.zip |
Don't use INSERT_SUBREG to model anyext operations on x86-64, as it
leads to partial-register definitions. To help avoid redundant
zero-extensions, also teach the h-register matching patterns that
use movzbl to match anyext as well as zext.
llvm-svn: 80099
Diffstat (limited to 'llvm/test/CodeGen/X86')
-rw-r--r-- | llvm/test/CodeGen/X86/anyext.ll | 18 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/ins_subreg_coalesce-1.ll | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/anyext.ll b/llvm/test/CodeGen/X86/anyext.ll new file mode 100644 index 00000000000..c5f03abee71 --- /dev/null +++ b/llvm/test/CodeGen/X86/anyext.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep movzbl | count 2 + +; Use movzbl to avoid partial-register updates. + +define i32 @foo(i32 %p, i8 zeroext %x) nounwind { + %q = trunc i32 %p to i8 + %r = udiv i8 %q, %x + %s = zext i8 %r to i32 + %t = and i32 %s, 1 + ret i32 %t +} +define i32 @bar(i32 %p, i16 zeroext %x) nounwind { + %q = trunc i32 %p to i16 + %r = udiv i16 %q, %x + %s = zext i16 %r to i32 + %t = and i32 %s, 1 + ret i32 %t +} diff --git a/llvm/test/CodeGen/X86/ins_subreg_coalesce-1.ll b/llvm/test/CodeGen/X86/ins_subreg_coalesce-1.ll index 863cda94c5f..a0347ea80d9 100644 --- a/llvm/test/CodeGen/X86/ins_subreg_coalesce-1.ll +++ b/llvm/test/CodeGen/X86/ins_subreg_coalesce-1.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep mov | count 2 +; RUN: llvm-as < %s | llc -march=x86 | grep mov | count 3 define fastcc i32 @sqlite3ExprResolveNames() nounwind { entry: |