This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Fold G_ASHR into TB(N)Z bit calculation
ClosedPublic

Authored by paquette on Feb 3 2020, 3:15 PM.

Details

Summary

This implements walking over G_ASHR in the same way as getTestBitOperand in AArch64ISelLowering.

(tbz (ashr x, c), b) -> (tbz x, b+c) or (tbz x, msb) if b+c is > # bits in x

Diff Detail

Event Timeline

paquette created this revision.Feb 3 2020, 3:15 PM
aemerson accepted this revision.Feb 5 2020, 9:53 AM

LGTM with nit.

llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
1083

Can you factor our these getType() calls here and in the G_SHL case into a variable?

This revision is now accepted and ready to land.Feb 5 2020, 9:53 AM
This revision was automatically updated to reflect the committed changes.