This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Avoid generating 2 XOR instructions for (and (xor x, -1), y)
ClosedPublic

Authored by assem on Jun 24 2016, 11:26 AM.

Details

Summary

Created a pattern to match 64-bit mode (and (xor x, -1), y) to a shorter sequence of instructions.

Before the change, the canonical form is translated to:

xihf    %r3, 4294967295
xilf    %r3, 4294967295
ngr     %r2, %r3

After the change, the canonical form is translated to:

ngr     %r3, %r2
xgr     %r2, %r3

Diff Detail

Repository
rL LLVM

Event Timeline

assem updated this revision to Diff 61796.Jun 24 2016, 11:26 AM
assem retitled this revision from to [SystemZ] Avoid generating 2 XOR instructions for (and (xor x, -1), y).
assem updated this object.
assem added reviewers: zhanjunl, uweigand.
assem updated this object.Jun 24 2016, 11:30 AM
assem added a subscriber: llvm-commits.
uweigand accepted this revision.Jun 27 2016, 6:31 AM
uweigand edited edge metadata.

LGTM, thanks!

This revision is now accepted and ready to land.Jun 27 2016, 6:31 AM
This revision was automatically updated to reflect the committed changes.