summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
diff options
context:
space:
mode:
authorQuentin Colombet <quentin.colombet@gmail.com>2019-03-14 01:37:13 +0000
committerQuentin Colombet <quentin.colombet@gmail.com>2019-03-14 01:37:13 +0000
commite77e5f44b871faa775b2cfa289b35f900f9443ab (patch)
tree42c308960e044b69f92972ce4d5f29036b04b6e9 /llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
parent591040adc2666006b7242520f8b55e8960b07d71 (diff)
downloadbcm5719-llvm-e77e5f44b871faa775b2cfa289b35f900f9443ab.tar.gz
bcm5719-llvm-e77e5f44b871faa775b2cfa289b35f900f9443ab.zip
[GlobalISel][Utils] Add a getConstantVRegVal variant that looks through instrs
getConstantVRegVal used to only look for G_CONSTANT when looking at unboxing the value of a vreg. However, constants are sometimes not directly used and are hidden behind trunc, s|zext or copy chain of computation. In particular this may be introduced by the legalization process that doesn't want to simplify these patterns because it can lead to infine loop when legalizing a constant. To circumvent that problem, add a new variant of getConstantVRegVal, named getConstantVRegValWithLookThrough, that allow to look through extensions. Differential Revision: https://reviews.llvm.org/D59227 llvm-svn: 356116
Diffstat (limited to 'llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll')
-rw-r--r--llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll b/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
index f15977cf6b7..2753fe157a5 100644
--- a/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
+++ b/llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
@@ -64,14 +64,12 @@ entry:
define i32 @select_with_negation(i32 %a, i32 %b, i32 %x, i32 %y) {
; MIPS32-LABEL: select_with_negation:
; MIPS32: # %bb.0: # %entry
-; MIPS32-NEXT: lui $1, 65535
-; MIPS32-NEXT: ori $1, $1, 65535
; MIPS32-NEXT: slt $4, $4, $5
-; MIPS32-NEXT: xor $1, $4, $1
-; MIPS32-NEXT: lui $4, 0
-; MIPS32-NEXT: ori $4, $4, 1
-; MIPS32-NEXT: and $1, $1, $4
-; MIPS32-NEXT: movn $7, $6, $1
+; MIPS32-NEXT: not $4, $4
+; MIPS32-NEXT: lui $5, 0
+; MIPS32-NEXT: ori $5, $5, 1
+; MIPS32-NEXT: and $4, $4, $5
+; MIPS32-NEXT: movn $7, $6, $4
; MIPS32-NEXT: move $2, $7
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
OpenPOWER on IntegriCloud