summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2010-12-07 19:00:20 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2010-12-07 19:00:20 +0000
commitf0c6e3780d21c19e77a0e5238955c5927b1ac12d (patch)
tree45b832e513a5d43bda60ef975d4d5548b0fbd613 /llvm/test/CodeGen/Mips
parentfb207c1cb902d129ac06113d1e525ca56282f1eb (diff)
downloadbcm5719-llvm-f0c6e3780d21c19e77a0e5238955c5927b1ac12d.tar.gz
bcm5719-llvm-f0c6e3780d21c19e77a0e5238955c5927b1ac12d.zip
Match a pattern generated by a dag combiner opt where:
(select (load (load tga0)) (load tga1)) => (load (select (load tga0) tga1)) Thanks to Akira for pointing that. llvm-svn: 121163
Diffstat (limited to 'llvm/test/CodeGen/Mips')
-rwxr-xr-xllvm/test/CodeGen/Mips/cmov.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/cmov.ll b/llvm/test/CodeGen/Mips/cmov.ll
new file mode 100755
index 00000000000..7d3e0252e3c
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/cmov.ll
@@ -0,0 +1,15 @@
+; RUN: llc -march=mips -mcpu=4ke < %s | FileCheck %s
+
+@i1 = global [3 x i32] [i32 1, i32 2, i32 3], align 4
+@i3 = common global i32* null, align 4
+
+; CHECK: lw $3, %got(i3)($gp)
+; CHECK: addiu $5, $gp, %got(i1)
+define i32* @cmov1(i32 %s) nounwind readonly {
+entry:
+ %tobool = icmp ne i32 %s, 0
+ %tmp1 = load i32** @i3, align 4
+ %cond = select i1 %tobool, i32* getelementptr inbounds ([3 x i32]* @i1, i32 0, i32 0), i32* %tmp1
+ ret i32* %cond
+}
+
OpenPOWER on IntegriCloud