[llvm] [SelectionDAG] Respect no-builtins attribute in SMULO expansion (PR #191020)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 13:38:53 PDT 2026


arsenm wrote:

I'm not sure this is actually what "no-builtins" is supposed to mean. This whole system is a mess. We have 2 library call systems existing in parallel. Middle end optimizations have always used TargetLibraryInfo, which "no-builtins" applies to. This is entirely separate from RuntimeLibcallInfo, which codegen uses. It's not obvious that any of these modifiers should apply to codegen (e.g., there have been complaints when nobuiltin/no-builtins have been applied to other runtime calls)

> This prevents infinite recursion when a custom implementation of __muloti4 (under a different name) is compiled with no-builtins, as the overflow intrinsic introduced by instcombine would otherwise be lowered back to a call to __muloti4.

Can you elaborate further on this? I don't understand the problem. If you write your own __muloti4 and it gets replaced with the call to the usual __muloti4, what's the problem?

https://github.com/llvm/llvm-project/pull/191020


More information about the llvm-commits mailing list