[PATCH] D83671: GlobalISel: Implement widenScalar for saturating add/sub

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 06:36:17 PDT 2020


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1671
+
+  auto Result = IsSigned ? MIRBuilder.buildAShr(WideTy, WideInst, ShiftK)
+                         : MIRBuilder.buildLShr(WideTy, WideInst, ShiftK);
----------------
foad wrote:
> There's no need to make this conditional on IsSigned if we're just about to truncate anyway.
How else would I know whether to prefer ashr or lshr?


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

https://reviews.llvm.org/D83671





More information about the llvm-commits mailing list