This is an archive of the discontinued LLVM Phabricator instance.

PowerPC: CTR shouldn't fire if a TLS call is in the loop
ClosedPublic

Authored by majnemer on Dec 27 2014, 1:11 AM.

Details

Summary

Determining the address of a TLS variable results in a function call in
certain TLS models. This means that a simple ICmpInst might actually
result in invalidating the CTR register.

In such cases, do not attempt to rely on the CTR register for loop
optimization purposes.

This fixes PR22034.

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 17644.Dec 27 2014, 1:11 AM
majnemer retitled this revision from to PowerPC: CTR shouldn't fire if a TLS call is in the loop.
majnemer updated this object.
majnemer added a reviewer: hfinkel.
majnemer added a subscriber: Unknown Object (MLST).
hfinkel accepted this revision.Dec 27 2014, 5:03 AM
hfinkel edited edge metadata.

LGTM, thanks!

lib/Target/PowerPC/PPCCTRLoops.cpp
207 ↗(On Diff #17644)

Please add a comment here explaining that determining the address of a TLS variable results in a function call in these TLS models.

This revision is now accepted and ready to land.Dec 27 2014, 5:03 AM
This revision was automatically updated to reflect the committed changes.