[PATCH] D107581: [LegalizeTypes] Add a simple expansion for SMULO when a libcall isn't available.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 20:29:38 PDT 2021


craig.topper added a comment.

In D107581#2930184 <https://reviews.llvm.org/D107581#2930184>, @FreddyYe wrote:

> I haven't taken a look into gcc's generated code. Do you think gcc implements i256 signed mul overflow check in this same way? Hope you know...

I'm not sure if gcc can generate an i256 overflow check. But I can tell you the i128 code this patch generates does not match gcc. gcc checks whether the upper half of the inputs matches the sign of the lower half and dispatches to 4 different cases. There are two cases where one input is large and one is small that share the same code by commuting the inputs. SelectionDAG can't create branches so it's difficult to do exactly the same thing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107581



More information about the llvm-commits mailing list