2017-04-22 07:35:26 +08:00
|
|
|
; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
|
2020-02-01 02:32:28 +08:00
|
|
|
; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s --check-prefix=CHECK-DWO
|
2014-03-08 08:29:41 +08:00
|
|
|
|
|
|
|
; Based on the debuginfo-tests/sret.cpp code.
|
|
|
|
|
2020-09-29 01:42:17 +08:00
|
|
|
; CHECK-DWO: DW_AT_GNU_dwo_id (0xa58a336e896549f1)
|
|
|
|
; CHECK-DWO: DW_AT_GNU_dwo_id (0xa58a336e896549f1)
|
2017-04-18 09:21:53 +08:00
|
|
|
|
2020-09-22 20:55:54 +08:00
|
|
|
; RUN: llc -O0 -fast-isel=true -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,FASTISEL %s
|
|
|
|
; RUN: llc -O0 -fast-isel=false -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,SDAG %s
|
2017-04-18 09:21:53 +08:00
|
|
|
; CHECK: _ZN1B9AInstanceEv
|
2018-01-16 19:17:57 +08:00
|
|
|
; CHECK: DW_TAG_variable
|
2020-02-01 02:32:28 +08:00
|
|
|
; CHECK-NEXT: DW_AT_location (0x00000000
|
2020-09-22 20:55:54 +08:00
|
|
|
; FASTISEL-NEXT: [{{.*}}, {{.*}}): DW_OP_breg6 RBP-32, DW_OP_deref
|
2020-09-29 01:42:17 +08:00
|
|
|
; FASTISEL-NEXT: [{{.*}}, {{.*}}): DW_OP_breg5 RDI+0
|
|
|
|
; FASTISEL-NEXT: [{{.*}}, {{.*}}): DW_OP_breg6 RBP-32, DW_OP_deref)
|
|
|
|
; SDAG-NEXT: [{{.*}}, {{.*}}): DW_OP_breg5 RDI+0
|
|
|
|
; SDAG-NEXT: [{{.*}}, {{.*}}): DW_OP_breg6 RBP-32, DW_OP_deref)
|
2017-04-18 09:21:53 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}}"a"
|
2014-03-08 08:29:41 +08:00
|
|
|
|
|
|
|
%class.A = type { i32 (...)**, i32 }
|
|
|
|
%class.B = type { i8 }
|
|
|
|
|
|
|
|
@_ZTV1A = linkonce_odr unnamed_addr constant [4 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (void (%class.A*)* @_ZN1AD2Ev to i8*), i8* bitcast (void (%class.A*)* @_ZN1AD0Ev to i8*)]
|
|
|
|
@_ZTVN10__cxxabiv117__class_type_infoE = external global i8*
|
|
|
|
@_ZTS1A = linkonce_odr constant [3 x i8] c"1A\00"
|
2015-03-14 02:20:45 +08:00
|
|
|
@_ZTI1A = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) }
|
2014-03-08 08:29:41 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@_ZN1AC1Ei = alias void (%class.A*, i32), void (%class.A*, i32)* @_ZN1AC2Ei
|
|
|
|
@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*), void (%class.A*, %class.A*)* @_ZN1AC2ERKS_
|
2014-03-08 08:29:41 +08:00
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 !dbg !49 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
%i.addr = alloca i32, align 4
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !67, metadata !DIExpression()), !dbg !69
|
2014-03-08 08:29:41 +08:00
|
|
|
store i32 %i, i32* %i.addr, align 4
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !70, metadata !DIExpression()), !dbg !71
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
2014-03-08 08:29:41 +08:00
|
|
|
%0 = bitcast %class.A* %this1 to i8***, !dbg !72
|
2015-03-14 02:20:45 +08:00
|
|
|
store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %0, !dbg !72
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%m_int = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 1, !dbg !72
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i32, i32* %i.addr, align 4, !dbg !72
|
2014-03-08 08:29:41 +08:00
|
|
|
store i32 %1, i32* %m_int, align 4, !dbg !72
|
|
|
|
ret void, !dbg !73
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
Note: I accidentally committed a bogus older version of this patch previously.
llvm-svn: 218787
2014-10-02 02:55:02 +08:00
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
|
2014-03-08 08:29:41 +08:00
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define void @_ZN1AC2ERKS_(%class.A* %this, %class.A* %rhs) unnamed_addr #0 align 2 !dbg !50 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
%rhs.addr = alloca %class.A*, align 8
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !74, metadata !DIExpression()), !dbg !75
|
2014-03-08 08:29:41 +08:00
|
|
|
store %class.A* %rhs, %class.A** %rhs.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %rhs.addr, metadata !76, metadata !DIExpression()), !dbg !77
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
2014-03-08 08:29:41 +08:00
|
|
|
%0 = bitcast %class.A* %this1 to i8***, !dbg !78
|
2015-03-14 02:20:45 +08:00
|
|
|
store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %0, !dbg !78
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%m_int = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 1, !dbg !78
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load %class.A*, %class.A** %rhs.addr, align 8, !dbg !78
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%m_int2 = getelementptr inbounds %class.A, %class.A* %1, i32 0, i32 1, !dbg !78
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load i32, i32* %m_int2, align 4, !dbg !78
|
2014-03-08 08:29:41 +08:00
|
|
|
store i32 %2, i32* %m_int, align 4, !dbg !78
|
|
|
|
ret void, !dbg !79
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define %class.A* @_ZN1AaSERKS_(%class.A* %this, %class.A* %rhs) #0 align 2 !dbg !51 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
%rhs.addr = alloca %class.A*, align 8
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !80, metadata !DIExpression()), !dbg !81
|
2014-03-08 08:29:41 +08:00
|
|
|
store %class.A* %rhs, %class.A** %rhs.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %rhs.addr, metadata !82, metadata !DIExpression()), !dbg !83
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
|
|
|
%0 = load %class.A*, %class.A** %rhs.addr, align 8, !dbg !84
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%m_int = getelementptr inbounds %class.A, %class.A* %0, i32 0, i32 1, !dbg !84
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i32, i32* %m_int, align 4, !dbg !84
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%m_int2 = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 1, !dbg !84
|
2014-03-08 08:29:41 +08:00
|
|
|
store i32 %1, i32* %m_int2, align 4, !dbg !84
|
|
|
|
ret %class.A* %this1, !dbg !85
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define i32 @_ZN1A7get_intEv(%class.A* %this) #0 align 2 !dbg !52 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !86, metadata !DIExpression()), !dbg !87
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%m_int = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 1, !dbg !88
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32* %m_int, align 4, !dbg !88
|
2014-03-08 08:29:41 +08:00
|
|
|
ret i32 %0, !dbg !88
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: uwtable
|
2020-11-21 03:07:11 +08:00
|
|
|
define void @_ZN1B9AInstanceEv(%class.A* noalias sret(%class.A) %agg.result, %class.B* %this) #2 align 2 !dbg !53 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.B*, align 8
|
|
|
|
%nrvo = alloca i1
|
|
|
|
%cleanup.dest.slot = alloca i32
|
|
|
|
store %class.B* %this, %class.B** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !89, metadata !DIExpression()), !dbg !91
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.B*, %class.B** %this.addr
|
2014-03-08 08:29:41 +08:00
|
|
|
store i1 false, i1* %nrvo, !dbg !92
|
2017-04-18 09:21:53 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A* %agg.result, metadata !93, metadata !DIExpression()), !dbg !92
|
2014-03-08 08:29:41 +08:00
|
|
|
call void @_ZN1AC1Ei(%class.A* %agg.result, i32 12), !dbg !92
|
|
|
|
store i1 true, i1* %nrvo, !dbg !94
|
|
|
|
store i32 1, i32* %cleanup.dest.slot
|
2015-02-28 05:17:42 +08:00
|
|
|
%nrvo.val = load i1, i1* %nrvo, !dbg !95
|
2014-03-08 08:29:41 +08:00
|
|
|
br i1 %nrvo.val, label %nrvo.skipdtor, label %nrvo.unused, !dbg !95
|
|
|
|
|
|
|
|
nrvo.unused: ; preds = %entry
|
|
|
|
call void @_ZN1AD2Ev(%class.A* %agg.result), !dbg !96
|
|
|
|
br label %nrvo.skipdtor, !dbg !96
|
|
|
|
|
|
|
|
nrvo.skipdtor: ; preds = %nrvo.unused, %entry
|
|
|
|
ret void, !dbg !98
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr #0 align 2 !dbg !63 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !101, metadata !DIExpression()), !dbg !102
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
2014-03-08 08:29:41 +08:00
|
|
|
ret void, !dbg !103
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define i32 @main(i32 %argc, i8** %argv) #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !54 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%retval = alloca i32, align 4
|
|
|
|
%argc.addr = alloca i32, align 4
|
|
|
|
%argv.addr = alloca i8**, align 8
|
|
|
|
%b = alloca %class.B, align 1
|
|
|
|
%return_val = alloca i32, align 4
|
|
|
|
%temp.lvalue = alloca %class.A, align 8
|
|
|
|
%exn.slot = alloca i8*
|
|
|
|
%ehselector.slot = alloca i32
|
|
|
|
%a = alloca %class.A, align 8
|
|
|
|
%cleanup.dest.slot = alloca i32
|
|
|
|
store i32 0, i32* %retval
|
|
|
|
store i32 %argc, i32* %argc.addr, align 4
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !104, metadata !DIExpression()), !dbg !105
|
2014-03-08 08:29:41 +08:00
|
|
|
store i8** %argv, i8*** %argv.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !106, metadata !DIExpression()), !dbg !105
|
|
|
|
call void @llvm.dbg.declare(metadata %class.B* %b, metadata !107, metadata !DIExpression()), !dbg !108
|
2014-03-08 08:29:41 +08:00
|
|
|
call void @_ZN1BC2Ev(%class.B* %b), !dbg !108
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata i32* %return_val, metadata !109, metadata !DIExpression()), !dbg !110
|
2020-11-21 03:07:11 +08:00
|
|
|
call void @_ZN1B9AInstanceEv(%class.A* sret(%class.A) %temp.lvalue, %class.B* %b), !dbg !110
|
2014-03-08 08:29:41 +08:00
|
|
|
%call = invoke i32 @_ZN1A7get_intEv(%class.A* %temp.lvalue)
|
|
|
|
to label %invoke.cont unwind label %lpad, !dbg !110
|
|
|
|
|
|
|
|
invoke.cont: ; preds = %entry
|
|
|
|
call void @_ZN1AD2Ev(%class.A* %temp.lvalue), !dbg !111
|
|
|
|
store i32 %call, i32* %return_val, align 4, !dbg !111
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A* %a, metadata !113, metadata !DIExpression()), !dbg !114
|
2020-11-21 03:07:11 +08:00
|
|
|
call void @_ZN1B9AInstanceEv(%class.A* sret(%class.A) %a, %class.B* %b), !dbg !114
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32* %return_val, align 4, !dbg !115
|
2014-03-08 08:29:41 +08:00
|
|
|
store i32 %0, i32* %retval, !dbg !115
|
|
|
|
store i32 1, i32* %cleanup.dest.slot
|
|
|
|
call void @_ZN1AD2Ev(%class.A* %a), !dbg !116
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i32, i32* %retval, !dbg !116
|
2014-03-08 08:29:41 +08:00
|
|
|
ret i32 %1, !dbg !116
|
|
|
|
|
|
|
|
lpad: ; preds = %entry
|
2015-06-18 04:52:32 +08:00
|
|
|
%2 = landingpad { i8*, i32 }
|
2014-03-08 08:29:41 +08:00
|
|
|
cleanup, !dbg !116
|
|
|
|
%3 = extractvalue { i8*, i32 } %2, 0, !dbg !116
|
|
|
|
store i8* %3, i8** %exn.slot, !dbg !116
|
|
|
|
%4 = extractvalue { i8*, i32 } %2, 1, !dbg !116
|
|
|
|
store i32 %4, i32* %ehselector.slot, !dbg !116
|
|
|
|
invoke void @_ZN1AD2Ev(%class.A* %temp.lvalue)
|
|
|
|
to label %invoke.cont1 unwind label %terminate.lpad, !dbg !116
|
|
|
|
|
|
|
|
invoke.cont1: ; preds = %lpad
|
|
|
|
br label %eh.resume, !dbg !117
|
|
|
|
|
|
|
|
eh.resume: ; preds = %invoke.cont1
|
2015-02-28 05:17:42 +08:00
|
|
|
%exn = load i8*, i8** %exn.slot, !dbg !119
|
|
|
|
%sel = load i32, i32* %ehselector.slot, !dbg !119
|
2014-03-08 08:29:41 +08:00
|
|
|
%lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0, !dbg !119
|
|
|
|
%lpad.val2 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1, !dbg !119
|
|
|
|
resume { i8*, i32 } %lpad.val2, !dbg !119
|
|
|
|
|
|
|
|
terminate.lpad: ; preds = %lpad
|
2015-06-18 04:52:32 +08:00
|
|
|
%5 = landingpad { i8*, i32 }
|
2014-03-08 08:29:41 +08:00
|
|
|
catch i8* null, !dbg !121
|
|
|
|
%6 = extractvalue { i8*, i32 } %5, 0, !dbg !121
|
|
|
|
call void @__clang_call_terminate(i8* %6) #5, !dbg !121
|
|
|
|
unreachable, !dbg !121
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define linkonce_odr void @_ZN1BC2Ev(%class.B* %this) unnamed_addr #0 align 2 !dbg !62 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.B*, align 8
|
|
|
|
store %class.B* %this, %class.B** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !123, metadata !DIExpression()), !dbg !124
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.B*, %class.B** %this.addr
|
2014-03-08 08:29:41 +08:00
|
|
|
ret void, !dbg !125
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @__gxx_personality_v0(...)
|
|
|
|
|
|
|
|
; Function Attrs: noinline noreturn nounwind
|
|
|
|
define linkonce_odr hidden void @__clang_call_terminate(i8*) #3 {
|
|
|
|
%2 = call i8* @__cxa_begin_catch(i8* %0) #6
|
|
|
|
call void @_ZSt9terminatev() #5
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @__cxa_begin_catch(i8*)
|
|
|
|
|
|
|
|
declare void @_ZSt9terminatev()
|
|
|
|
|
|
|
|
; Function Attrs: uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define linkonce_odr void @_ZN1AD0Ev(%class.A* %this) unnamed_addr #2 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !61 {
|
2014-03-08 08:29:41 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %class.A*, align 8
|
|
|
|
%exn.slot = alloca i8*
|
|
|
|
%ehselector.slot = alloca i32
|
|
|
|
store %class.A* %this, %class.A** %this.addr, align 8
|
2015-04-30 00:38:44 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !126, metadata !DIExpression()), !dbg !127
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %class.A*, %class.A** %this.addr
|
2014-03-08 08:29:41 +08:00
|
|
|
invoke void @_ZN1AD2Ev(%class.A* %this1)
|
|
|
|
to label %invoke.cont unwind label %lpad, !dbg !128
|
|
|
|
|
|
|
|
invoke.cont: ; preds = %entry
|
|
|
|
%0 = bitcast %class.A* %this1 to i8*, !dbg !129
|
|
|
|
call void @_ZdlPv(i8* %0) #7, !dbg !129
|
|
|
|
ret void, !dbg !129
|
|
|
|
|
|
|
|
lpad: ; preds = %entry
|
2015-06-18 04:52:32 +08:00
|
|
|
%1 = landingpad { i8*, i32 }
|
2014-03-08 08:29:41 +08:00
|
|
|
cleanup, !dbg !131
|
|
|
|
%2 = extractvalue { i8*, i32 } %1, 0, !dbg !131
|
|
|
|
store i8* %2, i8** %exn.slot, !dbg !131
|
|
|
|
%3 = extractvalue { i8*, i32 } %1, 1, !dbg !131
|
|
|
|
store i32 %3, i32* %ehselector.slot, !dbg !131
|
|
|
|
%4 = bitcast %class.A* %this1 to i8*, !dbg !131
|
|
|
|
call void @_ZdlPv(i8* %4) #7, !dbg !131
|
|
|
|
br label %eh.resume, !dbg !131
|
|
|
|
|
|
|
|
eh.resume: ; preds = %lpad
|
2015-02-28 05:17:42 +08:00
|
|
|
%exn = load i8*, i8** %exn.slot, !dbg !133
|
|
|
|
%sel = load i32, i32* %ehselector.slot, !dbg !133
|
2014-03-08 08:29:41 +08:00
|
|
|
%lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0, !dbg !133
|
|
|
|
%lpad.val2 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1, !dbg !133
|
|
|
|
resume { i8*, i32 } %lpad.val2, !dbg !133
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nobuiltin nounwind
|
|
|
|
declare void @_ZdlPv(i8*) #4
|
|
|
|
|
2019-12-25 07:52:21 +08:00
|
|
|
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2014-03-08 08:29:41 +08:00
|
|
|
attributes #1 = { nounwind readnone }
|
2019-12-25 07:52:21 +08:00
|
|
|
attributes #2 = { uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2014-03-08 08:29:41 +08:00
|
|
|
attributes #3 = { noinline noreturn nounwind }
|
2019-12-25 07:52:21 +08:00
|
|
|
attributes #4 = { nobuiltin nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2014-03-08 08:29:41 +08:00
|
|
|
attributes #5 = { noreturn nounwind }
|
|
|
|
attributes #6 = { nounwind }
|
|
|
|
attributes #7 = { builtin nounwind }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
|
|
!llvm.module.flags = !{!64, !65}
|
|
|
|
!llvm.ident = !{!66}
|
|
|
|
|
2016-04-15 23:57:41 +08:00
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)", isOptimized: false, splitDebugFilename: "sret.dwo", emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)
|
2015-04-30 00:38:44 +08:00
|
|
|
!1 = !DIFile(filename: "sret.cpp", directory: "/usr/local/google/home/echristo/tmp")
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!2 = !{}
|
|
|
|
!3 = !{!4, !37}
|
2016-04-24 05:08:00 +08:00
|
|
|
!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 128, align: 64, file: !1, elements: !5, vtableHolder: !4, identifier: "_ZTS1A")
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!5 = !{!6, !13, !14, !19, !25, !29, !33}
|
2015-04-30 00:38:44 +08:00
|
|
|
!6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !1, scope: !7, baseType: !8)
|
|
|
|
!7 = !DIFile(filename: "sret.cpp", directory: "/usr/local/google/home/echristo/tmp")
|
|
|
|
!8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !9)
|
|
|
|
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !10)
|
|
|
|
!10 = !DISubroutineType(types: !11)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!11 = !{!12}
|
2015-04-30 00:38:44 +08:00
|
|
|
!12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
2016-04-24 05:08:00 +08:00
|
|
|
!13 = !DIDerivedType(tag: DW_TAG_member, name: "m_int", line: 13, size: 32, align: 32, offset: 64, flags: DIFlagProtected, file: !1, scope: !4, baseType: !12)
|
|
|
|
!14 = !DISubprogram(name: "A", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !4, type: !15)
|
2015-04-30 00:38:44 +08:00
|
|
|
!15 = !DISubroutineType(types: !16)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!16 = !{null, !17, !12}
|
2016-04-24 05:08:00 +08:00
|
|
|
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
|
|
|
|
!19 = !DISubprogram(name: "A", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !4, type: !20)
|
2015-04-30 00:38:44 +08:00
|
|
|
!20 = !DISubroutineType(types: !21)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!21 = !{null, !17, !22}
|
2016-01-15 08:46:17 +08:00
|
|
|
!22 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, baseType: !23)
|
2016-04-24 05:08:00 +08:00
|
|
|
!23 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4)
|
|
|
|
!25 = !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !4, type: !26)
|
2015-04-30 00:38:44 +08:00
|
|
|
!26 = !DISubroutineType(types: !27)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!27 = !{!22, !17, !22}
|
2016-04-24 05:08:00 +08:00
|
|
|
!29 = !DISubprogram(name: "~A", line: 8, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !4, type: !30, containingType: !4)
|
2015-04-30 00:38:44 +08:00
|
|
|
!30 = !DISubroutineType(types: !31)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!31 = !{null, !17}
|
2016-04-24 05:08:00 +08:00
|
|
|
!33 = !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 10, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !4, type: !34)
|
2015-04-30 00:38:44 +08:00
|
|
|
!34 = !DISubroutineType(types: !35)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!35 = !{!12, !17}
|
2015-04-30 00:38:44 +08:00
|
|
|
!37 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 38, size: 8, align: 8, file: !1, elements: !38, identifier: "_ZTS1B")
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!38 = !{!39, !44}
|
2016-04-24 05:08:00 +08:00
|
|
|
!39 = !DISubprogram(name: "B", line: 41, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 41, file: !1, scope: !37, type: !40)
|
2015-04-30 00:38:44 +08:00
|
|
|
!40 = !DISubroutineType(types: !41)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!41 = !{null, !42}
|
2016-04-24 05:08:00 +08:00
|
|
|
!42 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !37)
|
|
|
|
!44 = !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 43, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 43, file: !1, scope: !37, type: !45)
|
2015-04-30 00:38:44 +08:00
|
|
|
!45 = !DISubroutineType(types: !46)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!46 = !{!4, !42}
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!49 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 18, file: !1, scope: !4, type: !15, declaration: !14, retainedNodes: !2)
|
|
|
|
!50 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2ERKS_", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 23, file: !1, scope: !4, type: !20, declaration: !19, retainedNodes: !2)
|
|
|
|
!51 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 28, file: !1, scope: !4, type: !26, declaration: !25, retainedNodes: !2)
|
|
|
|
!52 = distinct !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 33, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 34, file: !1, scope: !4, type: !34, declaration: !33, retainedNodes: !2)
|
|
|
|
!53 = distinct !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 47, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 48, file: !1, scope: !37, type: !45, declaration: !44, retainedNodes: !2)
|
|
|
|
!54 = distinct !DISubprogram(name: "main", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 54, file: !1, scope: !7, type: !55, retainedNodes: !2)
|
2015-04-30 00:38:44 +08:00
|
|
|
!55 = !DISubroutineType(types: !56)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!56 = !{!12, !12, !57}
|
2015-04-30 00:38:44 +08:00
|
|
|
!57 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !58)
|
|
|
|
!58 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !59)
|
|
|
|
!59 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !60)
|
|
|
|
!60 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!61 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD0Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !1, scope: !4, type: !30, declaration: !29, retainedNodes: !2)
|
|
|
|
!62 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 41, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 41, file: !1, scope: !37, type: !40, declaration: !39, retainedNodes: !2)
|
|
|
|
!63 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !1, scope: !4, type: !30, declaration: !29, retainedNodes: !2)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!64 = !{i32 2, !"Dwarf Version", i32 4}
|
2015-03-04 01:24:31 +08:00
|
|
|
!65 = !{i32 1, !"Debug Info Version", i32 3}
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!66 = !{!"clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)"}
|
2015-08-01 02:58:39 +08:00
|
|
|
!67 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !49, type: !68)
|
2016-04-24 05:08:00 +08:00
|
|
|
!68 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)
|
2015-04-30 00:38:44 +08:00
|
|
|
!69 = !DILocation(line: 0, scope: !49)
|
2015-08-01 02:58:39 +08:00
|
|
|
!70 = !DILocalVariable(name: "i", line: 16, arg: 2, scope: !49, file: !7, type: !12)
|
2015-04-30 00:38:44 +08:00
|
|
|
!71 = !DILocation(line: 16, scope: !49)
|
|
|
|
!72 = !DILocation(line: 18, scope: !49)
|
|
|
|
!73 = !DILocation(line: 19, scope: !49)
|
2015-08-01 02:58:39 +08:00
|
|
|
!74 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !50, type: !68)
|
2015-04-30 00:38:44 +08:00
|
|
|
!75 = !DILocation(line: 0, scope: !50)
|
2015-08-01 02:58:39 +08:00
|
|
|
!76 = !DILocalVariable(name: "rhs", line: 21, arg: 2, scope: !50, file: !7, type: !22)
|
2015-04-30 00:38:44 +08:00
|
|
|
!77 = !DILocation(line: 21, scope: !50)
|
|
|
|
!78 = !DILocation(line: 23, scope: !50)
|
|
|
|
!79 = !DILocation(line: 24, scope: !50)
|
2015-08-01 02:58:39 +08:00
|
|
|
!80 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !51, type: !68)
|
2015-04-30 00:38:44 +08:00
|
|
|
!81 = !DILocation(line: 0, scope: !51)
|
2015-08-01 02:58:39 +08:00
|
|
|
!82 = !DILocalVariable(name: "rhs", line: 27, arg: 2, scope: !51, file: !7, type: !22)
|
2015-04-30 00:38:44 +08:00
|
|
|
!83 = !DILocation(line: 27, scope: !51)
|
|
|
|
!84 = !DILocation(line: 29, scope: !51)
|
|
|
|
!85 = !DILocation(line: 30, scope: !51)
|
2015-08-01 02:58:39 +08:00
|
|
|
!86 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !52, type: !68)
|
2015-04-30 00:38:44 +08:00
|
|
|
!87 = !DILocation(line: 0, scope: !52)
|
|
|
|
!88 = !DILocation(line: 35, scope: !52)
|
2015-08-01 02:58:39 +08:00
|
|
|
!89 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !53, type: !90)
|
2016-04-24 05:08:00 +08:00
|
|
|
!90 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !37)
|
2015-04-30 00:38:44 +08:00
|
|
|
!91 = !DILocation(line: 0, scope: !53)
|
|
|
|
!92 = !DILocation(line: 49, scope: !53)
|
2015-08-01 02:58:39 +08:00
|
|
|
!93 = !DILocalVariable(name: "a", line: 49, scope: !53, file: !7, type: !4)
|
2015-04-30 00:38:44 +08:00
|
|
|
!94 = !DILocation(line: 50, scope: !53)
|
|
|
|
!95 = !DILocation(line: 51, scope: !53)
|
|
|
|
!96 = !DILocation(line: 51, scope: !97)
|
|
|
|
!97 = distinct !DILexicalBlock(line: 51, column: 0, file: !1, scope: !53)
|
|
|
|
!98 = !DILocation(line: 51, scope: !99)
|
|
|
|
!99 = distinct !DILexicalBlock(line: 51, column: 0, file: !1, scope: !100)
|
|
|
|
!100 = distinct !DILexicalBlock(line: 51, column: 0, file: !1, scope: !53)
|
2015-08-01 02:58:39 +08:00
|
|
|
!101 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !63, type: !68)
|
2015-04-30 00:38:44 +08:00
|
|
|
!102 = !DILocation(line: 0, scope: !63)
|
|
|
|
!103 = !DILocation(line: 8, scope: !63)
|
2015-08-01 02:58:39 +08:00
|
|
|
!104 = !DILocalVariable(name: "argc", line: 53, arg: 1, scope: !54, file: !7, type: !12)
|
2015-04-30 00:38:44 +08:00
|
|
|
!105 = !DILocation(line: 53, scope: !54)
|
2015-08-01 02:58:39 +08:00
|
|
|
!106 = !DILocalVariable(name: "argv", line: 53, arg: 2, scope: !54, file: !7, type: !57)
|
|
|
|
!107 = !DILocalVariable(name: "b", line: 55, scope: !54, file: !7, type: !37)
|
2015-04-30 00:38:44 +08:00
|
|
|
!108 = !DILocation(line: 55, scope: !54)
|
2015-08-01 02:58:39 +08:00
|
|
|
!109 = !DILocalVariable(name: "return_val", line: 56, scope: !54, file: !7, type: !12)
|
2015-04-30 00:38:44 +08:00
|
|
|
!110 = !DILocation(line: 56, scope: !54)
|
|
|
|
!111 = !DILocation(line: 56, scope: !112)
|
|
|
|
!112 = distinct !DILexicalBlock(line: 56, column: 0, file: !1, scope: !54)
|
2015-08-01 02:58:39 +08:00
|
|
|
!113 = !DILocalVariable(name: "a", line: 58, scope: !54, file: !7, type: !4)
|
2015-04-30 00:38:44 +08:00
|
|
|
!114 = !DILocation(line: 58, scope: !54)
|
|
|
|
!115 = !DILocation(line: 59, scope: !54)
|
|
|
|
!116 = !DILocation(line: 60, scope: !54)
|
|
|
|
!117 = !DILocation(line: 60, scope: !118)
|
|
|
|
!118 = distinct !DILexicalBlock(line: 60, column: 0, file: !1, scope: !54)
|
|
|
|
!119 = !DILocation(line: 60, scope: !120)
|
|
|
|
!120 = distinct !DILexicalBlock(line: 60, column: 0, file: !1, scope: !54)
|
|
|
|
!121 = !DILocation(line: 60, scope: !122)
|
|
|
|
!122 = distinct !DILexicalBlock(line: 60, column: 0, file: !1, scope: !54)
|
2015-08-01 02:58:39 +08:00
|
|
|
!123 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !62, type: !90)
|
2015-04-30 00:38:44 +08:00
|
|
|
!124 = !DILocation(line: 0, scope: !62)
|
|
|
|
!125 = !DILocation(line: 41, scope: !62)
|
2015-08-01 02:58:39 +08:00
|
|
|
!126 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !61, type: !68)
|
2015-04-30 00:38:44 +08:00
|
|
|
!127 = !DILocation(line: 0, scope: !61)
|
|
|
|
!128 = !DILocation(line: 8, scope: !61)
|
|
|
|
!129 = !DILocation(line: 8, scope: !130)
|
|
|
|
!130 = distinct !DILexicalBlock(line: 8, column: 0, file: !1, scope: !61)
|
|
|
|
!131 = !DILocation(line: 8, scope: !132)
|
|
|
|
!132 = distinct !DILexicalBlock(line: 8, column: 0, file: !1, scope: !61)
|
|
|
|
!133 = !DILocation(line: 8, scope: !134)
|
|
|
|
!134 = distinct !DILexicalBlock(line: 8, column: 0, file: !1, scope: !61)
|