This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Use TST for comparisons when possible
ClosedPublic

Authored by paquette on Jul 8 2019, 3:23 PM.

Details

Summary

Porting over the part of emitComparison in AArch64ISelLowering where we use TST to represent a compare.

  • Rename tryOptCMN to tryFoldIntegerCompare, since it now also emits TSTs when possible.
  • Add a utility function for emitting a TST with register operands.
  • Rename opt-fold-cmn.mir to opt-fold-compare.mir, since it now also tests the TST fold as well.

Diff Detail

Repository
rL LLVM

Event Timeline

paquette created this revision.Jul 8 2019, 3:23 PM
aemerson accepted this revision.Jul 8 2019, 3:47 PM

LGTM with comment fix and minor nit.

llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
810 ↗(On Diff #208522)

Can just make this default block return false and kill the return after the switch.

This revision is now accepted and ready to land.Jul 8 2019, 3:47 PM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/Target/AArch64/AArch64InstructionSelector.cpp