1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/test/CodeGen/PowerPC/ppcf128sf.ll
Nirav Dave 3633380341 Elide stores which are overwritten without being observed.
Summary:
In SelectionDAG, when a store is immediately chained to another store
to the same address, elide the first store as it has no observable
effects. This is causes small improvements dealing with intrinsics
lowered to stores.

Test notes:

* Many testcases overwrite store addresses multiple times and needed
  minor changes, mainly making stores volatile to prevent the
  optimization from optimizing the test away.

* Many X86 test cases optimized out instructions associated with
  associated with va_start.

* Note that test_splat in CodeGen/AArch64/misched-stp.ll no longer has
  dependencies to check and can probably be removed and potentially
  replaced with another test.

Reviewers: rnk, john.brawn

Subscribers: aemerson, rengolin, qcolombet, jyknight, nemanjai, nhaehnle, javed.absar, llvm-commits

Differential Revision: https://reviews.llvm.org/D33206

llvm-svn: 303198
2017-05-16 19:43:56 +00:00

180 lines
4.5 KiB
LLVM

; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -O0 < %s | FileCheck %s
@ld = common global ppc_fp128 0xM00000000000000000000000000000000, align 16
@ld2 = common global ppc_fp128 0xM00000000000000000000000000000000, align 16
@d = common global double 0.000000e+00, align 8
@f = common global float 0.000000e+00, align 4
@i = common global i32 0, align 4
@ui = common global i32 0, align 4
@var = common global i8 0, align 1
define void @foo() #0 {
entry:
%c = alloca ppc_fp128, align 16
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%add = fadd ppc_fp128 %0, %1
store volatile ppc_fp128 %add, ppc_fp128* %c, align 16
%2 = load ppc_fp128, ppc_fp128* @ld, align 16
%3 = load ppc_fp128, ppc_fp128* @ld2, align 16
%sub = fsub ppc_fp128 %2, %3
store volatile ppc_fp128 %sub, ppc_fp128* %c, align 16
%4 = load ppc_fp128, ppc_fp128* @ld, align 16
%5 = load ppc_fp128, ppc_fp128* @ld2, align 16
%mul = fmul ppc_fp128 %4, %5
store volatile ppc_fp128 %mul, ppc_fp128* %c, align 16
%6 = load ppc_fp128, ppc_fp128* @ld, align 16
%7 = load ppc_fp128, ppc_fp128* @ld2, align 16
%div = fdiv ppc_fp128 %6, %7
store volatile ppc_fp128 %div, ppc_fp128* %c, align 16
ret void
; CHECK-LABEL: __gcc_qadd
; CHECK-LABEL: __gcc_qsub
; CHECK-LABEL: __gcc_qmul
; CHECK-LABEL: __gcc_qdiv
}
define void @foo1() #0 {
entry:
%0 = load double, double* @d, align 8
%conv = fpext double %0 to ppc_fp128
store ppc_fp128 %conv, ppc_fp128* @ld, align 16
ret void
; CHECK-LABEL: __gcc_dtoq
}
define void @foo2() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%conv = fptrunc ppc_fp128 %0 to double
store double %conv, double* @d, align 8
ret void
; CHECK-LABEL: __gcc_qtod
}
define void @foo3() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%conv = fptrunc ppc_fp128 %0 to float
store float %conv, float* @f, align 4
ret void
; CHECK-LABEL: __gcc_qtos
}
define void @foo4() #0 {
entry:
%0 = load i32, i32* @i, align 4
%conv = sitofp i32 %0 to ppc_fp128
store ppc_fp128 %conv, ppc_fp128* @ld, align 16
ret void
; CHECK-LABEL: __gcc_itoq
}
define void @foo5() #0 {
entry:
%0 = load i32, i32* @ui, align 4
%conv = uitofp i32 %0 to ppc_fp128
store ppc_fp128 %conv, ppc_fp128* @ld, align 16
ret void
; CHECK-LABEL: __gcc_utoq
}
define void @foo6() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%cmp = fcmp oeq ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qeq
}
define void @foo7() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%cmp = fcmp une ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qne
}
define void @foo8() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%cmp = fcmp ogt ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qgt
}
define void @foo9() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%cmp = fcmp olt ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qlt
}
define void @foo10() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%cmp = fcmp ole ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qle
}
define void @foo11() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld, align 16
%cmp = fcmp une ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qunord
}
define void @foo12() #0 {
entry:
%0 = load ppc_fp128, ppc_fp128* @ld, align 16
%1 = load ppc_fp128, ppc_fp128* @ld2, align 16
%cmp = fcmp oge ppc_fp128 %0, %1
%conv = zext i1 %cmp to i32
%conv1 = trunc i32 %conv to i8
store i8 %conv1, i8* @var, align 1
ret void
; CHECK-LABEL: __gcc_qge
}
attributes #0 = { "use-soft-float"="true" }