summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-03-09 19:04:30 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-03-09 19:04:30 +0000
commitbee0b5b83efae45a5c537484ccf361d4ce7aabea (patch)
treeaef637ef91e6508eb3418f75fd0af06aa5143ae7
parentf133c26a0bfcea9850045ab6a4c894f825c9fcf0 (diff)
downloadbcm5719-llvm-bee0b5b83efae45a5c537484ccf361d4ce7aabea.tar.gz
bcm5719-llvm-bee0b5b83efae45a5c537484ccf361d4ce7aabea.zip
Add a test case for (store (op (load ..) ..) ..) folding.
llvm-svn: 26656
-rw-r--r--llvm/test/Regression/CodeGen/X86/store_op_load_fold.ll2
-rw-r--r--llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll45
2 files changed, 45 insertions, 2 deletions
diff --git a/llvm/test/Regression/CodeGen/X86/store_op_load_fold.ll b/llvm/test/Regression/CodeGen/X86/store_op_load_fold.ll
index 64d8da59eed..8aa971e2473 100644
--- a/llvm/test/Regression/CodeGen/X86/store_op_load_fold.ll
+++ b/llvm/test/Regression/CodeGen/X86/store_op_load_fold.ll
@@ -2,8 +2,6 @@
;
; Test the add and load are folded into the store instruction.
-target triple = "i686-pc-linux-gnu"
-
%X = weak global short 0
void %foo() {
diff --git a/llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll b/llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll
new file mode 100644
index 00000000000..53733e1f762
--- /dev/null
+++ b/llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll
@@ -0,0 +1,45 @@
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep 'and DWORD PTR' | wc -l | grep 1
+;
+; FIXME: The number of (store (and (load ..) ..) ..) really should be 2. But the current hack
+; only allow one of the folding to happen.
+
+ %struct.Macroblock = type { int, int, int, int, int, [8 x int], %struct.Macroblock*, %struct.Macroblock*, int, [2 x [4 x [4 x [2 x int]]]], [16 x sbyte], [16 x sbyte], int, long, [4 x int], [4 x int], long, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, short, double, int, int, int, int, int, int, int, int, int }
+
+implementation ; Functions:
+
+internal fastcc int %dct_chroma(int %uv, int %cr_cbp) {
+entry:
+ br bool false, label %bb2611, label %cond_true129
+
+cond_true129: ; preds = %entry
+ ret int 0
+
+bb2611: ; preds = %entry
+ br bool false, label %cond_true2732.preheader, label %cond_next2752
+
+cond_true2732.preheader: ; preds = %bb2611
+ %tmp2666 = getelementptr %struct.Macroblock* null, int 0, uint 13 ; <long*> [#uses=2]
+ %tmp2674 = cast int 0 to ubyte ; <ubyte> [#uses=1]
+ br bool false, label %cond_true2732.preheader.split.us, label %cond_true2732.preheader.split
+
+cond_true2732.preheader.split.us: ; preds = %cond_true2732.preheader
+ br bool false, label %cond_true2732.outer.us.us, label %cond_true2732.outer.us
+
+cond_true2732.outer.us.us: ; preds = %cond_true2732.preheader.split.us
+ %tmp2667.us.us = load long* %tmp2666 ; <long> [#uses=1]
+ %tmp2670.us.us = load long* null ; <long> [#uses=1]
+ %tmp2675.us.us = shl long %tmp2670.us.us, ubyte %tmp2674 ; <long> [#uses=1]
+ %tmp2675not.us.us = xor long %tmp2675.us.us, -1 ; <long> [#uses=1]
+ %tmp2676.us.us = and long %tmp2667.us.us, %tmp2675not.us.us ; <long> [#uses=1]
+ store long %tmp2676.us.us, long* %tmp2666
+ ret int 0
+
+cond_true2732.outer.us: ; preds = %cond_true2732.preheader.split.us
+ ret int 0
+
+cond_true2732.preheader.split: ; preds = %cond_true2732.preheader
+ ret int 0
+
+cond_next2752: ; preds = %bb2611
+ ret int 0
+}
OpenPOWER on IntegriCloud