Go to file
Hal Finkel 756810fe36 Implement builtin_{setjmp/longjmp} on PPC
This implements SJLJ lowering on PPC, making the Clang functions
__builtin_{setjmp/longjmp} functional on PPC platforms. The implementation
strategy is similar to that on X86, with the exception that a branch-and-link
variant is used to get the right jump address. Credit goes to Bill Schmidt for
suggesting the use of the unconditional bcl form (instead of the regular bl
instruction) to limit return-address-cache pollution.

Benchmarking the speed at -O3 of:

static jmp_buf env_sigill;

void foo() {
                __builtin_longjmp(env_sigill,1);
}

main() {
	...

        for (int i = 0; i < c; ++i) {
                if (__builtin_setjmp(env_sigill)) {
                        goto done;
                } else {
                        foo();
                }

done:;
        }

	...
}

vs. the same code using the libc setjmp/longjmp functions on a P7 shows that
this builtin implementation is ~4x faster with Altivec enabled and ~7.25x
faster with Altivec disabled. This comparison is somewhat unfair because the
libc version must also save/restore the VSX registers which we don't yet
support.

llvm-svn: 177666
2013-03-21 21:37:52 +00:00
clang Fix indentation 2013-03-21 21:35:15 +00:00
clang-tools-extra Fix Makefile. 2013-03-20 10:02:35 +00:00
compiler-rt tsan: better reporting of thread leaks 2013-03-21 16:55:17 +00:00
debuginfo-tests Remove IR scenario tests. 2013-03-15 20:52:10 +00:00
libclc Update the copyright coredits -- Happy new year 2013! 2013-01-01 10:00:19 +00:00
libcxx Fix bug in test; found by AddressSanitizer 2013-03-20 00:01:48 +00:00
libcxxabi Bruce Mitchener: Typo fixes. 2013-02-15 15:48:49 +00:00
lld [ELF][Hexagon][test] check .got.plt order 2013-03-20 23:39:43 +00:00
lldb Select correct -std flag for CMake for different versions of gcc. 2013-03-21 20:52:53 +00:00
llvm Implement builtin_{setjmp/longjmp} on PPC 2013-03-21 21:37:52 +00:00
polly Add failing test case 2013-03-21 16:14:55 +00:00