[PowerPC] Recurse through constants when looking for TLS globals
authorHal Finkel <hfinkel@anl.gov>
Wed, 28 Oct 2015 23:43:00 +0000 (23:43 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 28 Oct 2015 23:43:00 +0000 (23:43 +0000)
commitb93a3a175715cc408c0567310bde80cbf54bb389
tree3642380e0675edaa8219cc579bfa934e21193a04
parent75c3afbe05d88b759010d0740bb17af0209c3287
[PowerPC] Recurse through constants when looking for TLS globals

We cannot form ctr-based loops around function calls, including calls to
__tls_get_addr used for PIC TLS variables. References to such TLS variables,
however, might be buried within constant expressions, and so we need to search
the entire constant expression to be sure that no references to such TLS
variables exist.

Fixes PR25256, reported by Eric Schweitz. This is a slightly-modified version
of the patch suggested by Eric in the bug report, and a test case I created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251582 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCCTRLoops.cpp
test/CodeGen/PowerPC/ctr-loop-tls-const.ll [new file with mode: 0644]