mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
5a70dd1d82
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
45 lines
1.8 KiB
LLVM
45 lines
1.8 KiB
LLVM
; RUN: llc -march=x86 < %s | FileCheck %s
|
|
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
|
|
target triple = "i386-pc-linux-gnu"
|
|
; PR7651
|
|
|
|
; CHECK: align
|
|
; CHECK: align
|
|
; CHECK: align
|
|
; CHECK: movl $0, (%e
|
|
; CHECK-NEXT: addl $4, %e
|
|
; CHECK-NEXT: decl %e
|
|
; CHECK-NEXT: jne
|
|
|
|
%struct.anon = type { [72 x i32], i32 }
|
|
|
|
@mp2grad_ = external global %struct.anon
|
|
|
|
define void @chomp2g_setup_(i32 %n, i32 %m) nounwind {
|
|
entry:
|
|
br label %bb1
|
|
|
|
bb1: ; preds = %bb6, %bb
|
|
%indvar11 = phi i32 [ %indvar.next12, %bb6 ], [ 0, %entry ] ; <i32> [#uses=2]
|
|
%tmp21 = add i32 %indvar11, 1 ; <i32> [#uses=1]
|
|
%t = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @mp2grad_, i32 0, i32 1)
|
|
%tmp15 = mul i32 %n, %t ; <i32> [#uses=1]
|
|
%tmp16 = add i32 %tmp21, %tmp15 ; <i32> [#uses=1]
|
|
%tmp17 = shl i32 %tmp16, 3 ; <i32> [#uses=1]
|
|
%tmp18 = add i32 %tmp17, -8 ; <i32> [#uses=1]
|
|
br label %bb2
|
|
|
|
bb2: ; preds = %bb2, %bb2.preheader
|
|
%indvar = phi i32 [ 0, %bb1 ], [ %indvar.next, %bb2 ] ; <i32> [#uses=2]
|
|
%tmp19 = add i32 %tmp18, %indvar ; <i32> [#uses=1]
|
|
%scevgep = getelementptr %struct.anon, %struct.anon* @mp2grad_, i32 0, i32 0, i32 %tmp19 ; <i32*> [#uses=1]
|
|
store i32 0, i32* %scevgep
|
|
%indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
|
|
%c = icmp ne i32 %indvar.next, %m
|
|
br i1 %c, label %bb2, label %bb6
|
|
|
|
bb6: ; preds = %bb2, %bb1
|
|
%indvar.next12 = add i32 %indvar11, 1 ; <i32> [#uses=1]
|
|
br label %bb1
|
|
}
|