1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00
llvm-mirror/test/CodeGen/Mips/v2i16tof32.ll
Nirav Dave 6655b5e078 [DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.

Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.

CodeGen tests with non-reordering changes:

  X86/aligned-variadic.ll -- memory-based add folded into stored leaq
  value.

  X86/constant-combiners.ll -- Optimizes out overlap between stores.

  X86/pr40631_deadstore_elision -- folds constant byte store into
  preceding quad word constant store.

Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet

Reviewed By: courbet

Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 356068
2019-03-13 17:07:09 +00:00

44 lines
1.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -O2 -mtriple mipsel--linux-android -mattr=+dsp -verify-machineinstrs | FileCheck %s
; Function below generates a v2i16 to f32 bitcast.
; Test that we are able to match it.
define float @f(<8 x i16>* %a) {
; CHECK-LABEL: f:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: addiu $sp, $sp, -32
; CHECK-NEXT: .cfi_def_cfa_offset 32
; CHECK-NEXT: sw $fp, 28($sp) # 4-byte Folded Spill
; CHECK-NEXT: .cfi_offset 30, -4
; CHECK-NEXT: move $fp, $sp
; CHECK-NEXT: .cfi_def_cfa_register 30
; CHECK-NEXT: addiu $1, $zero, -16
; CHECK-NEXT: and $sp, $sp, $1
; CHECK-NEXT: lw $1, 12($4)
; CHECK-NEXT: lw $2, 0($4)
; CHECK-NEXT: lw $3, 8($4)
; CHECK-NEXT: sw $3, 8($sp)
; CHECK-NEXT: sw $1, 12($sp)
; CHECK-NEXT: sw $2, 0($sp)
; CHECK-NEXT: lw $1, 4($4)
; CHECK-NEXT: sw $1, 4($sp)
; CHECK-NEXT: mtc1 $2, $f0
; CHECK-NEXT: move $sp, $fp
; CHECK-NEXT: lw $fp, 28($sp) # 4-byte Folded Reload
; CHECK-NEXT: jr $ra
; CHECK-NEXT: addiu $sp, $sp, 32
entry:
%m = alloca <8 x i16>
%0 = load <8 x i16>, <8 x i16>* %a
store <8 x i16> %0, <8 x i16>* %m
%1 = bitcast <8 x i16> %0 to <4 x float>
%2 = shufflevector <4 x float> %1, <4 x float> undef, <8 x i32> <i32 0, i32 3, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
%3 = shufflevector <8 x float> zeroinitializer, <8 x float> %2, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
%4 = bitcast <8 x float> %3 to <8 x i32>
%5 = extractelement <8 x i32> %4, i32 0
%6 = bitcast i32 %5 to float
ret float %6
}