This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Partially port tryShiftAmountMod from AArch64ISelDAGToDAG
Needs ReviewPublic

Authored by paquette on Sep 14 2020, 4:41 PM.

Details

Reviewers
aemerson
Summary

This ports the AND case from AArch64DAGToDAGISel::tryShiftAmountMod.

This allows us to fold a G_AND into a G_LSHR/G_ASHR/G_SHL. This is possible when the G_AND is against a constant with all ones in the low bits checked by a variable shift instruction.

Diff Detail

Event Timeline

paquette created this revision.Sep 14 2020, 4:41 PM
paquette requested review of this revision.Sep 14 2020, 4:41 PM
aemerson added inline comments.Sep 15 2020, 1:58 PM
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
1702

Use getConstantVRegValWithLookthrough?