HomePhabricator

[PowerPC] Recurse through constants when looking for TLS globals
Partially AuditedrL251582

Description

[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.

Details

Auditors
tstellarAMD
llvm-commits
Group Auditors
Restricted Project
Committed
hfinkelOct 28 2015, 4:43 PM
Parents
rL251581: Remove an unused local variable
Branches
Unknown
Tags
Unknown

Event Timeline

hfinkel added auditors: Restricted Project, llvm-commits, tstellarAMD.Nov 2 2015, 7:45 AM

This patch should be safe for the release branch, and fixes a bug in the PPC backend not difficult to hit in practice if you're using TLS and compiling with -fPIC.

tstellarAMD added a subscriber: tstellarAMD.

LGTM, go ahead and merge it.