summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/zext-inreg-1.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-28 22:18:25 +0000
committerDan Gohman <gohman@apple.com>2008-07-28 22:18:25 +0000
commit26ec56c75ca7c3366409cb125332486ee654e3b8 (patch)
treeb9cc775dea0bc16b83d0bc87d12f1903552e4ca8 /llvm/test/CodeGen/X86/zext-inreg-1.ll
parent804c95df52ebfba155aa5697aeb283adcd28477a (diff)
downloadbcm5719-llvm-26ec56c75ca7c3366409cb125332486ee654e3b8.tar.gz
bcm5719-llvm-26ec56c75ca7c3366409cb125332486ee654e3b8.zip
Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation,
which is represented in codegen as an 'and' operation. This matches them with movz instructions, instead of leaving them to be matched by and instructions with an immediate field. llvm-svn: 54147
Diffstat (limited to 'llvm/test/CodeGen/X86/zext-inreg-1.ll')
-rw-r--r--llvm/test/CodeGen/X86/zext-inreg-1.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/zext-inreg-1.ll b/llvm/test/CodeGen/X86/zext-inreg-1.ll
new file mode 100644
index 00000000000..4a80fe5fe35
--- /dev/null
+++ b/llvm/test/CodeGen/X86/zext-inreg-1.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep and
+
+; These tests differ from the ones in zext-inreg-0.ll in that
+; on x86-64 they do require and instructions.
+
+; These should use movzbl instead of 'and 255'.
+; This related to not having ZERO_EXTEND_REG node.
+
+define i64 @g(i64 %d) nounwind {
+ %e = add i64 %d, 1
+ %retval = and i64 %e, 1099511627775
+ ret i64 %retval
+}
+define i64 @h(i64 %d) nounwind {
+ %e = add i64 %d, 1
+ %retval = and i64 %e, 281474976710655
+ ret i64 %retval
+}
OpenPOWER on IntegriCloud