2015-02-23 20:04:51 +00:00
|
|
|
; RUN: opt -mtriple=x86_64-pc-windows-msvc -winehprepare -S -o - < %s | FileCheck %s
|
|
|
|
|
|
|
|
; This test is based on the following code:
|
|
|
|
;
|
|
|
|
; struct SomeData {
|
|
|
|
; int a;
|
|
|
|
; int b;
|
|
|
|
; };
|
2015-03-03 00:05:35 +00:00
|
|
|
;
|
2015-02-23 20:04:51 +00:00
|
|
|
; void may_throw();
|
|
|
|
; void does_not_throw(int i);
|
|
|
|
; void dump(int *, int, SomeData&);
|
2015-03-03 00:05:35 +00:00
|
|
|
;
|
2015-02-23 20:04:51 +00:00
|
|
|
; void test() {
|
|
|
|
; int NumExceptions = 0;
|
|
|
|
; int ExceptionVal[10];
|
|
|
|
; SomeData Data = { 0, 0 };
|
2015-03-03 00:05:35 +00:00
|
|
|
;
|
2015-02-23 20:04:51 +00:00
|
|
|
; for (int i = 0; i < 10; ++i) {
|
|
|
|
; try {
|
|
|
|
; may_throw();
|
|
|
|
; Data.a += i;
|
|
|
|
; }
|
|
|
|
; catch (int e) {
|
|
|
|
; ExceptionVal[NumExceptions] = e;
|
|
|
|
; ++NumExceptions;
|
|
|
|
; if (e == i)
|
|
|
|
; Data.b += e;
|
|
|
|
; else
|
|
|
|
; Data.a += e;
|
|
|
|
; }
|
|
|
|
; does_not_throw(NumExceptions);
|
|
|
|
; }
|
|
|
|
; dump(ExceptionVal, NumExceptions, Data);
|
|
|
|
; }
|
|
|
|
|
|
|
|
; ModuleID = 'cppeh-frame-vars.cpp'
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-pc-windows-msvc"
|
|
|
|
|
|
|
|
%rtti.TypeDescriptor2 = type { i8**, i8*, [3 x i8] }
|
|
|
|
%struct.SomeData = type { i32, i32 }
|
|
|
|
|
|
|
|
$"\01??_R0H@8" = comdat any
|
|
|
|
|
|
|
|
@"\01??_7type_info@@6B@" = external constant i8*
|
|
|
|
@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
|
|
|
|
|
|
|
|
; The function entry should be rewritten like this.
|
2015-03-30 22:58:10 +00:00
|
|
|
; CHECK: define void @"\01?test@@YAXXZ"()
|
2015-02-23 20:04:51 +00:00
|
|
|
; CHECK: entry:
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[NUMEXCEPTIONS_PTR:\%.+]] = alloca i32, align 4
|
|
|
|
; CHECK: [[EXCEPTIONVAL_PTR:\%.+]] = alloca [10 x i32], align 16
|
|
|
|
; CHECK: [[DATA_PTR:\%.+]] = alloca %struct.SomeData, align 4
|
|
|
|
; CHECK: [[I_PTR:\%.+]] = alloca i32, align 4
|
|
|
|
; CHECK: [[E_PTR:\%.+]] = alloca i32, align 4
|
|
|
|
; CHECK: store i32 0, i32* [[NUMEXCEPTIONS_PTR]], align 4
|
|
|
|
; CHECK: [[TMP:\%.+]] = bitcast %struct.SomeData* [[DATA_PTR]] to i8*
|
|
|
|
; CHECK: call void @llvm.memset(i8* [[TMP]], i8 0, i64 8, i32 4, i1 false)
|
|
|
|
; CHECK: store i32 0, i32* [[I_PTR]], align 4
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
|
|
|
; CHECK: call void (...) @llvm.localescape(i32* [[E_PTR]], i32* [[NUMEXCEPTIONS_PTR]], [10 x i32]* [[EXCEPTIONVAL_PTR]], i32* [[I_PTR]], %struct.SomeData* [[DATA_PTR]])
|
2015-03-05 18:26:34 +00:00
|
|
|
; CHECK: br label %for.cond
|
2015-02-23 20:04:51 +00:00
|
|
|
|
|
|
|
; Function Attrs: uwtable
|
2015-06-17 20:52:32 +00:00
|
|
|
define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
|
2015-02-23 20:04:51 +00:00
|
|
|
entry:
|
|
|
|
%NumExceptions = alloca i32, align 4
|
|
|
|
%ExceptionVal = alloca [10 x i32], align 16
|
|
|
|
%Data = alloca %struct.SomeData, align 4
|
|
|
|
%i = alloca i32, align 4
|
|
|
|
%exn.slot = alloca i8*
|
|
|
|
%ehselector.slot = alloca i32
|
|
|
|
%e = alloca i32, align 4
|
|
|
|
store i32 0, i32* %NumExceptions, align 4
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp = bitcast %struct.SomeData* %Data to i8*
|
|
|
|
call void @llvm.memset(i8* %tmp, i8 0, i64 8, i32 4, i1 false)
|
2015-02-23 20:04:51 +00:00
|
|
|
store i32 0, i32* %i, align 4
|
|
|
|
br label %for.cond
|
|
|
|
|
|
|
|
for.cond: ; preds = %for.inc, %entry
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp1 = load i32, i32* %i, align 4
|
|
|
|
%cmp = icmp slt i32 %tmp1, 10
|
2015-02-23 20:04:51 +00:00
|
|
|
br i1 %cmp, label %for.body, label %for.end
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: for.body:
|
|
|
|
; CHECK: invoke void @"\01?may_throw@@YAXXZ"()
|
2015-04-24 16:22:19 +00:00
|
|
|
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
|
2015-03-11 23:22:06 +00:00
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
for.body: ; preds = %for.cond
|
|
|
|
invoke void @"\01?may_throw@@YAXXZ"()
|
|
|
|
to label %invoke.cont unwind label %lpad
|
|
|
|
|
|
|
|
invoke.cont: ; preds = %for.body
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp2 = load i32, i32* %i, align 4
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%a = getelementptr inbounds %struct.SomeData, %struct.SomeData* %Data, i32 0, i32 0
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp3 = load i32, i32* %a, align 4
|
|
|
|
%add = add nsw i32 %tmp3, %tmp2
|
2015-02-23 20:04:51 +00:00
|
|
|
store i32 %add, i32* %a, align 4
|
|
|
|
br label %try.cont
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %for.body
|
2015-06-17 20:52:32 +00:00
|
|
|
; CHECK: landingpad { i8*, i32 }
|
2015-03-12 01:38:48 +00:00
|
|
|
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
|
[opaque pointer type] Add textual IR support for explicit type parameter to the call instruction
See r230786 and r230794 for similar changes to gep and load
respectively.
Call is a bit different because it often doesn't have a single explicit
type - usually the type is deduced from the arguments, and just the
return type is explicit. In those cases there's no need to change the
IR.
When that's not the case, the IR usually contains the pointer type of
the first operand - but since typed pointers are going away, that
representation is insufficient so I'm just stripping the "pointerness"
of the explicit type away.
This does make the IR a bit weird - it /sort of/ reads like the type of
the first operand: "call void () %x(" but %x is actually of type "void
()*" and will eventually be just of type "ptr". But this seems not too
bad and I don't think it would benefit from repeating the type
("void (), void () * %x(" and then eventually "void (), ptr %x(") as has
been done with gep and load.
This also has a side benefit: since the explicit type is no longer a
pointer, there's no ambiguity between an explicit type and a function
that returns a function pointer. Previously this case needed an explicit
type (eg: a function returning a void() function was written as
"call void () () * @x(" rather than "call void () * @x(" because of the
ambiguity between a function returning a pointer to a void() function
and a function returning void).
No ambiguity means even function pointer return types can just be
written alone, without writing the whole function's type.
This leaves /only/ the varargs case where the explicit type is required.
Given the special type syntax in call instructions, the regex-fu used
for migration was a bit more involved in its own unique way (as every
one of these is) so here it is. Use it in conjunction with the apply.sh
script and associated find/xargs commands I've provided in rr230786 to
migrate your out of tree tests. Do let me know if any of this doesn't
cover your cases & we can iterate on a more general script/regexes to
help others with out of tree tests.
About 9 test cases couldn't be automatically migrated - half of those
were functions returning function pointers, where I just had to manually
delete the function argument types now that we didn't need an explicit
function type there. The other half were typedefs of function types used
in calls - just had to manually drop the * from those.
import fileinput
import sys
import re
pat = re.compile(r'((?:=|:|^|\s)call\s(?:[^@]*?))(\s*$|\s*(?:(?:\[\[[a-zA-Z0-9_]+\]\]|[@%](?:(")?[\\\?@a-zA-Z0-9_.]*?(?(3)"|)|{{.*}}))(?:\(|$)|undef|inttoptr|bitcast|null|asm).*$)')
addrspace_end = re.compile(r"addrspace\(\d+\)\s*\*$")
func_end = re.compile("(?:void.*|\)\s*)\*$")
def conv(match, line):
if not match or re.search(addrspace_end, match.group(1)) or not re.search(func_end, match.group(1)):
return line
return line[:match.start()] + match.group(1)[:match.group(1).rfind('*')].rstrip() + match.group(2) + line[match.end():]
for line in sys.stdin:
sys.stdout.write(conv(re.search(pat, line), line))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 23:24:18 +00:00
|
|
|
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
|
2015-03-12 01:38:48 +00:00
|
|
|
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont]
|
2015-03-11 23:22:06 +00:00
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
lpad: ; preds = %for.body
|
2015-06-17 20:52:32 +00:00
|
|
|
%tmp4 = landingpad { i8*, i32 }
|
2015-02-23 20:04:51 +00:00
|
|
|
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp5 = extractvalue { i8*, i32 } %tmp4, 0
|
|
|
|
store i8* %tmp5, i8** %exn.slot
|
|
|
|
%tmp6 = extractvalue { i8*, i32 } %tmp4, 1
|
|
|
|
store i32 %tmp6, i32* %ehselector.slot
|
2015-02-23 20:04:51 +00:00
|
|
|
br label %catch.dispatch
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK-NOT: catch.dispatch:
|
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
catch.dispatch: ; preds = %lpad
|
2015-02-27 21:17:42 +00:00
|
|
|
%sel = load i32, i32* %ehselector.slot
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp7 = call i32 @llvm.eh.typeid.for(i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)) #1
|
|
|
|
%matches = icmp eq i32 %sel, %tmp7
|
2015-02-23 20:04:51 +00:00
|
|
|
br i1 %matches, label %catch, label %eh.resume
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK-NOT: catch:
|
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
catch: ; preds = %catch.dispatch
|
2015-02-27 21:17:42 +00:00
|
|
|
%exn = load i8*, i8** %exn.slot
|
2015-03-03 17:41:09 +00:00
|
|
|
%e.i8 = bitcast i32* %e to i8*
|
|
|
|
call void @llvm.eh.begincatch(i8* %exn, i8* %e.i8) #1
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp11 = load i32, i32* %e, align 4
|
|
|
|
%tmp12 = load i32, i32* %NumExceptions, align 4
|
|
|
|
%idxprom = sext i32 %tmp12 to i64
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arrayidx = getelementptr inbounds [10 x i32], [10 x i32]* %ExceptionVal, i32 0, i64 %idxprom
|
2015-03-03 00:05:35 +00:00
|
|
|
store i32 %tmp11, i32* %arrayidx, align 4
|
|
|
|
%tmp13 = load i32, i32* %NumExceptions, align 4
|
|
|
|
%inc = add nsw i32 %tmp13, 1
|
2015-02-23 20:04:51 +00:00
|
|
|
store i32 %inc, i32* %NumExceptions, align 4
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp14 = load i32, i32* %e, align 4
|
|
|
|
%tmp15 = load i32, i32* %i, align 4
|
|
|
|
%cmp1 = icmp eq i32 %tmp14, %tmp15
|
2015-02-23 20:04:51 +00:00
|
|
|
br i1 %cmp1, label %if.then, label %if.else
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK-NOT: if.then:
|
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
if.then: ; preds = %catch
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp16 = load i32, i32* %e, align 4
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%b = getelementptr inbounds %struct.SomeData, %struct.SomeData* %Data, i32 0, i32 1
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp17 = load i32, i32* %b, align 4
|
|
|
|
%add2 = add nsw i32 %tmp17, %tmp16
|
2015-02-23 20:04:51 +00:00
|
|
|
store i32 %add2, i32* %b, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK-NOT: if.else:
|
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
if.else: ; preds = %catch
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp18 = load i32, i32* %e, align 4
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%a3 = getelementptr inbounds %struct.SomeData, %struct.SomeData* %Data, i32 0, i32 0
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp19 = load i32, i32* %a3, align 4
|
|
|
|
%add4 = add nsw i32 %tmp19, %tmp18
|
2015-02-23 20:04:51 +00:00
|
|
|
store i32 %add4, i32* %a3, align 4
|
|
|
|
br label %if.end
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK-NOT: if.end:
|
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
if.end: ; preds = %if.else, %if.then
|
|
|
|
call void @llvm.eh.endcatch() #1
|
|
|
|
br label %try.cont
|
|
|
|
|
|
|
|
try.cont: ; preds = %if.end, %invoke.cont
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp20 = load i32, i32* %NumExceptions, align 4
|
|
|
|
call void @"\01?does_not_throw@@YAXH@Z"(i32 %tmp20)
|
2015-02-23 20:04:51 +00:00
|
|
|
br label %for.inc
|
|
|
|
|
|
|
|
for.inc: ; preds = %try.cont
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp21 = load i32, i32* %i, align 4
|
|
|
|
%inc5 = add nsw i32 %tmp21, 1
|
2015-02-23 20:04:51 +00:00
|
|
|
store i32 %inc5, i32* %i, align 4
|
|
|
|
br label %for.cond
|
|
|
|
|
|
|
|
for.end: ; preds = %for.cond
|
2015-03-03 00:05:35 +00:00
|
|
|
%tmp22 = load i32, i32* %NumExceptions, align 4
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arraydecay = getelementptr inbounds [10 x i32], [10 x i32]* %ExceptionVal, i32 0, i32 0
|
2015-03-03 00:05:35 +00:00
|
|
|
call void @"\01?dump@@YAXPEAHHAEAUSomeData@@@Z"(i32* %arraydecay, i32 %tmp22, %struct.SomeData* dereferenceable(8) %Data)
|
2015-02-23 20:04:51 +00:00
|
|
|
ret void
|
|
|
|
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK-NOT: eh.resume:
|
|
|
|
|
2015-02-23 20:04:51 +00:00
|
|
|
eh.resume: ; preds = %catch.dispatch
|
2015-02-27 21:17:42 +00:00
|
|
|
%exn6 = load i8*, i8** %exn.slot
|
|
|
|
%sel7 = load i32, i32* %ehselector.slot
|
2015-02-23 20:04:51 +00:00
|
|
|
%lpad.val = insertvalue { i8*, i32 } undef, i8* %exn6, 0
|
|
|
|
%lpad.val8 = insertvalue { i8*, i32 } %lpad.val, i32 %sel7, 1
|
|
|
|
resume { i8*, i32 } %lpad.val8
|
2015-03-11 23:22:06 +00:00
|
|
|
|
|
|
|
; CHECK: }
|
2015-02-23 20:04:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; The following catch handler should be outlined.
|
2015-03-30 22:58:10 +00:00
|
|
|
; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*)
|
2015-03-03 20:00:16 +00:00
|
|
|
; CHECK: entry:
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
|
|
|
; CHECK: [[RECOVER_E:\%.+]] = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 0)
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[E_PTR1:\%.+]] = bitcast i8* [[RECOVER_E]] to i32*
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
|
|
|
; CHECK: [[RECOVER_NUMEXCEPTIONS:\%.+]] = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 1)
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[NUMEXCEPTIONS_PTR1:\%.+]] = bitcast i8* [[RECOVER_NUMEXCEPTIONS]] to i32*
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
|
|
|
; CHECK: [[RECOVER_EXCEPTIONVAL:\%.+]] = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[EXCEPTIONVAL_PTR1:\%.+]] = bitcast i8* [[RECOVER_EXCEPTIONVAL]] to [10 x i32]*
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
|
|
|
; CHECK: [[RECOVER_I:\%.+]] = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 3)
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[I_PTR1:\%.+]] = bitcast i8* [[RECOVER_I]] to i32*
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 22:25:32 +00:00
|
|
|
; CHECK: [[RECOVER_DATA:\%.+]] = call i8* @llvm.localrecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 4)
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[DATA_PTR1:\%.+]] = bitcast i8* [[RECOVER_DATA]] to %struct.SomeData*
|
|
|
|
; CHECK: [[TMP:\%.+]] = load i32, i32* [[E_PTR1]], align 4
|
|
|
|
; CHECK: [[TMP1:\%.+]] = load i32, i32* [[NUMEXCEPTIONS_PTR]], align 4
|
|
|
|
; CHECK: [[IDXPROM:\%.+]] = sext i32 [[TMP1]] to i64
|
|
|
|
; CHECK: [[ARRAYIDX:\%.+]] = getelementptr inbounds [10 x i32], [10 x i32]* [[EXCEPTIONVAL_PTR1]], i32 0, i64 [[IDXPROM]]
|
|
|
|
; CHECK: store i32 [[TMP]], i32* [[ARRAYIDX]], align 4
|
|
|
|
; CHECK: [[TMP2:\%.+]] = load i32, i32* [[NUMEXCEPTIONS_PTR1]], align 4
|
|
|
|
; CHECK: [[INC:\%.+]] = add nsw i32 [[TMP2]], 1
|
|
|
|
; CHECK: store i32 [[INC]], i32* [[NUMEXCEPTIONS_PTR]], align 4
|
|
|
|
; CHECK: [[TMP3:\%.+]] = load i32, i32* [[E_PTR1]], align 4
|
|
|
|
; CHECK: [[TMP4:\%.+]] = load i32, i32* [[I_PTR1]], align 4
|
|
|
|
; CHECK: [[CMP:\%.+]] = icmp eq i32 [[TMP3]], [[TMP4]]
|
|
|
|
; CHECK: br i1 [[CMP]], label %if.then, label %if.else
|
2015-02-23 20:04:51 +00:00
|
|
|
;
|
2015-03-03 20:00:16 +00:00
|
|
|
; CHECK: if.then: ; preds = %entry
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[TMP5:\%.+]] = load i32, i32* [[E_PTR1]], align 4
|
|
|
|
; CHECK: [[B_PTR:\%.+]] = getelementptr inbounds %struct.SomeData, %struct.SomeData* [[DATA_PTR1]], i32 0, i32 1
|
|
|
|
; CHECK: [[TMP6:\%.+]] = load i32, i32* [[B_PTR]], align 4
|
|
|
|
; CHECK: %add2 = add nsw i32 [[TMP6]], [[TMP5]]
|
|
|
|
; CHECK: store i32 [[ADD:\%.+]], i32* [[B_PTR]], align 4
|
2015-02-23 20:04:51 +00:00
|
|
|
; CHECK: br label %if.end
|
|
|
|
;
|
2015-03-03 20:00:16 +00:00
|
|
|
; CHECK: if.else: ; preds = %entry
|
2015-03-11 23:22:06 +00:00
|
|
|
; CHECK: [[TMP7:\%.+]] = load i32, i32* %e, align 4
|
|
|
|
; CHECK: [[A3:\%.+]] = getelementptr inbounds %struct.SomeData, %struct.SomeData* %Data, i32 0, i32 0
|
|
|
|
; CHECK: [[TMP8:\%.+]] = load i32, i32* %a3, align 4
|
|
|
|
; CHECK: [[ADD1:\%.+]] = add nsw i32 [[TMP8]], [[TMP7]]
|
|
|
|
; CHECK: store i32 [[ADD1]], i32* [[A3]], align 4
|
2015-02-23 20:04:51 +00:00
|
|
|
; CHECK: br label %if.end
|
|
|
|
;
|
|
|
|
; CHECK: if.end: ; preds = %if.else, %if.then
|
|
|
|
; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont)
|
|
|
|
; CHECK: }
|
|
|
|
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
|
|
|
declare void @llvm.memset(i8* nocapture, i8, i64, i32, i1) #1
|
|
|
|
|
|
|
|
declare void @"\01?may_throw@@YAXXZ"() #2
|
|
|
|
|
|
|
|
declare i32 @__CxxFrameHandler3(...)
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone
|
|
|
|
declare i32 @llvm.eh.typeid.for(i8*) #3
|
|
|
|
|
2015-03-03 17:41:09 +00:00
|
|
|
declare void @llvm.eh.begincatch(i8*, i8*)
|
2015-02-23 20:04:51 +00:00
|
|
|
|
|
|
|
declare void @llvm.eh.endcatch()
|
|
|
|
|
|
|
|
declare void @"\01?does_not_throw@@YAXH@Z"(i32) #2
|
|
|
|
|
|
|
|
declare void @"\01?dump@@YAXPEAHHAEAUSomeData@@@Z"(i32*, i32, %struct.SomeData* dereferenceable(8)) #2
|
|
|
|
|
|
|
|
attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
attributes #1 = { nounwind }
|
|
|
|
attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
attributes #3 = { nounwind readnone }
|
|
|
|
|
|
|
|
!llvm.module.flags = !{!0}
|
|
|
|
!llvm.ident = !{!1}
|
|
|
|
|
|
|
|
!0 = !{i32 1, !"PIC Level", i32 2}
|
|
|
|
!1 = !{!"clang version 3.7.0 (trunk 228868)"}
|