mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Fix sdisel memcpy, memset, memmove lowering:
1. Makes it possible to lower with floating point loads and stores. 2. Avoid unaligned loads / stores unless it's fast. 3. Fix some memcpy lowering logic bug related to when to optimize a load from constant string into a constant. 4. Adjust x86 memcpy lowering threshold to make it more sane. 5. Fix x86 target hook so it uses vector and floating point memory ops more effectively. rdar://7774704 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,15 +1,105 @@
|
||||
; RUN: llc < %s -march=x86 -mattr=-sse -mtriple=i686-apple-darwin8.8.0 | grep mov | count 7
|
||||
; RUN: llc < %s -march=x86 -mattr=+sse -mtriple=i686-apple-darwin8.8.0 | grep mov | count 5
|
||||
; RUN: llc < %s -mattr=+sse2 -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=SSE2
|
||||
; RUN: llc < %s -mattr=+sse,-sse2 -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=SSE1
|
||||
; RUN: llc < %s -mattr=-sse -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=NOSSE
|
||||
|
||||
%struct.ParmT = type { [25 x i8], i8, i8* }
|
||||
@.str12 = internal constant [25 x i8] c"image\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" ; <[25 x i8]*> [#uses=1]
|
||||
|
||||
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
|
||||
|
||||
define void @t(i32 %argc, i8** %argv) nounwind {
|
||||
define void @t1(i32 %argc, i8** %argv) nounwind {
|
||||
entry:
|
||||
; SSE2: t1:
|
||||
; SSE2: movaps _.str12, %xmm0
|
||||
; SSE2: movaps %xmm0
|
||||
; SSE2: movb $0
|
||||
; SSE2: movl $0
|
||||
; SSE2: movl $0
|
||||
|
||||
; SSE1: t1:
|
||||
; SSE1: movaps _.str12, %xmm0
|
||||
; SSE1: movaps %xmm0
|
||||
; SSE1: movb $0
|
||||
; SSE1: movl $0
|
||||
; SSE1: movl $0
|
||||
|
||||
; NOSSE: t1:
|
||||
; NOSSE: movb $0
|
||||
; NOSSE: movl $0
|
||||
; NOSSE: movl $0
|
||||
; NOSSE: movl $0
|
||||
; NOSSE: movl $0
|
||||
; NOSSE: movl $101
|
||||
; NOSSE: movl $1734438249
|
||||
%parms.i = alloca [13 x %struct.ParmT] ; <[13 x %struct.ParmT]*> [#uses=1]
|
||||
%parms1.i = getelementptr [13 x %struct.ParmT]* %parms.i, i32 0, i32 0, i32 0, i32 0 ; <i8*> [#uses=1]
|
||||
call void @llvm.memcpy.i32( i8* %parms1.i, i8* getelementptr ([25 x i8]* @.str12, i32 0, i32 0), i32 25, i32 1 ) nounwind
|
||||
unreachable
|
||||
}
|
||||
|
||||
;rdar://7774704
|
||||
%struct.s0 = type { [2 x double] }
|
||||
|
||||
define void @t2(%struct.s0* nocapture %a, %struct.s0* nocapture %b) nounwind ssp {
|
||||
entry:
|
||||
; SSE2: t2:
|
||||
; SSE2: movaps (%eax), %xmm0
|
||||
; SSE2: movaps %xmm0, (%eax)
|
||||
|
||||
; SSE1: t2:
|
||||
; SSE1: movaps (%eax), %xmm0
|
||||
; SSE1: movaps %xmm0, (%eax)
|
||||
|
||||
; NOSSE: t2:
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
%tmp2 = bitcast %struct.s0* %a to i8* ; <i8*> [#uses=1]
|
||||
%tmp3 = bitcast %struct.s0* %b to i8* ; <i8*> [#uses=1]
|
||||
tail call void @llvm.memcpy.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 16)
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @t3(%struct.s0* nocapture %a, %struct.s0* nocapture %b) nounwind ssp {
|
||||
entry:
|
||||
; SSE2: t3:
|
||||
; SSE2: movsd (%eax), %xmm0
|
||||
; SSE2: movsd 8(%eax), %xmm1
|
||||
; SSE2: movsd %xmm1, 8(%eax)
|
||||
; SSE2: movsd %xmm0, (%eax)
|
||||
|
||||
; SSE1: t3:
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
; SSE1: movl
|
||||
|
||||
; NOSSE: t3:
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
; NOSSE: movl
|
||||
%tmp2 = bitcast %struct.s0* %a to i8* ; <i8*> [#uses=1]
|
||||
%tmp3 = bitcast %struct.s0* %b to i8* ; <i8*> [#uses=1]
|
||||
tail call void @llvm.memcpy.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 8)
|
||||
ret void
|
||||
}
|
||||
|
||||
declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
|
||||
|
Reference in New Issue
Block a user