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 load instruction
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
This commit is contained in:
@@ -14,7 +14,7 @@ bb: ; preds = %bb4, %entry
|
||||
%mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ] ; <i8> [#uses=4]
|
||||
zext i8 %mode.0 to i32 ; <i32>:1 [#uses=1]
|
||||
getelementptr [4 x i32], [4 x i32]* @mode_table, i32 0, i32 %1 ; <i32*>:2 [#uses=1]
|
||||
load i32* %2, align 4 ; <i32>:3 [#uses=1]
|
||||
load i32, i32* %2, align 4 ; <i32>:3 [#uses=1]
|
||||
icmp eq i32 %3, %0 ; <i1>:4 [#uses=1]
|
||||
br i1 %4, label %bb1, label %bb2
|
||||
|
||||
@@ -40,7 +40,7 @@ declare void @raise_exception() noreturn
|
||||
|
||||
;CHECK: for.body.lr.ph:
|
||||
;CHECK-NEXT: %arrayidx1 = getelementptr inbounds i8, i8* %CurPtr, i64 0
|
||||
;CHECK-NEXT: %0 = load i8* %arrayidx1, align 1
|
||||
;CHECK-NEXT: %0 = load i8, i8* %arrayidx1, align 1
|
||||
;CHECK-NEXT: %conv2 = sext i8 %0 to i32
|
||||
;CHECK-NEXT: br label %for.body
|
||||
|
||||
@@ -56,10 +56,10 @@ for.cond: ; preds = %for.inc, %entry
|
||||
for.body: ; preds = %for.cond
|
||||
%idxprom = zext i32 %i.0 to i64
|
||||
%arrayidx = getelementptr inbounds i8, i8* %CurPtr, i64 %idxprom
|
||||
%0 = load i8* %arrayidx, align 1
|
||||
%0 = load i8, i8* %arrayidx, align 1
|
||||
%conv = sext i8 %0 to i32
|
||||
%arrayidx1 = getelementptr inbounds i8, i8* %CurPtr, i64 0
|
||||
%1 = load i8* %arrayidx1, align 1
|
||||
%1 = load i8, i8* %arrayidx1, align 1
|
||||
%conv2 = sext i8 %1 to i32
|
||||
%cmp3 = icmp ne i32 %conv, %conv2
|
||||
br i1 %cmp3, label %return, label %for.inc
|
||||
|
||||
Reference in New Issue
Block a user