2014-10-03 06:21:49 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
|
2013-11-01 06:11:56 +08:00
|
|
|
;
|
|
|
|
; Note: Print verbose stackmaps using -debug-only=stackmaps.
|
|
|
|
|
|
|
|
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
|
|
|
|
; CHECK-NEXT: __LLVM_StackMaps:
|
2014-04-01 06:14:04 +08:00
|
|
|
; Header
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .byte 2
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .byte 0
|
|
|
|
; CHECK-NEXT: .short 0
|
2014-01-31 02:58:27 +08:00
|
|
|
; Num Functions
|
2014-08-02 02:26:27 +08:00
|
|
|
; CHECK-NEXT: .long 16
|
2013-11-01 06:11:56 +08:00
|
|
|
; Num LargeConstants
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .long 3
|
|
|
|
; Num Callsites
|
2014-08-02 02:26:27 +08:00
|
|
|
; CHECK-NEXT: .long 20
|
2014-04-01 06:14:04 +08:00
|
|
|
|
|
|
|
; Functions and stack size
|
|
|
|
; CHECK-NEXT: .quad _constantargs
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _osrinline
|
|
|
|
; CHECK-NEXT: .quad 24
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _osrcold
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _propertyRead
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _propertyWrite
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _jsVoidCall
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _jsIntCall
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _spilledValue
|
2016-12-13 09:38:41 +08:00
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _spilledStackMapValue
|
2016-12-13 09:38:41 +08:00
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _spillSubReg
|
|
|
|
; CHECK-NEXT: .quad 56
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _subRegOffset
|
|
|
|
; CHECK-NEXT: .quad 56
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _liveConstant
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _directFrameIdx
|
|
|
|
; CHECK-NEXT: .quad 56
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 2
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _longid
|
|
|
|
; CHECK-NEXT: .quad 8
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 4
|
2014-04-01 06:14:04 +08:00
|
|
|
; CHECK-NEXT: .quad _clobberScratch
|
|
|
|
; CHECK-NEXT: .quad 56
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-08-02 02:26:27 +08:00
|
|
|
; CHECK-NEXT: .quad _needsStackRealignment
|
|
|
|
; CHECK-NEXT: .quad -1
|
2016-09-15 04:22:03 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2014-04-01 06:14:04 +08:00
|
|
|
|
|
|
|
; Large Constants
|
2014-01-09 08:22:31 +08:00
|
|
|
; CHECK-NEXT: .quad 2147483648
|
|
|
|
; CHECK-NEXT: .quad 4294967295
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .quad 4294967296
|
|
|
|
|
2014-04-01 06:14:04 +08:00
|
|
|
; Callsites
|
2013-11-01 06:11:56 +08:00
|
|
|
; Constant arguments
|
|
|
|
;
|
2013-12-14 02:37:10 +08:00
|
|
|
; CHECK-NEXT: .quad 1
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .long L{{.*}}-_constantargs
|
|
|
|
; CHECK-NEXT: .short 0
|
2014-01-09 08:22:31 +08:00
|
|
|
; CHECK-NEXT: .short 12
|
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long -1
|
2013-11-01 06:11:56 +08:00
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
2014-01-09 08:22:31 +08:00
|
|
|
; CHECK-NEXT: .long -1
|
2013-11-01 06:11:56 +08:00
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 65536
|
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
2014-01-09 08:22:31 +08:00
|
|
|
; CHECK-NEXT: .long 2000000000
|
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 2147483647
|
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .long -1
|
2014-01-09 08:22:31 +08:00
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long -1
|
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 0
|
2013-11-01 06:11:56 +08:00
|
|
|
; LargeConstant at index 0
|
|
|
|
; CHECK-NEXT: .byte 5
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 0
|
2014-01-09 08:22:31 +08:00
|
|
|
; LargeConstant at index 1
|
|
|
|
; CHECK-NEXT: .byte 5
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 1
|
|
|
|
; LargeConstant at index 2
|
|
|
|
; CHECK-NEXT: .byte 5
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 2
|
|
|
|
; SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long -1
|
2013-11-01 06:11:56 +08:00
|
|
|
|
|
|
|
define void @constantargs() {
|
|
|
|
entry:
|
|
|
|
%0 = inttoptr i64 12345 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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 1, i32 15, i8* %0, i32 0, i16 65535, i16 -1, i32 65536, i32 2000000000, i32 2147483647, i32 -1, i32 4294967295, i32 4294967296, i64 2147483648, i64 4294967295, i64 4294967296, i64 -1)
|
2013-11-01 06:11:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Inline OSR Exit
|
|
|
|
;
|
2013-12-14 02:37:03 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_osrinline
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
define void @osrinline(i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
; Runtime void->void call.
|
|
|
|
call void inttoptr (i64 -559038737 to void ()*)()
|
|
|
|
; Followed by inline OSR patchpoint with 12-byte shadow and 2 live vars.
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, ...) @llvm.experimental.stackmap(i64 3, i32 12, i64 %a, i64 %b)
|
2013-11-01 06:11:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Cold OSR Exit
|
|
|
|
;
|
|
|
|
; 2 live variables in register.
|
|
|
|
;
|
2013-12-14 02:37:03 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_osrcold
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
2013-12-06 08:28:54 +08:00
|
|
|
; CHECK-NEXT: .long 0
|
2013-11-01 06:11:56 +08:00
|
|
|
define void @osrcold(i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%test = icmp slt i64 %a, %b
|
|
|
|
br i1 %test, label %ret, label %cold
|
|
|
|
cold:
|
|
|
|
; OSR patchpoint with 12-byte nop-slide and 2 live vars.
|
|
|
|
%thunk = inttoptr i64 -559038737 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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 4, i32 15, i8* %thunk, i32 0, i64 %a, i64 %b)
|
2013-11-01 06:11:56 +08:00
|
|
|
unreachable
|
|
|
|
ret:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Property Read
|
2013-12-14 02:37:03 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_propertyRead
|
2013-12-06 08:28:54 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
2013-11-01 06:11:56 +08:00
|
|
|
define i64 @propertyRead(i64* %obj) {
|
|
|
|
entry:
|
|
|
|
%resolveRead = inttoptr i64 -559038737 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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
%result = call anyregcc i64 (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.i64(i64 5, i32 15, i8* %resolveRead, i32 1, i64* %obj)
|
2013-11-01 06:11:56 +08:00
|
|
|
%add = add i64 %result, 3
|
|
|
|
ret i64 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
; Property Write
|
2013-12-14 02:37:03 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_propertyWrite
|
2013-12-06 08:28:54 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
2013-11-01 06:11:56 +08:00
|
|
|
define void @propertyWrite(i64 %dummy1, i64* %obj, i64 %dummy2, i64 %a) {
|
|
|
|
entry:
|
|
|
|
%resolveWrite = inttoptr i64 -559038737 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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call anyregcc void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 6, i32 15, i8* %resolveWrite, i32 2, i64* %obj, i64 %a)
|
2013-11-01 06:11:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Void JS Call
|
|
|
|
;
|
|
|
|
; 2 live variables in registers.
|
|
|
|
;
|
2013-12-14 02:37:03 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_jsVoidCall
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
define void @jsVoidCall(i64 %dummy1, i64* %obj, i64 %arg, i64 %l1, i64 %l2) {
|
|
|
|
entry:
|
|
|
|
%resolveCall = inttoptr i64 -559038737 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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 7, i32 15, i8* %resolveCall, i32 2, i64* %obj, i64 %arg, i64 %l1, i64 %l2)
|
2013-11-01 06:11:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; i64 JS Call
|
|
|
|
;
|
|
|
|
; 2 live variables in registers.
|
|
|
|
;
|
2013-12-14 02:37:03 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_jsIntCall
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
; CHECK-NEXT: .byte 1
|
2013-11-17 09:36:23 +08:00
|
|
|
; CHECK-NEXT: .byte 8
|
2013-11-01 06:11:56 +08:00
|
|
|
; CHECK-NEXT: .short {{[0-9]+}}
|
|
|
|
; CHECK-NEXT: .long 0
|
|
|
|
define i64 @jsIntCall(i64 %dummy1, i64* %obj, i64 %arg, i64 %l1, i64 %l2) {
|
|
|
|
entry:
|
|
|
|
%resolveCall = inttoptr i64 -559038737 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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
%result = call i64 (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.i64(i64 8, i32 15, i8* %resolveCall, i32 2, i64* %obj, i64 %arg, i64 %l1, i64 %l2)
|
2013-11-01 06:11:56 +08:00
|
|
|
%add = add i64 %result, 3
|
|
|
|
ret i64 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
; Spilled stack map values.
|
|
|
|
;
|
|
|
|
; Verify 17 stack map entries.
|
|
|
|
;
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_spilledValue
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 17
|
2013-11-01 06:11:56 +08:00
|
|
|
;
|
2013-11-13 02:06:12 +08:00
|
|
|
; Check that at least one is a spilled entry from RBP.
|
|
|
|
; Location: Indirect RBP + ...
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK: .byte 3
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 6
|
2013-11-01 06:11:56 +08:00
|
|
|
define void @spilledValue(i64 %arg0, i64 %arg1, i64 %arg2, i64 %arg3, i64 %arg4, i64 %l0, i64 %l1, i64 %l2, i64 %l3, i64 %l4, i64 %l5, i64 %l6, i64 %l7, i64 %l8, i64 %l9, i64 %l10, i64 %l11, i64 %l12, i64 %l13, i64 %l14, i64 %l15, i64 %l16) {
|
|
|
|
entry:
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 11, i32 15, i8* null, i32 5, i64 %arg0, i64 %arg1, i64 %arg2, i64 %arg3, i64 %arg4, i64 %l0, i64 %l1, i64 %l2, i64 %l3, i64 %l4, i64 %l5, i64 %l6, i64 %l7, i64 %l8, i64 %l9, i64 %l10, i64 %l11, i64 %l12, i64 %l13, i64 %l14, i64 %l15, i64 %l16)
|
2013-11-01 06:11:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-11-13 06:58:39 +08:00
|
|
|
; Spilled stack map values.
|
|
|
|
;
|
|
|
|
; Verify 17 stack map entries.
|
|
|
|
;
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_spilledStackMapValue
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .short 17
|
2013-11-13 06:58:39 +08:00
|
|
|
;
|
|
|
|
; Check that at least one is a spilled entry from RBP.
|
|
|
|
; Location: Indirect RBP + ...
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK: .byte 3
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 6
|
2013-11-13 06:58:39 +08:00
|
|
|
define webkit_jscc void @spilledStackMapValue(i64 %l0, i64 %l1, i64 %l2, i64 %l3, i64 %l4, i64 %l5, i64 %l6, i64 %l7, i64 %l8, i64 %l9, i64 %l10, i64 %l11, i64 %l12, i64 %l13, i64 %l14, i64 %l15, i64 %l16) {
|
|
|
|
entry:
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, ...) @llvm.experimental.stackmap(i64 12, i32 15, i64 %l0, i64 %l1, i64 %l2, i64 %l3, i64 %l4, i64 %l5, i64 %l6, i64 %l7, i64 %l8, i64 %l9, i64 %l10, i64 %l11, i64 %l12, i64 %l13, i64 %l14, i64 %l15, i64 %l16)
|
2013-11-13 06:58:39 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-11-17 09:36:23 +08:00
|
|
|
; Spill a subregister stackmap operand.
|
|
|
|
;
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_spillSubReg
|
|
|
|
; CHECK-NEXT: .short 0
|
2013-11-17 09:36:23 +08:00
|
|
|
; 4 locations
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-NEXT: .short 1
|
2013-11-17 09:36:23 +08:00
|
|
|
;
|
|
|
|
; Check that the subregister operand is a 4-byte spill.
|
|
|
|
; Location: Indirect, 4-byte, RBP + ...
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK: .byte 3
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .short 6
|
2013-11-17 09:36:23 +08:00
|
|
|
define void @spillSubReg(i64 %arg) #0 {
|
|
|
|
bb:
|
|
|
|
br i1 undef, label %bb1, label %bb2
|
|
|
|
|
|
|
|
bb1:
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
bb2:
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load i64, i64* inttoptr (i64 140685446136880 to i64*)
|
2013-11-17 09:36:23 +08:00
|
|
|
br i1 undef, label %bb16, label %bb17
|
|
|
|
|
|
|
|
bb16:
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
bb17:
|
|
|
|
%tmp32 = trunc i64 %tmp to i32
|
|
|
|
br i1 undef, label %bb60, label %bb61
|
|
|
|
|
|
|
|
bb60:
|
|
|
|
tail call void asm sideeffect "nop", "~{ax},~{bx},~{cx},~{dx},~{bp},~{si},~{di},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"() nounwind
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 13, i32 5, i32 %tmp32)
|
2013-11-17 09:36:23 +08:00
|
|
|
unreachable
|
|
|
|
|
|
|
|
bb61:
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Map a single byte subregister. There is no DWARF register number, so
|
|
|
|
; we expect the register to be encoded with the proper size and spill offset. We don't know which
|
|
|
|
;
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_subRegOffset
|
|
|
|
; CHECK-NEXT: .short 0
|
2013-11-17 09:36:23 +08:00
|
|
|
; 2 locations
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-NEXT: .short 2
|
2013-11-17 09:36:23 +08:00
|
|
|
;
|
|
|
|
; Check that the subregister operands are 1-byte spills.
|
|
|
|
; Location 0: Register, 4-byte, AL
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 0
|
2013-11-17 09:36:23 +08:00
|
|
|
;
|
|
|
|
; Location 1: Register, 4-byte, BL
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .byte 1
|
|
|
|
; CHECK-NEXT: .short 3
|
|
|
|
; CHECK-NEXT: .long 0
|
2013-11-17 09:36:23 +08:00
|
|
|
define void @subRegOffset(i16 %arg) {
|
|
|
|
%v = mul i16 %arg, 5
|
|
|
|
%a0 = trunc i16 %v to i8
|
|
|
|
tail call void asm sideeffect "nop", "~{bx}"() nounwind
|
|
|
|
%arghi = lshr i16 %v, 8
|
|
|
|
%a1 = trunc i16 %arghi to i8
|
|
|
|
tail call void asm sideeffect "nop", "~{cx},~{dx},~{bp},~{si},~{di},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"() nounwind
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 14, i32 5, i8 %a0, i8 %a1)
|
2013-11-17 09:36:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-11-23 03:07:36 +08:00
|
|
|
; Map a constant value.
|
|
|
|
;
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_liveConstant
|
|
|
|
; CHECK-NEXT: .short 0
|
2013-11-23 03:07:36 +08:00
|
|
|
; 1 location
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-NEXT: .short 1
|
2013-11-23 03:07:36 +08:00
|
|
|
; Loc 0: SmallConstant
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; CHECK-NEXT: .long 33
|
|
|
|
|
|
|
|
define void @liveConstant() {
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 15, i32 5, i32 33)
|
2013-11-23 03:07:36 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-11-26 10:03:25 +08:00
|
|
|
; Directly map an alloca's address.
|
|
|
|
;
|
|
|
|
; Callsite 16
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_directFrameIdx
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; 1 location
|
|
|
|
; CHECK-NEXT: .short 1
|
|
|
|
; Loc 0: Direct RBP - ofs
|
|
|
|
; CHECK-NEXT: .byte 2
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 6
|
|
|
|
; CHECK-NEXT: .long
|
2013-12-14 14:53:06 +08:00
|
|
|
|
2013-11-26 10:03:25 +08:00
|
|
|
; Callsite 17
|
2013-12-14 14:53:06 +08:00
|
|
|
; CHECK-LABEL: .long L{{.*}}-_directFrameIdx
|
2013-11-26 10:03:25 +08:00
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; 2 locations
|
|
|
|
; CHECK-NEXT: .short 2
|
|
|
|
; Loc 0: Direct RBP - ofs
|
|
|
|
; CHECK-NEXT: .byte 2
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 6
|
|
|
|
; CHECK-NEXT: .long
|
|
|
|
; Loc 1: Direct RBP - ofs
|
|
|
|
; CHECK-NEXT: .byte 2
|
|
|
|
; CHECK-NEXT: .byte 8
|
|
|
|
; CHECK-NEXT: .short 6
|
|
|
|
; CHECK-NEXT: .long
|
|
|
|
define void @directFrameIdx() {
|
|
|
|
entry:
|
|
|
|
%metadata1 = alloca i64, i32 3, align 8
|
|
|
|
store i64 11, i64* %metadata1
|
|
|
|
store i64 12, i64* %metadata1
|
|
|
|
store i64 13, i64* %metadata1
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, ...) @llvm.experimental.stackmap(i64 16, i32 0, i64* %metadata1)
|
2013-11-26 10:03:25 +08:00
|
|
|
%metadata2 = alloca i8, i32 4, align 8
|
|
|
|
%metadata3 = alloca i16, i32 4, align 8
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 17, i32 5, i8* null, i32 0, i8* %metadata2, i16* %metadata3)
|
2013-12-14 02:37:10 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Test a 64-bit ID.
|
|
|
|
;
|
|
|
|
; CHECK: .quad 4294967295
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_longid
|
|
|
|
; CHECK: .quad 4294967296
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_longid
|
|
|
|
; CHECK: .quad 9223372036854775807
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_longid
|
|
|
|
; CHECK: .quad -1
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_longid
|
|
|
|
define void @longid() {
|
|
|
|
entry:
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 4294967295, i32 0, i8* null, i32 0)
|
|
|
|
tail call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 4294967296, i32 0, i8* null, i32 0)
|
|
|
|
tail call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 9223372036854775807, i32 0, i8* null, i32 0)
|
|
|
|
tail call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 -1, i32 0, i8* null, i32 0)
|
2013-11-26 10:03:25 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-03-05 15:08:16 +08:00
|
|
|
; Map a value when R11 is the only free register.
|
|
|
|
; The scratch register should not be used for a live stackmap value.
|
|
|
|
;
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_clobberScratch
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; 1 location
|
|
|
|
; CHECK-NEXT: .short 1
|
|
|
|
; Loc 0: Indirect fp - offset
|
|
|
|
; CHECK-NEXT: .byte 3
|
|
|
|
; CHECK-NEXT: .byte 4
|
|
|
|
; CHECK-NEXT: .short 6
|
|
|
|
; CHECK-NEXT: .long -{{[0-9]+}}
|
|
|
|
define void @clobberScratch(i32 %a) {
|
|
|
|
tail call void asm sideeffect "nop", "~{ax},~{bx},~{cx},~{dx},~{bp},~{si},~{di},~{r8},~{r9},~{r10},~{r12},~{r13},~{r14},~{r15}"() nounwind
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 16, i32 8, i32 %a)
|
2014-03-05 15:08:16 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-08-02 02:26:27 +08:00
|
|
|
; A stack frame which needs to be realigned at runtime (to meet alignment
|
|
|
|
; criteria for values on the stack) does not have a fixed frame size.
|
|
|
|
; CHECK-LABEL: .long L{{.*}}-_needsStackRealignment
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
; 0 locations
|
|
|
|
; CHECK-NEXT: .short 0
|
|
|
|
define void @needsStackRealignment() {
|
|
|
|
%val = alloca i64, i32 3, align 128
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (...) @escape_values(i64* %val)
|
2014-08-02 02:26:27 +08:00
|
|
|
; Note: Adding any non-constant to the stackmap would fail because we
|
|
|
|
; expected to be able to address off the frame pointer. In a realigned
|
|
|
|
; frame, we must use the stack pointer instead. This is a separate bug.
|
[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))
llvm-svn: 235145
2015-04-17 07:24:18 +08:00
|
|
|
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0)
|
2014-08-02 02:26:27 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
declare void @escape_values(...)
|
|
|
|
|
2013-12-14 02:37:10 +08:00
|
|
|
declare void @llvm.experimental.stackmap(i64, i32, ...)
|
|
|
|
declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...)
|
|
|
|
declare i64 @llvm.experimental.patchpoint.i64(i64, i32, i8*, i32, ...)
|