Add call sequence start and end for __tls_get_addr
authorKyle Butt <kyle+llvm@iteratee.net>
Fri, 8 Jan 2016 02:06:19 +0000 (02:06 +0000)
committerKyle Butt <kyle+llvm@iteratee.net>
Fri, 8 Jan 2016 02:06:19 +0000 (02:06 +0000)
commite51b530b1255624a0a170395ce2d950b56d6c7f3
tree84be9f10137cbda8b9800533b469a8d6795c9f11
parent505bc5070135483f0700cb04b33ff670efc84816
Add call sequence start and end for __tls_get_addr

This is a fix for bug http://llvm.org/bugs/show_bug.cgi?id=25839.

For a PIC TLS variable access in a function, prologue (mflr followed by std and
stdu) gets scheduled after a tls_get_addr call. tls_get_addr messed up LR but
no one saves/restores it.

Also added a test for save/restore clobbered registers during calling __tls_get_addr.

Patch by Tim Shen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257137 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCTLSDynamicCall.cpp
test/CodeGen/PowerPC/tls_get_addr_clobbers.ll [new file with mode: 0644]
test/CodeGen/PowerPC/tls_get_addr_stackframe.ll [new file with mode: 0644]