[PATCH] D99283: [GlobalISel] Combine and (lshr x, cst), mask -> ubfx x, cst, width

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 17:55:51 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp:282-285
+  // Only legal for s32 and s64.
+  LLT Ty = MRI.getType(Dst);
+  if (Ty != LLT::scalar(32) && Ty != LLT::scalar(64))
+    return false;
----------------
paquette wrote:
> arsenm wrote:
> > This is the only target specific thing here which can be replaced with a legality check on UBFX
> The annoying part (for AArch64) is that the legality checks don't work with custom legalization.
> 
> I'm not sure what the best way to handle custom actions is.
That's what we usually end up adding TLI hooks for, although they're terrible


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99283/new/

https://reviews.llvm.org/D99283



More information about the llvm-commits mailing list