This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Extend visitAND to include EXTRACT_SUBVECTOR
ClosedPublic

Authored by david-arm on Jul 29 2022, 8:58 AM.

Details

Summary

Eliminate an AND by redefining an anyext|sext|zext.

   (and (extract_subvector (anyext|sext|zext v) _) iN_mask)
=> (extract_subvector (zeroext_iN v))

Diff Detail

Event Timeline

david-arm created this revision.Jul 29 2022, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2022, 8:58 AM
david-arm requested review of this revision.Jul 29 2022, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2022, 8:58 AM
paulwalker-arm accepted this revision.Jul 29 2022, 9:53 AM

A couple of naming issues but otherwise looks good.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
6356–6357

With the enhanced combine the original variable names are not strictly correct.

llvm/test/CodeGen/AArch64/extract-subvec-combine.ll
23

sext?

49

sext?

This revision is now accepted and ready to land.Jul 29 2022, 9:53 AM
This revision was landed with ongoing or failed builds.Aug 1 2022, 2:32 AM
This revision was automatically updated to reflect the committed changes.