mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-19 11:23:32 +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:
@@ -29,13 +29,13 @@ vector.body: ; preds = %for.body.lr.ph, %ve
|
||||
;CHECK: cost of 0 {{.*}} bitcast
|
||||
%5 = bitcast i32* %4 to <8 x i32>*
|
||||
;CHECK: cost of 2 {{.*}} load
|
||||
%6 = load <8 x i32>* %5, align 4
|
||||
%6 = load <8 x i32>, <8 x i32>* %5, align 4
|
||||
;CHECK: cost of 4 {{.*}} mul
|
||||
%7 = mul nsw <8 x i32> %6, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>
|
||||
%8 = getelementptr inbounds i32, i32* %A, i64 %index
|
||||
%9 = bitcast i32* %8 to <8 x i32>*
|
||||
;CHECK: cost of 2 {{.*}} load
|
||||
%10 = load <8 x i32>* %9, align 4
|
||||
%10 = load <8 x i32>, <8 x i32>* %9, align 4
|
||||
;CHECK: cost of 4 {{.*}} add
|
||||
%11 = add nsw <8 x i32> %10, %7
|
||||
;CHECK: cost of 2 {{.*}} store
|
||||
@@ -54,12 +54,12 @@ for.body: ; preds = %middle.block, %for.
|
||||
%13 = add nsw i64 %indvars.iv, 2
|
||||
%arrayidx = getelementptr inbounds i32, i32* %B, i64 %13
|
||||
;CHECK: cost of 1 {{.*}} load
|
||||
%14 = load i32* %arrayidx, align 4
|
||||
%14 = load i32, i32* %arrayidx, align 4
|
||||
;CHECK: cost of 1 {{.*}} mul
|
||||
%mul = mul nsw i32 %14, 5
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
|
||||
;CHECK: cost of 1 {{.*}} load
|
||||
%15 = load i32* %arrayidx2, align 4
|
||||
%15 = load i32, i32* %arrayidx2, align 4
|
||||
%add3 = add nsw i32 %15, %mul
|
||||
store i32 %add3, i32* %arrayidx2, align 4
|
||||
%indvars.iv.next = add i64 %indvars.iv, 1
|
||||
|
||||
Reference in New Issue
Block a user