Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] x86 frame pointer and __builtin_setjmp/__builtin_longjmp"
2011 Apr 12
2
[LLVMdev] built-in longjmp and setjmp
What would be the best way to convert built-in setjmp and longjmp tp library
calls?
Should it be implemented in clang or in backends?
On Tue, Apr 12, 2011 at 2:38 PM, Jim Grosbach <grosbach at apple.com> wrote:
> ARM/Darwin implements them. I'm not aware of any others.
>
> That said, they are designed for internal use by the compiler for exception
> handling. Calling them
2011 Apr 12
0
[LLVMdev] built-in longjmp and setjmp
If you want an automated method, then using the source code re-writer interfaces in clang is probably a reasonable starting place. Just modifying the source code manually is probably easier, though, to be honest.
As a moderate caveat to all of this, there are some bits of code out there that use these builtins that are very tightly coupled to the compiler (the Linux kernel used to do this, I
2011 Apr 12
0
[LLVMdev] built-in longjmp and setjmp
ARM/Darwin implements them. I'm not aware of any others.
That said, they are designed for internal use by the compiler for exception handling. Calling them directly like this is very much not recommended. Using the system library setjmp()/longjmp() functions is preferred.
-Jim
On Apr 12, 2011, at 1:56 PM, Akira Hatanaka wrote:
> Does the X86 backend (or any other backend) correctly
2011 Apr 12
2
[LLVMdev] built-in longjmp and setjmp
Does the X86 backend (or any other backend) correctly implement support for
__builtin_setjmp and __builtin_longjmp?
I don't get the correct result when I compile and run the following code
with clang.
# clang foo.c -O3; ./a.out
#include <stdio.h>
void *buf[20];
void __attribute__((noinline))
foo (void)
{
__builtin_longjmp (buf, 1);
}
int
main (int argc, char** argv)
{
if
2011 Apr 13
4
[LLVMdev] built-in longjmp and setjmp
On Apr 12, 2011, at 3:15 PM, Jim Grosbach wrote:
> If you want an automated method, then using the source code re-writer interfaces in clang is probably a reasonable starting place. Just modifying the source code manually is probably easier, though, to be honest.
>
> As a moderate caveat to all of this, there are some bits of code out there that use these builtins that are very tightly
2011 Apr 27
1
[LLVMdev] built-in longjmp and setjmp
Okay. Are you saying that you shouldn't use __builtin functions in general
in your program or just __builtin_setjmp/longjmp? Also, are there any
warnings issued by either clang or llvm if they are used in your program?
On Wed, Apr 27, 2011 at 3:55 PM, Jim Grosbach <grosbach at apple.com> wrote:
> The builtins are for internal compiler use in the context of SjLj exception
>
2013 May 08
1
[LLVMdev] Clarifying the state of setjmp/longjmp support in LLVM and Clang
I'm trying to make sense in the support for setjmp/longjmp in Clang and
LLVM, with only partial success. I'll try to summarize my findings in the
hope that someone can shed some light on why things are the way they are
and what I'm missing.
Clang.
Clang recognizes two forms of setjmp (all I say here applies to longjmp
similarly):
* __builtin_setjmp: gets lowered to calling the
2011 Apr 13
0
[LLVMdev] built-in longjmp and setjmp
It seems straightforward to implement, if it just needs to be functionally
correct.
I have another question about setjmp/longjmp. When the following program is
compiled and run with argument 10 (./a.out 10), should it print 10 or 23? I
am asking this question because it prints 23 when compiled with gcc and
prints 10 when compiled with clang. If it is supposed to return 23, it seems
to me that
2011 Apr 27
3
[LLVMdev] built-in longjmp and setjmp
Okay. I understand builtin functions do not have to behave exactly the same
way as standard library functions. What I wanted to know is what should the
code generated by llvm (clang + llc) look like (I am working on the Mips
back-end now). I guess there should be a behavior users expect to see who
are using __builtin_setjmp/longjmp even they aren't the same as library
functions. If the code
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
The builtins are for internal compiler use in the context of SjLj exception handling. Any other use, including any direct calls of the builtins in user code, are a bad idea with no guaranteed behaviour. That they're exposed at all is, again, for historical purposes. Don't use them.
-Jim
On Apr 27, 2011, at 3:45 PM, Akira Hatanaka wrote:
> Okay. I understand builtin functions do not
2011 Apr 27
2
[LLVMdev] built-in longjmp and setjmp
I declared gi2 as "volatile" and I think gi2 is still incremented once.
Here is a snippet of the code. Line 39 - 42 increments gi2.
According to the standard, shouldn't ++gi2 be executed twice regardless of
whether gi2 is volatile or not? Isn't the missing chain from EH_SJLJ_SETJMP
node to load/store nodes that access gi2 causing this problem (please see
attached file in my
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
There is no C standard to follow for these builtins. You are expecting them to behave as if they were the standard library calls. They are not equivalent and the naming similarity is an unfortunate historical artifact. Use the standard library functions instead.
-Jim
On Apr 27, 2011, at 1:22 PM, Akira Hatanaka wrote:
> I declared gi2 as "volatile" and I think gi2 is still
2011 Apr 27
0
[LLVMdev] built-in longjmp and setjmp
I have another basic question about setjmp/longjmp.
When I compile and run the following program, is it expected that global
variable gi2 will be incremented twice? It seems that the code generated
with clang and llc increments it only once (line 37-43 of attached file).
$ clang setjmp6.c -o setjmp6.arm.ll -emit-llvm -O3 -S -ccc-host-triple
arm-unknown-darwin -ccc-clang-archs arm
$ llc
2012 Nov 28
4
[LLVMdev] noreturn attribute on a call instruction vs noreturn on a function
Hi,
Building the following C code I get a call instruction that has no noreturn
attribute, while the function itself does have it.
void foo(void **b) {
__builtin_longjmp(b, 1);
}
define void @_Z3fooPPv(i8** %b) noreturn nounwind uwtable {
entry:
%0 = bitcast i8** %b to i8*
tail call void @llvm.eh.sjlj.longjmp(i8* %0)
2016 Apr 15
3
[Sparc] Load address with SETHI
Hi,
I'm trying to implement __builtin_setjmp / __builtin_longjmp for Sparc processors. I think I'm very close, but I can't work out how to issue BuildMI-type instructions to load the address of the recovery location (set in setjmp) into a register using the SETHI / OR combination. I can't see any equivalent code anywhere else in Sparc.
I imagine this is similar if I try to make a
2015 Feb 10
2
[LLVMdev] Semantics of __builtin_setjmp/__builtin_longjmp
Hi all,
currently we lower the __builtin_setjmp/__builtin_longjmp intrinsincs to
SjLj exception style intrinsics. For ARM on non-Darwin, they end up as
nops, breaking Ruby. This leads to the question of what the defined
semantics of them is.
(a) Are they supposed to be compatible with libc? PPC disagrees in
comments.
(b) Are they supposed to be compatible with GCC? If not with libc, why
with
2011 Apr 13
3
[LLVMdev] built-in longjmp and setjmp
On Apr 13, 2011, at 9:51 AM, Akira Hatanaka wrote:
> int
> main (int argc, char** argv)
> {
> int n = atoi(argv[1]), r;
>
> if ((r = setjmp (buf)))
> {
> printf("n = %d\n", n);
> return 0;
> }
Non-volatile local variables are not preserved by setjmp(), so this program can print whatever it wants.
/jakob
2012 Nov 29
0
[LLVMdev] noreturn attribute on a call instruction vs noreturn on afunction
You can use CallInst::hasFnAttr(). It checks for attributes in the
instruction and in the function decl.
http://llvm.org/docs/doxygen/html/Instructions_8cpp_source.html#l00345
Nuno
----- Original Message -----
> Hi,
>
> Building the following C code I get a call instruction that has no
> noreturn
> attribute, while the function itself does have it.
>
> void foo(void **b)
2012 Nov 28
0
[LLVMdev] noreturn attribute on a call instruction vs noreturn on a function
Hi Kostya,
On 28/11/12 14:47, Kostya Serebryany wrote:
> Hi,
>
> Building the following C code I get a call instruction that has no noreturn
> attribute, while the function itself does have it.
>
> void foo(void **b) {
> __builtin_longjmp(b, 1);
> }
>
>
> define void @_Z3fooPPv(i8** %b) noreturn nounwind uwtable {
> entry:
> %0 = bitcast i8** %b to i8*
2020 Aug 14
2
Intel AMX programming model discussion.
From: Hal Finkel <hfinkel at anl.gov>
Sent: Friday, August 14, 2020 11:27 PM
To: Luo, Yuanke <yuanke.luo at intel.com>; llvm-dev at lists.llvm.org; florian_hahn at apple.com; Kaylor, Andrew <andrew.kaylor at intel.com>; Topper, Craig <craig.topper at intel.com>; Lu, Hongjiu <hongjiu.lu at intel.com>
Subject: Re: [llvm-dev] Intel AMX programming model discussion.
On