summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-14 22:17:14 +0000
committerDan Gohman <gohman@apple.com>2009-04-14 22:17:14 +0000
commite5cd1fcdb93d2e3bad26344f5ada17857a0253b2 (patch)
treeeefd98d4c0d7f1c13422cfe941d268797a84cb4b /llvm/test/CodeGen/X86
parentb4a8fe8dcc910e57be42ed62c3106fafd6d6e195 (diff)
downloadbcm5719-llvm-e5cd1fcdb93d2e3bad26344f5ada17857a0253b2.tar.gz
bcm5719-llvm-e5cd1fcdb93d2e3bad26344f5ada17857a0253b2.zip
When the result of an EXTRACT_SUBREG, INSERT_SUBREG, or SUBREG_TO_REG
operator is used by a CopyToReg to export the value to a different block, don't reuse the CopyToReg's register for the subreg operation result if the register isn't precisely the right class for the subreg operation. Also, rename the h-registers.ll test, now that there are more than one. llvm-svn: 69087
Diffstat (limited to 'llvm/test/CodeGen/X86')
-rw-r--r--llvm/test/CodeGen/X86/h-registers-0.ll (renamed from llvm/test/CodeGen/X86/h-registers.ll)0
-rw-r--r--llvm/test/CodeGen/X86/h-registers-1.ll39
2 files changed, 39 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/h-registers.ll b/llvm/test/CodeGen/X86/h-registers-0.ll
index 2777be9cc3e..2777be9cc3e 100644
--- a/llvm/test/CodeGen/X86/h-registers.ll
+++ b/llvm/test/CodeGen/X86/h-registers-0.ll
diff --git a/llvm/test/CodeGen/X86/h-registers-1.ll b/llvm/test/CodeGen/X86/h-registers-1.ll
new file mode 100644
index 00000000000..789f3dd18f0
--- /dev/null
+++ b/llvm/test/CodeGen/X86/h-registers-1.ll
@@ -0,0 +1,39 @@
+; RUN: llvm-as < %s | llc -march=x86-64 > %t
+; RUN: grep {movzbl %\[abcd\]h,} %t | count 8
+; RUN: grep {%\[abcd\]h} %t | not grep {%r\[\[:digit:\]\]*d}
+
+; LLVM creates virtual registers for values live across blocks
+; based on the type of the value. Make sure that the extracts
+; here use the GR64_NOREX register class for their result,
+; instead of plain GR64.
+
+define i64 @foo(i64 %a, i64 %b, i64 %c, i64 %d,
+ i64 %e, i64 %f, i64 %g, i64 %h) {
+ %sa = lshr i64 %a, 8
+ %A = and i64 %sa, 255
+ %sb = lshr i64 %b, 8
+ %B = and i64 %sb, 255
+ %sc = lshr i64 %c, 8
+ %C = and i64 %sc, 255
+ %sd = lshr i64 %d, 8
+ %D = and i64 %sd, 255
+ %se = lshr i64 %e, 8
+ %E = and i64 %se, 255
+ %sf = lshr i64 %f, 8
+ %F = and i64 %sf, 255
+ %sg = lshr i64 %g, 8
+ %G = and i64 %sg, 255
+ %sh = lshr i64 %h, 8
+ %H = and i64 %sh, 255
+ br label %next
+
+next:
+ %u = add i64 %A, %B
+ %v = add i64 %C, %D
+ %w = add i64 %E, %F
+ %x = add i64 %G, %H
+ %y = add i64 %u, %v
+ %z = add i64 %w, %x
+ %t = add i64 %y, %z
+ ret i64 %t
+}
OpenPOWER on IntegriCloud