[llvm] [DAGCombiner][LegalizeTypes] Fuse i128 sdiv+srem / udiv+urem into single __divmodti4 / __udivmodti4 call (PR #187908)

Takashi Idobe via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 22 16:21:55 PDT 2026


================
@@ -0,0 +1,71 @@
+; 64-bit targets: fused __divmodti4 / __udivmodti4
+; RUN: %if x86-registered-target         %{ llc < %s -mtriple=x86_64-linux-gnu              | FileCheck %s --check-prefixes=CHECK,FUSED %}
+; RUN: %if x86-registered-target         %{ llc < %s -mtriple=x86_64-linux-gnux32           | FileCheck %s --check-prefixes=CHECK,FUSED %}
+; RUN: %if x86-registered-target         %{ llc < %s -mtriple=x86_64-pc-windows-msvc        | FileCheck %s --check-prefixes=CHECK,FUSED %}
----------------
Takashiidobe wrote:

Yup, it does. I didn't implement this so I added a Win64 target to the tests. I used mingw gcc as a reference. 

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


More information about the llvm-commits mailing list