[PATCH] D95035: [GlobalISel] LegalizerHelper - Extract widenScalarAddoSubo method

Cassie Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 04:55:03 PST 2021


porglezomp created this revision.
porglezomp added reviewers: paquette, aemerson.
Herald added subscribers: hiraditya, kristof.beyls, rovka.
porglezomp requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The widenScalar implementation for signed and unsigned overflowing
operations were very similar: both are checked by truncating the result
and then re-sign/zero-extending it and checking that it matches the
computed operation.

Using a truncate + zero-extend for the unsigned case instead of manually
producing the AND instruction like before leads to an extra copy
instruction during legalization, but this should be harmless.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95035

Files:
  llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95035.317842.patch
Type: text/x-patch
Size: 6862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210120/7d92c756/attachment.bin>


More information about the llvm-commits mailing list