[LegalizeTypes] Add a simple expansion for SMULO when a libcall isn't available.
authorCraig Topper <craig.topper@sifive.com>
Fri, 6 Aug 2021 16:31:05 +0000 (09:31 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 6 Aug 2021 16:43:01 +0000 (09:43 -0700)
commitb2ca4dc935859b324fd7e9ca804160913a7468a5
treef9266f3dd6969344aaf31e39b8617938d925d39a
parent77e8f4eeeeed516a1c79365a4b8128da463d96c4
[LegalizeTypes] Add a simple expansion for SMULO when a libcall isn't available.

This isn't optimal, but prevents crashing when the libcall isn't
available. It just calculates the full product and makes sure the high bits
match the sign of the low half. Each of the pieces should go through their own
type legalization.

This can make D107420 unnecessary.

Needs tests, but I wanted to start discussion about D107420.

Reviewed By: FreddyYe

Differential Revision: https://reviews.llvm.org/D107581
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/smulo-128-legalisation-lowering.ll [new file with mode: 0644]