This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ::TTI] Return zero cost for a load / store connected with a scalar bswap
ClosedPublic

Authored by jonpa on Nov 24 2018, 7:52 AM.

Details

Reviewers
uweigand
Summary

Since byte-swapping loads and stores are supported, a loop containing a load -> bswap or bswap -> store should have the cost reduced by 1 for each such pair.

Since the Instruction pointer is available in getMemoryOpCost() this is the place this search is done to detect these cases. Perhaps the 0 cost should have belonged to the bswap intrinsic, but it is not possible to handle both cases in getIntrinsicInstrCost() as only the arguments are available.

This is NFC on SPEC while ~20 loops get their scalar costs corrected without affecting any vectorizer decisions.

Diff Detail

Event Timeline

jonpa created this revision.Nov 24 2018, 7:52 AM
uweigand accepted this revision.Nov 27 2018, 11:13 AM

LGTM, thanks!

This revision is now accepted and ready to land.Nov 27 2018, 11:13 AM
jonpa closed this revision.Nov 27 2018, 11:57 PM

r347732