[llvm] RuntimeLibcalls: Mostly move x86 configuration into tablegen (PR #148575)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 16 06:04:05 PDT 2025


mstorsjo wrote:

This miscompiles for 32 bit x86 for MSVC targets. This is reproducible with https://martin.st/temp/avcodec-preproc.c as input.

```console
$ clang --target=i686-windows-msvc -S avcodec-preproc.c -o out.s -O2
```

This change causes the following diff in the generated code:

```diff
--- out-good.s  2025-07-16 16:02:51.333780818 +0300
+++ out-bad.s   2025-07-16 16:03:00.851790884 +0300
@@ -790,6 +790,7 @@
        pushl   $2147483647                     # imm = 0x7FFFFFFF
        pushl   $-1
        calll   __alldiv
+       addl    $16, %esp
        movl    %eax, (%esp)                    # 4-byte Spill
        movl    %edx, %ecx
        movl    %ebx, %eax
```
(Plus a couple more similar cases.)

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


More information about the llvm-commits mailing list