mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
7c9c6ed761
Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
1.2 KiB
LLVM
32 lines
1.2 KiB
LLVM
; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s
|
|
;
|
|
; Check that x86's peephole optimization doesn't fold a 64-bit load (movsd) into
|
|
; addpd.
|
|
; rdar://problem/18236850
|
|
|
|
%struct.S1 = type { double, double }
|
|
|
|
@g = common global %struct.S1 zeroinitializer, align 8
|
|
|
|
declare void @foo3(%struct.S1*)
|
|
|
|
; CHECK: movsd {{[0-9]*}}(%rsp), [[R0:%xmm[0-9]+]]
|
|
; CHECK: addpd [[R0]], %xmm{{[0-9]+}}
|
|
|
|
define void @foo1(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) {
|
|
%1 = alloca <2 x double>, align 16
|
|
%tmpcast = bitcast <2 x double>* %1 to %struct.S1*
|
|
call void @foo3(%struct.S1* %tmpcast) #2
|
|
%p2 = getelementptr inbounds %struct.S1, %struct.S1* %tmpcast, i64 0, i32 0
|
|
%2 = load double, double* %p2, align 16
|
|
%p3 = getelementptr inbounds %struct.S1, %struct.S1* %tmpcast, i64 0, i32 1
|
|
%3 = load double, double* %p3, align 8
|
|
%4 = insertelement <2 x double> undef, double %2, i32 0
|
|
%5 = insertelement <2 x double> %4, double 0.000000e+00, i32 1
|
|
%6 = insertelement <2 x double> undef, double %3, i32 1
|
|
%7 = insertelement <2 x double> %6, double 1.000000e+00, i32 0
|
|
%8 = fadd <2 x double> %5, %7
|
|
store <2 x double> %8, <2 x double>* bitcast (%struct.S1* @g to <2 x double>*), align 16
|
|
ret void
|
|
}
|