Imported Upstream version 5.18.0.167

Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-20 08:25:10 +00:00
parent e19d552987
commit b084638f15
28489 changed files with 184 additions and 3866856 deletions

View File

@ -1,136 +0,0 @@
; RUN: llc -march=mips < %s | FileCheck %s -check-prefixes=ALL,MIPS
; RUN: llc -march=mips < %s -mattr=+micromips | FileCheck %s -check-prefixes=ALL,MM
; Test the patterns used for constant materialization.
; Constants generated using li16
define i32 @Li16LowBoundary() {
entry:
; ALL-LABEL: Li16LowBoundary:
; MIPS: addiu $2, $zero, -1
; MM: li16 $2, -1
; ALL-NOT: lui
; ALL-NOT: ori
; MIPS-NOT: li16
; MM-NOT: addiu
ret i32 -1
}
define i32 @Li16HighBoundary() {
entry:
; ALL-LABEL: Li16HighBoundary:
; MIPS: addiu $2, $zero, 126
; MM: li16 $2, 126
; ALL-NOT: lui
; ALL-NOT: ori
; MM-NOT: addiu
; MIPS-NOT: li16
ret i32 126
}
; Constants generated using addiu
define i32 @AddiuLowBoundary() {
entry:
; ALL-LABEL: AddiuLowBoundary:
; ALL: addiu $2, $zero, -32768
; ALL-NOT: lui
; ALL-NOT: ori
; ALL-NOT: li16
ret i32 -32768
}
define i32 @AddiuZero() {
entry:
; ALL-LABEL: AddiuZero:
; MIPS: addiu $2, $zero, 0
; MM: li16 $2, 0
; ALL-NOT: lui
; ALL-NOT: ori
; MIPS-NOT: li16
; MM-NOT: addiu
ret i32 0
}
define i32 @AddiuHighBoundary() {
entry:
; ALL-LABEL: AddiuHighBoundary:
; ALL: addiu $2, $zero, 32767
; ALL-NOT: lui
; ALL-NOT: ori
; ALL-NOT: li16
ret i32 32767
}
; Constants generated using ori
define i32 @OriLowBoundary() {
entry:
; ALL-LABEL: OriLowBoundary:
; ALL: ori $2, $zero, 32768
; ALL-NOT: addiu
; ALL-NOT: lui
; ALL-NOT: li16
ret i32 32768
}
define i32 @OriHighBoundary() {
entry:
; ALL-LABEL: OriHighBoundary:
; ALL: ori $2, $zero, 65535
; ALL-NOT: addiu
; ALL-NOT: lui
; ALL-NOT: li16
ret i32 65535
}
; Constants generated using lui
define i32 @LuiPositive() {
entry:
; ALL-LABEL: LuiPositive:
; ALL: lui $2, 1
; ALL-NOT: addiu
; ALL-NOT: ori
; ALL-NOT: li16
ret i32 65536
}
define i32 @LuiNegative() {
entry:
; ALL-LABEL: LuiNegative:
; ALL: lui $2, 65535
; ALL-NOT: addiu
; ALL-NOT: ori
; ALL-NOT: li16
ret i32 -65536
}
; Constants generated using a combination of lui and ori
define i32 @LuiWithLowBitsSet() {
entry:
; ALL-LABEL: LuiWithLowBitsSet:
; ALL: lui $1, 1
; ALL: ori $2, $1, 1
; ALL-NOT: addiu
; ALL-NOT: li16
ret i32 65537
}
define i32 @BelowAddiuLowBoundary() {
entry:
; ALL-LABEL: BelowAddiuLowBoundary:
; ALL: lui $1, 65535
; ALL: ori $2, $1, 32767
; ALL-NOT: addiu
; ALL-NOT: li16
ret i32 -32769
}

View File

@ -1,54 +0,0 @@
; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck %s -check-prefix=CHECK-MIPS32
; RUN: llc -march=mips64el -mcpu=mips64 -relocation-model=pic < %s | \
; RUN: FileCheck %s -check-prefix=CHECK-MIPS64
; RUN: llc -march=mipsel -mcpu=mips64 -target-abi n32 < %s | \
; RUN: FileCheck %s -check-prefix=CHECK-MIPSN32
; Test that the expansion of ADJCALLSTACKDOWN and ADJCALLSTACKUP generate
; (d)subu and (d)addu rather than just (d)addu. The (d)subu sequences are
; generally shorter as the constant that has to be materialized is smaller.
define i32 @main() {
entry:
%z = alloca [1048576 x i8], align 1
%arraydecay = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %z, i32 0, i32 0
%call = call i32 @foo(i8* %arraydecay)
ret i32 0
; CHECK-LABEL: main
; CHECK-MIPS32: lui $[[R0:[0-9]+]], 16
; CHECK-MIPS32: addiu $[[R0]], $[[R0]], 24
; CHECK-MIPS32: subu $sp, $sp, $[[R0]]
; CHECK-MIPS32: lui $[[R1:[0-9]+]], 16
; CHECK-MIPS32: addiu $[[R1]], $[[R1]], 24
; CHECK-MIPS32: addu $sp, $sp, $[[R1]]
; CHECK-MIPS64: lui $[[R0:[0-9]+]], 1
; CHECK-MIPS64: daddiu $[[R0]], $[[R0]], 32
; CHECK-MIPS64: dsubu $sp, $sp, $[[R0]]
; FIXME:
; These are here to match other lui's used in address computations. We need to
; investigate why address computations are not CSE'd. Or implement it.
; CHECK-MIPS64: lui
; CHECK-MIPS64: lui
; CHECK-MIPS64: lui
; CHECK-MIPS64: lui
; CHECK-MIPS64: lui $[[R1:[0-9]+]], 16
; CHECK-MIPS64: daddiu $[[R1]], $[[R1]], 32
; CHECK-MIPS64: daddu $sp, $sp, $[[R1]]
; CHECK-MIPSN32: lui $[[R0:[0-9]+]], 16
; CHECK-MIPSN32: addiu $[[R0]], $[[R0]], 16
; CHECK-MIPSN32: subu $sp, $sp, $[[R0]]
; CHECK-MIPSN32: lui $[[R1:[0-9]+]], 16
; CHECK-MIPSN32: addiu $[[R1]], $[[R1]], 16
; CHECK-MIPSN32: addu $sp, $sp, $[[R1]]
}
declare i32 @foo(i8*)