mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
ab043ff680
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 llvm-svn: 230794
49 lines
1.5 KiB
LLVM
49 lines
1.5 KiB
LLVM
; RUN: llc -mtriple=thumbv4t-none--eabi < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V4T
|
|
; RUN: llc -mtriple=thumbv6m-none--eabi < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V6M
|
|
|
|
; CHECK-LABEL: test1
|
|
define i32 @test1(i32* %p) {
|
|
|
|
; Offsets less than 8 can be generated in a single add
|
|
; CHECK: adds [[NEWBASE:r[0-9]]], r0, #4
|
|
%1 = getelementptr inbounds i32, i32* %p, i32 1
|
|
%2 = getelementptr inbounds i32, i32* %p, i32 2
|
|
%3 = getelementptr inbounds i32, i32* %p, i32 3
|
|
%4 = getelementptr inbounds i32, i32* %p, i32 4
|
|
|
|
; CHECK-NEXT: ldm [[NEWBASE]],
|
|
%5 = load i32, i32* %1, align 4
|
|
%6 = load i32, i32* %2, align 4
|
|
%7 = load i32, i32* %3, align 4
|
|
%8 = load i32, i32* %4, align 4
|
|
|
|
%9 = add nsw i32 %5, %6
|
|
%10 = add nsw i32 %9, %7
|
|
%11 = add nsw i32 %10, %8
|
|
ret i32 %11
|
|
}
|
|
|
|
; CHECK-LABEL: test2
|
|
define i32 @test2(i32* %p) {
|
|
|
|
; Offsets >=8 require a mov and an add
|
|
; CHECK-V4T: movs [[NEWBASE:r[0-9]]], r0
|
|
; CHECK-V6M: mov [[NEWBASE:r[0-9]]], r0
|
|
; CHECK-NEXT: adds [[NEWBASE]], #8
|
|
%1 = getelementptr inbounds i32, i32* %p, i32 2
|
|
%2 = getelementptr inbounds i32, i32* %p, i32 3
|
|
%3 = getelementptr inbounds i32, i32* %p, i32 4
|
|
%4 = getelementptr inbounds i32, i32* %p, i32 5
|
|
|
|
; CHECK-NEXT: ldm [[NEWBASE]],
|
|
%5 = load i32, i32* %1, align 4
|
|
%6 = load i32, i32* %2, align 4
|
|
%7 = load i32, i32* %3, align 4
|
|
%8 = load i32, i32* %4, align 4
|
|
|
|
%9 = add nsw i32 %5, %6
|
|
%10 = add nsw i32 %9, %7
|
|
%11 = add nsw i32 %10, %8
|
|
ret i32 %11
|
|
}
|