[PATCH] D136319: [GISel] Rework trunc/shl combine in a generic trunc/shift combine

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 05:28:00 PDT 2022


foad added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h:415
+  ///    if K <= (MidVT.getScalarSizeInBits() - VT.getScalarSizeInBits())
+  /// MidVT is obtained from TLI using getPreferredShiftAmountTy, so the
+  /// trunc/right shift combine is only applied when that returns a type
----------------
Interesting - this seems like an abuse of getPreferredShiftAmountTy, but I guess it works out OK in practice for the one case we care about (converting 64-bit shifts to 32-bit shifts).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136319



More information about the llvm-commits mailing list