OSDN Git Service

[PowerPC] fix potential verification error on __tls_get_addr
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Thu, 29 Jun 2017 14:13:38 +0000 (14:13 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Thu, 29 Jun 2017 14:13:38 +0000 (14:13 +0000)
commit16d661a030cd869b049524422584dcabf89fdfb2
treee26cff87f4649598505816f10c1ee76878a1968c
parentf2469c0fac8b15e6cc1ee01e0dfdc7a226d9eb31
[PowerPC] fix potential verification error on __tls_get_addr

This patch fixes a verification error with -verify-machineinstrs while expanding __tls_get_addr by not creating ADJCALLSTACKUP and ADJCALLSTACKDOWN if there is another ADJCALLSTACKUP in this basic block since nesting ADJCALLSTACKUP/ADJCALLSTACKDOWN is not allowed.

Here, ADJCALLSTACKUP and ADJCALLSTACKDOWN are created as a fence for instruction scheduling to avoid _tls_get_addr is scheduled before mflr in the prologue (https://bugs.llvm.org//show_bug.cgi?id=25839). So if another ADJCALLSTACKUP exists before _tls_get_addr, we do not need to create a new ADJCALLSTACKUP.

Differential Revision: https://reviews.llvm.org/D34347

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306678 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPC.h
lib/Target/PowerPC/PPCTLSDynamicCall.cpp
lib/Target/PowerPC/PPCTargetMachine.cpp
test/CodeGen/PowerPC/tls_get_addr_fence1.mir [new file with mode: 0644]
test/CodeGen/PowerPC/tls_get_addr_fence2.mir [new file with mode: 0644]