This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Lower multiplication by a negative constant to shl+sub+shl
ClosedPublic

Authored by Allen on Sep 29 2022, 7:46 PM.

Details

Summary

Change the costmodel to lower a = b * C where C = -(2^n - 2^m) to

lsl     w8, w0, m
sub     w0, w8, w0, lsl n

Diff Detail

Event Timeline

Allen created this revision.Sep 29 2022, 7:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2022, 7:46 PM
Allen requested review of this revision.Sep 29 2022, 7:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2022, 7:46 PM
efriedma accepted this revision.Sep 30 2022, 1:22 PM

LGTM

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
14836

Fix line wrapping?

This revision is now accepted and ready to land.Sep 30 2022, 1:22 PM
Allen updated this revision to Diff 464495.Oct 1 2022, 6:16 AM

Fix line wrapping

Allen marked an inline comment as done.Oct 1 2022, 6:17 AM
Allen added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
14836

Done, thanks

This revision was landed with ongoing or failed builds.Oct 1 2022, 6:29 AM
This revision was automatically updated to reflect the committed changes.
Allen marked an inline comment as done.