Hi!
As discussed in llvm-dev ML (https://groups.google.com/forum/m/#!topic/llvm-dev/42tNzaHISdk), for PowerPC{64} we cannot just pass SP extracted from @llvm.stackrestore to _asan_allocas_unpoison due to specific ABI requirements (http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#DYNAM-STACK). In particular, to get the pointer to the most recent dynamic alloca, we should add a compile-time-known offset to SP. This offset becomes to be known only on the frame index elimination stage, so we have introduced a special @llvm.get.dynamic.area.offset intrinsic (http://reviews.llvm.org/D14983) to reference it in LLVM. For most targets, this intrinsic is just lowered to zero in backend.
This patch just adds the value returned by @llvm.get.dynamic.area.offset to extracted from @llvm.stackrestore SP, so dynamic allocas unpoisoning stuff would work correctly on PowerPC{64}.
Tested on x86_64-unknown-linux-gnu. Jay, could you please check it on your PPC box?