[PATCH] D83671: GlobalISel: Implement widenScalar for saturating add/sub
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 06:37:30 PDT 2020
foad 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);
----------------
arsenm wrote:
> 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?
Why would it make any difference? Can't you just pick one arbitrarily?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83671/new/
https://reviews.llvm.org/D83671
More information about the llvm-commits
mailing list