mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
2.2 KiB
LLVM
39 lines
2.2 KiB
LLVM
; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0.0 | FileCheck %s
|
|
; rdar://10464621
|
|
|
|
; DAG combine increases loads from packed types. ARM load / store optimizer then
|
|
; combined them into a ldm which causes runtime exception.
|
|
|
|
%struct.InformationBlock = type <{ i32, %struct.FlagBits, %struct.FlagBits }>
|
|
%struct.FlagBits = type <{ [4 x i32] }>
|
|
|
|
@infoBlock = external global %struct.InformationBlock
|
|
|
|
define hidden void @foo() {
|
|
; CHECK-LABEL: foo:
|
|
; CHECK: ldr.w
|
|
; CHECK: ldr.w
|
|
; CHECK-NOT: ldm
|
|
entry:
|
|
%tmp13 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 1, i32 0, i32 0), align 1
|
|
%tmp15 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 1, i32 0, i32 1), align 1
|
|
%tmp17 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 1, i32 0, i32 2), align 1
|
|
%tmp19 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 1, i32 0, i32 3), align 1
|
|
%tmp = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 2, i32 0, i32 0), align 1
|
|
%tmp3 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 2, i32 0, i32 1), align 1
|
|
%tmp4 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 2, i32 0, i32 2), align 1
|
|
%tmp5 = load i32, i32* getelementptr inbounds (%struct.InformationBlock, %struct.InformationBlock* @infoBlock, i32 0, i32 2, i32 0, i32 3), align 1
|
|
%insert21 = insertvalue [4 x i32] undef, i32 %tmp13, 0
|
|
%insert23 = insertvalue [4 x i32] %insert21, i32 %tmp15, 1
|
|
%insert25 = insertvalue [4 x i32] %insert23, i32 %tmp17, 2
|
|
%insert27 = insertvalue [4 x i32] %insert25, i32 %tmp19, 3
|
|
%insert = insertvalue [4 x i32] undef, i32 %tmp, 0
|
|
%insert7 = insertvalue [4 x i32] %insert, i32 %tmp3, 1
|
|
%insert9 = insertvalue [4 x i32] %insert7, i32 %tmp4, 2
|
|
%insert11 = insertvalue [4 x i32] %insert9, i32 %tmp5, 3
|
|
tail call void @bar([4 x i32] %insert27, [4 x i32] %insert11)
|
|
ret void
|
|
}
|
|
|
|
declare void @bar([4 x i32], [4 x i32])
|