mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-31 12:30:06 +00:00
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
55 lines
1.8 KiB
LLVM
55 lines
1.8 KiB
LLVM
; RUN: opt < %s -basicaa -slp-vectorizer -S | FileCheck %s
|
|
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
|
|
target triple = "x86_64--linux-gnu"
|
|
|
|
@a = common global [4 x double] zeroinitializer, align 8
|
|
@b = common global [4 x double] zeroinitializer, align 8
|
|
|
|
; [4], b[4];
|
|
; double foo() {
|
|
; double sum =0;
|
|
; sum = (a[0]+b[0]) + (a[1]+b[1]);
|
|
; return sum;
|
|
; }
|
|
|
|
; CHECK-LABEL: @return1
|
|
; CHECK: %0 = load <2 x double>, <2 x double>*
|
|
; CHECK: %1 = load <2 x double>, <2 x double>*
|
|
; CHECK: %2 = fadd <2 x double>
|
|
|
|
define double @return1() {
|
|
entry:
|
|
%a0 = load double, double* getelementptr inbounds ([4 x double]* @a, i32 0, i32 0), align 8
|
|
%b0 = load double, double* getelementptr inbounds ([4 x double]* @b, i32 0, i32 0), align 8
|
|
%add0 = fadd double %a0, %b0
|
|
%a1 = load double, double* getelementptr inbounds ([4 x double]* @a, i32 0, i32 1), align 8
|
|
%b1 = load double, double* getelementptr inbounds ([4 x double]* @b, i32 0, i32 1), align 8
|
|
%add1 = fadd double %a1, %b1
|
|
%add2 = fadd double %add0, %add1
|
|
ret double %add2
|
|
}
|
|
|
|
; double hadd(double *x) {
|
|
; return ((x[0] + x[2]) + (x[1] + x[3]));
|
|
; }
|
|
|
|
; CHECK-LABEL: @return2
|
|
; CHECK: %1 = load <2 x double>, <2 x double>*
|
|
; CHECK: %3 = load <2 x double>, <2 x double>* %2
|
|
; CHECK: %4 = fadd <2 x double> %1, %3
|
|
|
|
define double @return2(double* nocapture readonly %x) {
|
|
entry:
|
|
%x0 = load double, double* %x, align 4
|
|
%arrayidx1 = getelementptr inbounds double, double* %x, i32 2
|
|
%x2 = load double, double* %arrayidx1, align 4
|
|
%add3 = fadd double %x0, %x2
|
|
%arrayidx2 = getelementptr inbounds double, double* %x, i32 1
|
|
%x1 = load double, double* %arrayidx2, align 4
|
|
%arrayidx3 = getelementptr inbounds double, double* %x, i32 3
|
|
%x3 = load double, double* %arrayidx3, align 4
|
|
%add4 = fadd double %x1, %x3
|
|
%add5 = fadd double %add3, %add4
|
|
ret double %add5
|
|
}
|