summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
diff options
context:
space:
mode:
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>2019-03-15 07:07:50 +0000
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>2019-03-15 07:07:50 +0000
commit3e0da146ac2ad98e7463ce4114b466283ca1345c (patch)
treeb42d7702b65ebf1f950eab6d8ad42e41bd4bd813 /llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
parent76a7ecb3aeb4ed43ee146dd532f322bbff2adb8f (diff)
downloadbcm5719-llvm-3e0da146ac2ad98e7463ce4114b466283ca1345c.tar.gz
bcm5719-llvm-3e0da146ac2ad98e7463ce4114b466283ca1345c.zip
[MIPS GlobalISel] Improve selection of constants
Certain 32 bit constants can be generated with a single instruction instead of two. Implement materialize32BitImm function for MIPS32. Differential Revision: https://reviews.llvm.org/D59369 llvm-svn: 356238
Diffstat (limited to 'llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll')
-rw-r--r--llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll15
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll b/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
index 2753fe157a5..4babe892510 100644
--- a/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
+++ b/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
@@ -4,8 +4,7 @@
define i8 @select_i8(i1 %test, i8 %a, i8 %b) {
; MIPS32-LABEL: select_i8:
; MIPS32: # %bb.0: # %entry
-; MIPS32-NEXT: lui $1, 0
-; MIPS32-NEXT: ori $1, $1, 1
+; MIPS32-NEXT: ori $1, $zero, 1
; MIPS32-NEXT: and $1, $4, $1
; MIPS32-NEXT: movn $6, $5, $1
; MIPS32-NEXT: move $2, $6
@@ -19,8 +18,7 @@ entry:
define i16 @select_i16(i1 %test, i16 %a, i16 %b) {
; MIPS32-LABEL: select_i16:
; MIPS32: # %bb.0: # %entry
-; MIPS32-NEXT: lui $1, 0
-; MIPS32-NEXT: ori $1, $1, 1
+; MIPS32-NEXT: ori $1, $zero, 1
; MIPS32-NEXT: and $1, $4, $1
; MIPS32-NEXT: movn $6, $5, $1
; MIPS32-NEXT: move $2, $6
@@ -34,8 +32,7 @@ entry:
define i32 @select_i32(i1 %test, i32 %a, i32 %b) {
; MIPS32-LABEL: select_i32:
; MIPS32: # %bb.0: # %entry
-; MIPS32-NEXT: lui $1, 0
-; MIPS32-NEXT: ori $1, $1, 1
+; MIPS32-NEXT: ori $1, $zero, 1
; MIPS32-NEXT: and $1, $4, $1
; MIPS32-NEXT: movn $6, $5, $1
; MIPS32-NEXT: move $2, $6
@@ -49,8 +46,7 @@ entry:
define i32* @select_ptr(i1 %test, i32* %a, i32* %b) {
; MIPS32-LABEL: select_ptr:
; MIPS32: # %bb.0: # %entry
-; MIPS32-NEXT: lui $1, 0
-; MIPS32-NEXT: ori $1, $1, 1
+; MIPS32-NEXT: ori $1, $zero, 1
; MIPS32-NEXT: and $1, $4, $1
; MIPS32-NEXT: movn $6, $5, $1
; MIPS32-NEXT: move $2, $6
@@ -66,8 +62,7 @@ define i32 @select_with_negation(i32 %a, i32 %b, i32 %x, i32 %y) {
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: slt $4, $4, $5
; MIPS32-NEXT: not $4, $4
-; MIPS32-NEXT: lui $5, 0
-; MIPS32-NEXT: ori $5, $5, 1
+; MIPS32-NEXT: ori $5, $zero, 1
; MIPS32-NEXT: and $4, $4, $5
; MIPS32-NEXT: movn $7, $6, $4
; MIPS32-NEXT: move $2, $7
OpenPOWER on IntegriCloud