This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][DAGCombine] Add pushSignExtendThroughExtractSubvector
AbandonedPublic

Authored by peterwaller-arm on Jul 28 2022, 4:14 AM.

Details

Summary

Eliminate a SIGN_EXTEND_INREG by reifying an anyext.

   (sign_extend_inreg (extract_subvector (anyext v) Idx))
=> (extract_subvector (sign_extend v) Idx)

Depends on D130699.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 4:14 AM

Remove commented code.

peterwaller-arm published this revision for review.Jul 28 2022, 4:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 4:24 AM
  • Update patch for changes to base patch D130698.
paulwalker-arm added inline comments.Jul 28 2022, 8:29 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
15044–15045

Is this necessary? What are you trying to protect against?

15059

SIGN_EXTEND_INREG has a "type" operand that defines the size of the data being extended. You'll need to ensure this matches the element type of data being any extended.

  • Stylistic changes to shrink the code a little.
  • Add check for signext_inreg type.
  • Update tests.

Any reason this couldn't be done generically in DAGCombiner?

Any reason this couldn't be done generically in DAGCombiner?

No reason. We updated the zext variant (D130782) to be a general combine and will do likewise here.

peterwaller-arm planned changes to this revision.Aug 8 2022, 4:39 AM