[PATCH] D97440: [LegalizeTypes] Improve ExpandIntRes_XMULO codegen.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 22:17:36 PST 2021
craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, efriedma.
Herald added subscribers: jrtc27, fedor.sergeev, hiraditya, nemanjai, jyknight.
craig.topper requested review of this revision.
Herald added a project: LLVM.
The code previously used two BUILD_PAIRs to concatenate the two UMULO
results with 0s in the lower bits to match original VT. Then it created
an ADD and a UADDO with the original bit width. Each of those operations
need to be expanded since they have illegal types.
Since we put 0s in the lower bits before the ADD, the lower half of the
ADD result will be 0. So the lower half of the UADDO result is
solely determined by the other operand. Since the UADDO need to
be split in half, we don't really needd an operation for the lower
bits. Unfortunately, we don't see that in type legalization and end up
creating a split SETCC to legalize the UADDO. DAG combine or
lowering isn't always able to recover it.
This patch directly generates the narrower ADD and UADDO to avoid
needing to legalize them. Now only the MUL is done on the original
type.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D97440
Files:
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/AArch64/umulo-128-legalisation-lowering.ll
llvm/test/CodeGen/AArch64/vec_umulo.ll
llvm/test/CodeGen/PowerPC/pr45448.ll
llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll
llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97440.326285.patch
Type: text/x-patch
Size: 29220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210225/5e075b5c/attachment.bin>
More information about the llvm-commits
mailing list