This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Fold shifts into G_ICMP
ClosedPublic

Authored by paquette on May 4 2020, 2:08 PM.

Details

Reviewers
aemerson
Summary

Since G_ICMP can be selected to a SUBS, we can fold shifts into such compares.

E.g.

cmp	w1, w0, lsl #3
cmp	w1, w0, lsr #3
cmp	w1, w0, asr #3

This is done the same way as for adds and subtracts, using selectShiftedRegister.

This gives some minor code size savings on CTMark.

Diff Detail

Event Timeline

paquette created this revision.May 4 2020, 2:08 PM
aemerson accepted this revision.May 5 2020, 11:25 AM

LGTM.

This revision is now accepted and ready to land.May 5 2020, 11:25 AM