mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
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
This commit is contained in:
@@ -7,7 +7,7 @@ entry:
|
||||
br label %no_exit.0
|
||||
|
||||
no_exit.0: ; preds = %no_exit.0, %entry
|
||||
%p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1]
|
||||
%p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]], [29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1]
|
||||
%inc.0 = getelementptr i32, i32* %p.0.0, i32 1 ; <i32*> [#uses=1]
|
||||
br i1 undef, label %no_exit.0, label %no_exit.1
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ target triple = "thumbv7-apple-darwin"
|
||||
|
||||
; CHECK-LABEL: @test(
|
||||
; CHECK: if.end.i126:
|
||||
; CHECK: %exitcond = icmp ne i8* %incdec.ptr.i, getelementptr (i8* null, i32 undef)
|
||||
; CHECK: %exitcond = icmp ne i8* %incdec.ptr.i, getelementptr (i8, i8* null, i32 undef)
|
||||
define void @test() nounwind {
|
||||
entry:
|
||||
br label %while.cond
|
||||
|
||||
@@ -13,7 +13,7 @@ block9: ; preds = %block9,%func_start
|
||||
%undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ]
|
||||
%iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ]
|
||||
%next_iter = add nsw i64 %iter, 1
|
||||
%0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef)
|
||||
%0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef)
|
||||
%next_undef = add nsw i64 %undef, 1
|
||||
%_tmp_3 = icmp slt i64 %next_iter, 100
|
||||
br i1 %_tmp_3, label %block9, label %exit
|
||||
|
||||
@@ -45,7 +45,7 @@ bb14: ; preds = %bb11, %bb7
|
||||
br i1 %t20, label %bb1, label %bb21
|
||||
|
||||
bb21: ; preds = %bb14
|
||||
%t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind
|
||||
%t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ define void @foo(i8* %a) nounwind uwtable ssp {
|
||||
|
||||
; <label>:1 ; preds = %0, %1
|
||||
%i.0 = phi i8 [ 0, %0 ], [ %5, %1 ]
|
||||
%p.0 = phi i8* [ getelementptr inbounds ([240 x i8]* @data, i64 0, i64 0), %0 ], [ %4, %1 ]
|
||||
%p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %0 ], [ %4, %1 ]
|
||||
%.0 = phi i8* [ %a, %0 ], [ %2, %1 ]
|
||||
%2 = getelementptr inbounds i8, i8* %.0, i64 1
|
||||
%3 = load i8, i8* %.0, align 1
|
||||
|
||||
@@ -28,7 +28,7 @@ bb1.i: ; preds = %bb2.i, %entry
|
||||
br i1 %tmp1, label %bb.i.i, label %bb1.i.i
|
||||
|
||||
bb.i.i: ; preds = %bb1.i
|
||||
tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn
|
||||
tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn
|
||||
unreachable
|
||||
|
||||
bb1.i.i: ; preds = %bb1.i
|
||||
@@ -39,7 +39,7 @@ bb1.i.i: ; preds = %bb1.i
|
||||
br i1 %tmp3, label %bb2.i.i, label %cc70a02__complex_integers__Oadd.153.exit.i
|
||||
|
||||
bb2.i.i: ; preds = %bb1.i.i
|
||||
tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn
|
||||
tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn
|
||||
unreachable
|
||||
|
||||
cc70a02__complex_integers__Oadd.153.exit.i: ; preds = %bb1.i.i
|
||||
|
||||
@@ -119,7 +119,7 @@ for.inc35: ; preds = %for.body15, %for.en
|
||||
|
||||
while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader
|
||||
%count.0.lcssa = phi i32 [ %count.2.lcssa.lcssa, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] ; <i32> [#uses=1]
|
||||
%call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0]
|
||||
%call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0]
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user