This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ::TTI] Return zero cost for icmp in case of Load-And-Test
ClosedPublic

Authored by jonpa on Nov 30 2018, 2:55 AM.

Details

Reviewers
uweigand
Summary

A loaded value with multiple users compared with 0 will become a load and test single instruction. The load is not folded in this case (multiple users), but the compare instruction is eliminated.

This patch returns 0 cost for the icmp in these cases.

This changes just 33 instruction query results. One file changed on spec - two loops are now are kept scalar (not vectorized), see:

I tried also handling the load i32 ->sext i64 case, but this doubled the LOCs of the patch, while changing absolutely nothing (not a single LV query / file), so this seemed not useful enough to keep.

Diff Detail

Event Timeline

jonpa created this revision.Nov 30 2018, 2:55 AM
uweigand accepted this revision.Dec 3 2018, 5:40 AM

LGTM, thanks!

This revision is now accepted and ready to land.Dec 3 2018, 5:40 AM
jonpa closed this revision.Dec 3 2018, 6:35 AM

r348141