This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Support conditional indirect sibling calls via BCR.
ClosedPublic

Authored by koriakin on Apr 9 2016, 8:01 AM.

Details

Summary

This adds a conditional variant of CallBR instruction, CallBCR. Also,
it can be fused with integer comparisons, resulting in one of the new
C*BCall instructions.

In addition to CallBRCL limitations, this has another one: it won't trigger
if the function to call isn't already in %r1 - see f22 in the test for
an example (it's also why the loads in tests are volatile).

Diff Detail

Repository
rL LLVM

Event Timeline

koriakin retitled this revision from to [SystemZ] Support conditional indirect sibling calls via BCR..
koriakin updated this object.
koriakin added a reviewer: uweigand.
koriakin set the repository for this revision to rL LLVM.
koriakin added a subscriber: llvm-commits.
uweigand accepted this revision.Apr 11 2016, 5:15 AM
uweigand edited edge metadata.

It would be nice if the optimization applied in more cases. (On the other hand, we don't want to move too many operations out of the conditional block into the unconditional block either, in case the condition holds true only rarely ...)

In any case, it's good to apply the patch, even if it triggers only in a couple of cases.

Patch LGTM, I'll check it in.

This revision is now accepted and ready to land.Apr 11 2016, 5:15 AM
This revision was automatically updated to reflect the committed changes.