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
6361–6362

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

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

sext?

48

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.