← Back to Pull requests

[X86] Add WinCall Calling Convention and x86_64apx-windows(-gnu/-msvc) triplets #215585

Open
trcrsired opened this pull request with 1607 lines diff across 70 files
View on GitHub
trcrsired trcrsired commented on Aug 11, 2026 15:26 UTC
Author

I am proposing a new x86_64 windows calling convention wincall.

See History:
https://developercommunity.visualstudio.com/t/std::span-is-not-zero-cost-because-of-th/1429284

See draft details:
https://github.com/trcrsired/llvm-project/blob/wincall/llvm/docs/WinCall.md

Welcome everyone to review it and give me some feedback, Thanks.

Diff: 1607 lines (+1577 / -30) across 70 files Reviewer: Andarwinux Review duration: 165349m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.79) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.79 · 1607 lines diff across 70 files
0.79
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 5 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
88%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.400
Mass File Touch mass_file_touch
0.080
Real PR Conversation Timeline
37 items
github-actions[bot] github-actions[bot] commented on Aug 11, 2026 15:28 UTC
Bot

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````

git-clang-format --diff origin/main HEAD --extensions cpp,c,h -- clang/test/CIR/CodeGen/wincall.c clang/test/CodeGen/X86/wincall-abi.c clang/test/CodeGen/X86/wincall-abi2.c clang/test/CodeGen/X86/wincall-msabi.c clang/test/CodeGen/X86/wincall-sysv.c clang/test/CodeGen/X86/wincall-uefi.c clang/test/CodeGen/wincall.c clang/test/CodeGenCXX/wincall-mangle.cpp clang/test/Driver/wincall-x86_64apx.c clang/test/Sema/callingconv-wincall.c clang/include/clang-c/Index.h clang/include/clang/Basic/LangOptions.h clang/include/clang/Basic/Specifiers.h clang/lib/AST/ASTContext.cpp clang/lib/AST/Expr.cpp clang/lib/AST/ItaniumMangle.cpp clang/lib/AST/Mangle.cpp clang/lib/AST/MicrosoftMangle.cpp clang/lib/AST/Type.cpp clang/lib/AST/TypePrinter.cpp clang/lib/Basic/Targets.cpp clang/lib/Basic/Targets/X86.cpp clang/lib/Basic/Targets/X86.h clang/lib/CIR/CodeGen/CIRGenModule.cpp clang/lib/CIR/CodeGen/CIRGenTypes.cpp clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/Targets/X86.cpp clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Driver/ToolChains/MSVC.cpp clang/lib/Driver/ToolChains/MinGW.cpp clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseDeclCXX.cpp clang/lib/Parse/ParseTentative.cpp clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaLambda.cpp clang/lib/Sema/SemaType.cpp clang/test/Preprocessor/init-x86.c clang/tools/libclang/CXType.cpp llvm/include/llvm/AsmParser/LLToken.h llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h llvm/include/llvm/IR/CallingConv.h llvm/include/llvm/TargetParser/Triple.h llvm/lib/AsmParser/LLLexer.cpp llvm/lib/AsmParser/LLParser.cpp llvm/lib/IR/AsmWriter.cpp llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp llvm/lib/Target/X86/X86RegisterInfo.cpp llvm/lib/Target/X86/X86Subtarget.cpp llvm/lib/Target/X86/X86Subtarget.h llvm/lib/Target/X86/X86TargetMachine.cpp llvm/lib/TargetParser/Triple.cpp llvm/unittests/TargetParser/TripleTest.cpp --diff_from_common_commit
``

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``
diff --git a/clang/lib/CodeGen/Targets/X86.cpp b/clang/lib/CodeGen/Targets/X86.cpp
index 24e7bb7bd..e0437e202 100644
--- a/clang/lib/CodeGen/Targets/X86.cpp
+++ b/clang/lib/CodeGen/Targets/X86.cpp
@@ -3632,8 +3632,7 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
         bool IsScalarFP =
             FieldTy->isFloatingType() && !FieldTy->isComplexType();
         if (IsScalarFP && FieldLLTy->isFloatingPointTy() &&
-            getContext().getTypeSize(Ty) ==
-                getContext().getTypeSize(FieldTy))
+            getContext().getTypeSize(Ty) == getContext().getTypeSize(FieldTy))
           return ABIArgInfo::getDirect(FieldLLTy);
       }
     }
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index 2cf7f812b..f7f80812a 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/lib/Target/X86/X86TargetMachine.cpp
@@ -238,11 +238,12 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const {
 
   // The WinCall calling convention (x86_wincallcc) passes the fifth and later
   // integer arguments in the APX extended GPRs R16-R19. A function therefore
-  // needs the egpr feature when it either uses WinCall itself or calls a WinCall
-  // function, because the backend sizes its physical register tables from
-  // X86RegisterInfo::getNumSupportedRegs(), which only covers R16-R19 when egpr
-  // is enabled. The frontend accepts `wincall` on any x86-64 target, so this
-  // cannot be left to the triple the way the x86_64apx sub-architecture does.
+  // needs the egpr feature when it either uses WinCall itself or calls a
+  // WinCall function, because the backend sizes its physical register tables
+  // from X86RegisterInfo::getNumSupportedRegs(), which only covers R16-R19 when
+  // egpr is enabled. The frontend accepts `wincall` on any x86-64 target, so
+  // this cannot be left to the triple the way the x86_64apx sub-architecture
+  // does.
   bool NeedsWinCallEGPR = F.getCallingConv() == CallingConv::X86_WinCall;
   if (!NeedsWinCallEGPR)
     for (const BasicBlock &BB : F) {

``````

</details>

Andarwinux Andarwinux commented on Aug 11, 2026 15:57 UTC
Contributor

1. APX (EVEX) also implies AVX512, which means all instructions are expected VEX/EVEX encoded. Can we eliminate the use of vzeroupper under WinCall based on this?
Also, based assumptions of AVX512, can we make better use of ZMM and ZMM16-31 in WinCall Calling Convention? I think i128/i256/i512 can all be passed via XMM/YMM/ZMM rather than GPR.

2. long double need to be clarified: MSVC long double is f64, while GNU long double is f80.
I think the new ABI should unify MSVC/GNU long double to f64 to truly get rid of x87.

3. complex-type scalar and vector arguments should also be passed via XMM/YMM/ZMM.

trcrsired trcrsired commented on Aug 11, 2026 16:34 UTC
Author

1. APX (EVEX) also implies AVX512, which means all instructions are expected VEX/EVEX encoded. Can we eliminate the use of vzeroupper under WinCall based on this?

Also, based assumptions of AVX512, can we make better use of ZMM and ZMM16-31 in WinCall Calling Convention? I think i128/i256/i512 can all be passed via XMM/YMM/ZMM rather than GPR.

2. long double need to be clarified: MSVC long double is f64, while GNU long double is f80.

I think the new ABI should unify MSVC/GNU long double to f64 to truly get rid of x87.

3. complex-type scalar and vector arguments should also be passed via XMM/YMM/ZMM.

good ideas. i will feed into ai to let it check whether they would cause inconsistency

Andarwinux Andarwinux commented on Aug 11, 2026 17:41 UTC
Contributor

There are also some suitable defines for x86_64apx-windows triple:

1. unwindv3 shall be the only supported version.
2. ~~cfguard,ehguard and cetcompat shall be default.~~
3. the stack must always remain 64-byte aligned. This would be very helpful for gcc, since gcc still cannot support AVX512 on Windows correctly due to 16-byte stack alignment.
4. for libcxx, shall LIBCXX_ABI_VERSION default to 2?
5. due to more GPR available, shall -fno-omit-frame-pointer be default?

trcrsired trcrsired commented on Aug 11, 2026 18:18 UTC
Author

2. long double need to be clarified: MSVC long double is f64, while GNU long double is f80.

I think the new ABI should unify MSVC/GNU long double to f64 to truly get rid of x87.

Would it break abi?

Andarwinux Andarwinux commented on Aug 11, 2026 18:26 UTC
Contributor

> 2. long double need to be clarified: MSVC long double is f64, while GNU long double is f80.

> I think the new ABI should unify MSVC/GNU long double to f64 to truly get rid of x87.

> Would it break abi?

Obviously yes, but hasn't x86_64apx-windows already defined a new ABI? By the way, recent mingw-w64 already supports -mlong-double-64.

Since Windows API doesn't support f80, and long double isn't very common, I think it's reasonable to break the long double ABI.

trcrsired trcrsired commented on Aug 11, 2026 18:28 UTC
Author

i

> > 2. long double need to be clarified: MSVC long double is f64, while GNU long double is f80.

> > I think the new ABI should unify MSVC/GNU long double to f64 to truly get rid of x87.

>

>

> Would it break abi?

> Obviously yes, but hasn't x86_64apx-windows already defined a new ABI? By the way, recent mingw-w64 already supports -mlong-double-64.

> Since Windows API doesn't support f80, and long double isn't very common, I think it's reasonable to break the long double ABI.

but what libstdc++-6.dll? wouldn't it use long double in iostream operator<<>>?

Andarwinux Andarwinux commented on Aug 11, 2026 18:34 UTC
Contributor

but what libstdc++-6.dll? wouldn't it use long double in iostream operator<<>>?

Should x86_64apx-windows-gnu users use a full x86_64apx-windows-gnu toolchain? If yes, long double will work normally since libstdc++ is also built with -mlong-double-64.

trcrsired trcrsired commented on Aug 11, 2026 18:37 UTC
Author

> but what libstdc++-6.dll? wouldn't it use long double in iostream operator<<>>?

> Should x86_64apx-windows-gnu users use a full x86_64apx-windows-gnu toolchain? If yes, long double will work normally since libstdc++ is also built with -mlong-double-64.

looks like we need standard library devs to do their work. better ask @jwakely on this

github-actions[bot] github-actions[bot] commented on Aug 11, 2026 18:40 UTC
Bot

<!--PREMERGE ADVISOR COMMENT: Linux-->

:penguin: Linux x64 Test Results

161868 tests passed
2328 tests skipped

  • 1 test failed
  • Failed Tests


    (click on a test name to see its output)

    Clang


    <details>
    <summary>Clang.CodeGen/X86/wincall-uefi.c</summary>

    Exit Code: 1
    
    Command Output (stdout):
    --
    # RUN: at line 1
    /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # note: command had no output on stdout or stderr
    # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # note: command had no output on stdout or stderr
    # RUN: at line 2
    /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple x86_64apx-unknown-uefi -O2 -mframe-pointer=all -o - -S /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=FRAME /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple x86_64apx-unknown-uefi -O2 -mframe-pointer=all -o - -S /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # note: command had no output on stdout or stderr
    # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=FRAME /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # note: command had no output on stdout or stderr
    # RUN: at line 3
    /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=SEH /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # note: command had no output on stdout or stderr
    # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=SEH /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # .---command stderr------------
    # | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c:30:9: error: SEH: expected string not found in input
    # | // SEH: !llvm.module.flags = !{!0}
    # |         ^
    # | <stdin>:1:1: note: scanning from here
    # | ; ModuleID = '/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c'
    # | ^
    # | <stdin>:60:1: note: possible intended match here
    # | !llvm.module.flags = !{!2, !3}
    # | ^
    # | 
    # | Input file: <stdin>
    # | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c
    # | 
    # | -dump-input=help explains the following input dump.
    # | 
    # | Input was:
    # | <<<<<<
    # |             1: ; ModuleID = '/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c' 
    # | check:30'0    {                                                                                                                search range start (exclusive)
    # | check:30'1                                                                                                                     error: no match found in search range
    # |             2: source_filename = "/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/wincall-uefi.c" 
    # |             3: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 
    # |             4: target triple = "x86_64apx-unknown-uefi" 
    # |             5:  
    # |             6: ; Function Attrs: noinline nounwind optnone 
    # |             .
    # |             .
    # |             .
    # |            55:  
    # |            56: attributes #0 = { noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+avx,+avx2,+avx512f,+ccmp,+crc32,+cx8,+egpr,+f16c,+fma,+jmpabs,+mmx,+ndd,+nf,+popcnt,+ppx,+push2pop2,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+zu" } 
    # |            57: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+avx,+avx2,+avx512f,+ccmp,+crc32,+cx8,+egpr,+f16c,+fma,+jmpabs,+mmx,+ndd,+nf,+popcnt,+ppx,+push2pop2,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+zu" } 
    # |            58:  
    # |            59: !llvm.dbg.cu = !{!0} 
    # |            60: !llvm.module.flags = !{!2, !3} 
    # | check:30'2     ?                                possible intended match
    # |            61: !llvm.ident = !{!4} 
    # |            62:  
    # |            63: !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 24.0.0git (https://github.com/llvm/llvm-project 8d3ae96615bc72de06a5338df6608454dbdbed05)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, splitDebugInlining: false, nameTableKind: None) 
    # |            64: !1 = !DIFile(filename: "/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/X86/<stdin>", directory: "") 
    # |            65: !2 = !{i32 2, !"Debug Info Version", i32 3} 
    # |            66: !3 = !{i32 2, !"winx64-eh-unwind", i32 3} 
    # |            67: !4 = !{!"clang version 24.0.0git (https://github.com/llvm/llvm-project 8d3ae96615bc72de06a5338df6608454dbdbed05)"} 
    # | check:30'3                                                                                                                        } search range end (exclusive)
    # | >>>>>>
    # `-----------------------------
    # error: command failed with exit status: 1
    
    --
    
    

    </details>

    If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

    trcrsired trcrsired commented on Aug 11, 2026 18:43 UTC
    Author

    There are also some suitable defines for x86_64apx-windows triple:

    > 1. unwindv3 shall be the only supported version.

    2. cfguard,ehguard and cetcompat shall be default.

    3. the stack must always remain 64-byte aligned. This would be very helpful for gcc, since gcc still cannot support AVX512 on Windows correctly due to 16-byte stack alignment.

    4. for libcxx, shall LIBCXX_ABI_VERSION default to 2?

    5. due to more GPR available, shall -fno-omit-frame-pointer be default?

    I have several questions.
    1. what is unwindv3?
    2. What's the point of making cfguard,ehguard and cetcompat default. Would they cause performance or other issues?

    Andarwinux Andarwinux commented on Aug 11, 2026 19:00 UTC
    Contributor

    1. what is unwindv3?

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

    https://learn.microsoft.com/en-us/cpp/build/x64-unwind-information-v3?view=msvc-170

    https://www.linkedin.com/pulse/x86-64-unwind-v3-here-pedro-miguel-sequeira-de-justo-teixeira-wkrpc/

    This is required by APX, but by default, unwindv3 is only issued when EGPR is actually used, which is meaningless for x86_64apx-windows.

    2\. What's the point of making cfguard,ehguard and cetcompat default. Would they cause performance or other issues?

    These are unrelated to APX, but given all APX CPUs necessarily support CET, making it default provides a meaningful way to enhance the security baseline for the new ABI - especially since the performance overhead is negligible and it helps mitigate some speculative vulnerabilities.

    or other issues?

    CET might be problematic for older binaries, but since all x86_64apx-windows code will be rebuilt, this is no longer an issue.

    trcrsired trcrsired commented on Aug 11, 2026 19:04 UTC
    Author

    * the stack must always remain 64-byte aligned. This would be very helpful for gcc, since gcc still cannot support AVX512 on Windows correctly due to 16-byte stack alignment.

    I think these CFGs protections still cause very high performance overhead. better just wait for x86 memory tagging instead

    trcrsired trcrsired commented on Aug 11, 2026 19:15 UTC
    Author

    5. due to more GPR available, shall -fno-omit-frame-pointer be default?

    i think this is very bad. more GPR available does not mean certain programs are not going to need all of them. One more register is crucial for some programs. We should never waste any register.

    i have added all the compiler side changes you want to add except the -fno-omit-frame-pointer. One register cost is huge tbh

    Andarwinux Andarwinux commented on Aug 11, 2026 19:31 UTC
    Contributor

    i think this is very bad. more GPR available does not mean certain programs are not going to need all of them. One more register is crucial for some programs. We should never waste any register.

    > i have added all the compiler side changes you want to add except the -fno-omit-frame-pointer. One register cost is huge tbh

    Microsoft actually enforced this for arm64:

    https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#stack-walking

    Code within Windows is compiled with frame pointers enabled (/Oy-) to enable fast stack walking. Generally, x29 (fp) points to the next link in the chain, which is an {fp, lr} pair, indicating the pointer to the previous frame on the stack and the return address. Third-party code is encouraged to enable frame pointers as well, to allow for improved profiling and tracing.

    https://github.com/llvm/llvm-project/pull/147354 [win][aarch64] Always reserve frame pointers for Arm64 Windows

    I don't really have an opinion on this, but Microsoft might want to keep frame pointers in the new ABI.

    trcrsired trcrsired commented on Aug 11, 2026 19:35 UTC
    Author

    > i think this is very bad. more GPR available does not mean certain programs are not going to need all of them. One more register is crucial for some programs. We should never waste any register.

    > i have added all the compiler side changes you want to add except the -fno-omit-frame-pointer. One register cost is huge tbh

    > Microsoft actually enforced this for arm64:

    > https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#stack-walking

    > > Code within Windows is compiled with frame pointers enabled (/Oy-) to enable fast stack walking. Generally, x29 (fp) points to the next link in the chain, which is an {fp, lr} pair, indicating the pointer to the previous frame on the stack and the return address. Third-party code is encouraged to enable frame pointers as well, to allow for improved profiling and tracing.

    > #147354 [win][aarch64] Always reserve frame pointers for Arm64 Windows

    > I don't really have an opinion on this, but Microsoft might want to keep frame pointers in the new ABI.

    we do not need fast stack walking since i am also implementing herbceptions which will replace current C++ exceptions. on aarch64, they only encourage not enforce. So it is not a problem. you can use it in your code if you want

    Andarwinux Andarwinux commented on Aug 11, 2026 19:39 UTC
    Contributor

    i have added all the compiler side changes you want to add except the -fno-omit-frame-pointer.

    What do you think about pass i128/i256/i512 (_BitInt) arguments via XMM/YMM/ZMM?

    x86 backend can lower basic i128/i256/i512 arithmetic to AVX512, so doing so can reduce some GPR<->FPU overhead. (i128 multiplication may be an exception)

    see https://github.com/llvm/llvm-project/issues/163955

    Andarwinux Andarwinux commented on code on Aug 11, 2026 19:43 UTC
    Code Review
    clang/lib/Basic/Targets/X86.cpp:1
    @@ -164,6 +164,9 @@ bool X86TargetInfo::initFeatureMap(
         for (const char *Sub :
              {"egpr", "push2pop2", "ppx", "ndd", "ccmp", "nf", "zu", "jmpabs"})
           setFeatureEnabled(Features, Sub, true);
    +    // APX (EVEX) implies AVX-512, and WinCall expects every instruction to be
    +    // EVEX-encoded so that no vzeroupper is needed at WinCall boundaries.
    +    setFeatureEnabled(Features, "avx512f", true);

    That's not enough - need VLX at least. Maybe could request AVX10.2?

    Andarwinux Andarwinux commented on code on Aug 11, 2026 19:45 UTC
    Code Review
    clang/lib/Basic/Targets/X86.cpp:1
    @@ -164,6 +164,9 @@ bool X86TargetInfo::initFeatureMap(
         for (const char *Sub :
              {"egpr", "push2pop2", "ppx", "ndd", "ccmp", "nf", "zu", "jmpabs"})
           setFeatureEnabled(Features, Sub, true);
    +    // APX (EVEX) implies AVX-512, and WinCall expects every instruction to be
    +    // EVEX-encoded so that no vzeroupper is needed at WinCall boundaries.
    +    setFeatureEnabled(Features, "avx512f", true);

    This may need coordination with x86 EAG, but as things stand, all CPUs that support APX will likely support AVX10.2.

    trcrsired trcrsired commented on code on Aug 11, 2026 19:47 UTC
    Code Review
    clang/lib/Basic/Targets/X86.cpp:1
    @@ -164,6 +164,9 @@ bool X86TargetInfo::initFeatureMap(
         for (const char *Sub :
              {"egpr", "push2pop2", "ppx", "ndd", "ccmp", "nf", "zu", "jmpabs"})
           setFeatureEnabled(Features, Sub, true);
    +    // APX (EVEX) implies AVX-512, and WinCall expects every instruction to be
    +    // EVEX-encoded so that no vzeroupper is needed at WinCall boundaries.
    +    setFeatureEnabled(Features, "avx512f", true);

    "What do you think about pass i128/i256/i512 (_BitInt) arguments via XMM/YMM/ZMM?"

    Very bad. we should avoid floating point registers as much as possible. Many kernels have strict rules on banning floating point registers. Plus fp registers can have latency issues and others. Always just use GPRs before using MM registers.

    Andarwinux Andarwinux commented on code on Aug 11, 2026 19:55 UTC
    Code Review
    clang/lib/Basic/Targets/X86.cpp:1
    @@ -164,6 +164,9 @@ bool X86TargetInfo::initFeatureMap(
         for (const char *Sub :
              {"egpr", "push2pop2", "ppx", "ndd", "ccmp", "nf", "zu", "jmpabs"})
           setFeatureEnabled(Features, Sub, true);
    +    // APX (EVEX) implies AVX-512, and WinCall expects every instruction to be
    +    // EVEX-encoded so that no vzeroupper is needed at WinCall boundaries.
    +    setFeatureEnabled(Features, "avx512f", true);

    Additionally personally, when defining the ISA baseline for x86_64apx or "x86-64-v5", include GFNI and VPCLMULDQ will be useful for improving vector bitwise operations lowering, see previous GFNI vXi8 and pext/pdep work.

    https://github.com/llvm/llvm-project/pull/215231#issuecomment-5238798831

    Andarwinux Andarwinux commented on code on Aug 11, 2026 19:58 UTC
    Code Review
    clang/lib/Basic/Targets/X86.cpp:1
    @@ -164,6 +164,9 @@ bool X86TargetInfo::initFeatureMap(
         for (const char *Sub :
              {"egpr", "push2pop2", "ppx", "ndd", "ccmp", "nf", "zu", "jmpabs"})
           setFeatureEnabled(Features, Sub, true);
    +    // APX (EVEX) implies AVX-512, and WinCall expects every instruction to be
    +    // EVEX-encoded so that no vzeroupper is needed at WinCall boundaries.
    +    setFeatureEnabled(Features, "avx512f", true);

    Very bad. we should avoid floating point registers as much as possible. Many kernels have strict rules on banning floating point registers. Plus fp registers can have latency issues and others. Always just use GPRs before using MM registers.

    On recent AVX-512 CPUs, ZMM instructions no longer cause throttling as they did in the past.

    Many kernels have strict rules on banning floating point registers.

    I thought x86_64apx is a usermode-only ABI?

    trcrsired trcrsired commented on code on Aug 11, 2026 20:04 UTC
    Code Review
    clang/lib/Basic/Targets/X86.cpp:1
    @@ -164,6 +164,9 @@ bool X86TargetInfo::initFeatureMap(
         for (const char *Sub :
              {"egpr", "push2pop2", "ppx", "ndd", "ccmp", "nf", "zu", "jmpabs"})
           setFeatureEnabled(Features, Sub, true);
    +    // APX (EVEX) implies AVX-512, and WinCall expects every instruction to be
    +    // EVEX-encoded so that no vzeroupper is needed at WinCall boundaries.
    +    setFeatureEnabled(Features, "avx512f", true);

    > Very bad. we should avoid floating point registers as much as possible. Many kernels have strict rules on banning floating point registers. Plus fp registers can have latency issues and others. Always just use GPRs before using MM registers.

    > On recent AVX-512 CPUs, ZMM instructions no longer cause throttling as they did in the past.

    > > Many kernels have strict rules on banning floating point registers.

    > I thought x86_64apx is a usermode-only ABI?

    not a usermode-only abi. it should apply to uefi, cygwin/msys, win kernel etc too i think. but i haven't yet finished it. plus other x86_64 os may use the calling convention too in some specific windows related code such as limine bootloader

    Andarwinux Andarwinux commented on code on Aug 11, 2026 20:10 UTC
    Code Review
    llvm/docs/WinCall.md:1
    @@ -0,0 +1,454 @@
    +# The WinCall Calling Convention Draft
    +
    +## What WinCall is
    +
    +WinCall is an x86-64 **calling convention for Windows targets**. It is
    +spelled ``x86_wincallcc`` in LLVM IR and corresponds to
    +``CallingConv::X86_WinCall`` (CC ID 128).
    +
    +Its purpose is to exploit the 16 additional general-purpose registers
    +(R16-R31) introduced by Intel APX. On a conventional Windows x64 ABI only
    +four integer arguments can be passed in registers; WinCall doubles that to
    +eight by using R16-R19 as argument registers. It also relaxes the aggregate
    +passing and return rules of the Microsoft x64 ABI so that C++ types such as
    +``std::span`` (a ``{pointer, size}`` pair) and other small aggregates can
    +travel in registers.
    +
    +WinCall does **not** replace any existing ABI. Existing Windows APIs keep
    +their ``stdcall``, ``cdecl`` and ``fastcall`` conventions; the convention is
    +opt-in and only affects code that is explicitly built for it.
    +
    +## When WinCall is used
    +
    +WinCall applies in two situations:
    +
    +1. It is the **default calling convention** of the ``x86_64apx-windows-msvc``
    +   and ``x86_64apx-windows-gnu`` target triples
    +   (``X86_64TargetInfo::getDefaultCallingConv`` returns ``CC_WinCall`` for
    +   ``getTriple().isWindowsAPX()``).
    +
    +2. It can be selected per-function with the ``wincall`` attribute
    +   (``__attribute__((wincall))``, ``__wincall``, ``_wincall``), which maps to
    +   ``CC_WinCall`` in the frontend.
    +
    +WinCall is **x86-64 only**. On 32-bit x86 or on any non-x86 target the
    +attribute is ignored with a warning
    +(``X86TargetInfo::checkCallingConvention`` does not accept it there).
    +
    +## The x86_64apx sub-architecture
    +
    +The ``x86_64apx`` triple component is a *sub-architecture* of ``x86_64``,
    +modelled on how ``arm64ec`` is a sub-architecture of ``aarch64``:

    https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types

    Since arm64ec has different PE/COFF machine types, should we define a new one for x86_64apx as well?

    trcrsired trcrsired commented on code on Aug 11, 2026 20:18 UTC
    Code Review
    llvm/docs/WinCall.md:1
    @@ -0,0 +1,454 @@
    +# The WinCall Calling Convention Draft
    +
    +## What WinCall is
    +
    +WinCall is an x86-64 **calling convention for Windows targets**. It is
    +spelled ``x86_wincallcc`` in LLVM IR and corresponds to
    +``CallingConv::X86_WinCall`` (CC ID 128).
    +
    +Its purpose is to exploit the 16 additional general-purpose registers
    +(R16-R31) introduced by Intel APX. On a conventional Windows x64 ABI only
    +four integer arguments can be passed in registers; WinCall doubles that to
    +eight by using R16-R19 as argument registers. It also relaxes the aggregate
    +passing and return rules of the Microsoft x64 ABI so that C++ types such as
    +``std::span`` (a ``{pointer, size}`` pair) and other small aggregates can
    +travel in registers.
    +
    +WinCall does **not** replace any existing ABI. Existing Windows APIs keep
    +their ``stdcall``, ``cdecl`` and ``fastcall`` conventions; the convention is
    +opt-in and only affects code that is explicitly built for it.
    +
    +## When WinCall is used
    +
    +WinCall applies in two situations:
    +
    +1. It is the **default calling convention** of the ``x86_64apx-windows-msvc``
    +   and ``x86_64apx-windows-gnu`` target triples
    +   (``X86_64TargetInfo::getDefaultCallingConv`` returns ``CC_WinCall`` for
    +   ``getTriple().isWindowsAPX()``).
    +
    +2. It can be selected per-function with the ``wincall`` attribute
    +   (``__attribute__((wincall))``, ``__wincall``, ``_wincall``), which maps to
    +   ``CC_WinCall`` in the frontend.
    +
    +WinCall is **x86-64 only**. On 32-bit x86 or on any non-x86 target the
    +attribute is ignored with a warning
    +(``X86TargetInfo::checkCallingConvention`` does not accept it there).
    +
    +## The x86_64apx sub-architecture
    +
    +The ``x86_64apx`` triple component is a *sub-architecture* of ``x86_64``,
    +modelled on how ``arm64ec`` is a sub-architecture of ``aarch64``:

    https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types

    > Since arm64ec has different PE/COFF machine types, should we define a new one for x86_64apx as well?

    i think no. x86_64apx is just x86_64 with better calling convention. arm64ec is pretty useless in reality

    Andarwinux Andarwinux commented on Aug 11, 2026 20:19 UTC
    Contributor

    To get more visibility, it’s best to create an RFC at https://discourse.llvm.org/

    trcrsired trcrsired commented on code on Aug 11, 2026 20:21 UTC
    Code Review
    llvm/docs/WinCall.md:1
    @@ -0,0 +1,454 @@
    +# The WinCall Calling Convention Draft
    +
    +## What WinCall is
    +
    +WinCall is an x86-64 **calling convention for Windows targets**. It is
    +spelled ``x86_wincallcc`` in LLVM IR and corresponds to
    +``CallingConv::X86_WinCall`` (CC ID 128).
    +
    +Its purpose is to exploit the 16 additional general-purpose registers
    +(R16-R31) introduced by Intel APX. On a conventional Windows x64 ABI only
    +four integer arguments can be passed in registers; WinCall doubles that to
    +eight by using R16-R19 as argument registers. It also relaxes the aggregate
    +passing and return rules of the Microsoft x64 ABI so that C++ types such as
    +``std::span`` (a ``{pointer, size}`` pair) and other small aggregates can
    +travel in registers.
    +
    +WinCall does **not** replace any existing ABI. Existing Windows APIs keep
    +their ``stdcall``, ``cdecl`` and ``fastcall`` conventions; the convention is
    +opt-in and only affects code that is explicitly built for it.
    +
    +## When WinCall is used
    +
    +WinCall applies in two situations:
    +
    +1. It is the **default calling convention** of the ``x86_64apx-windows-msvc``
    +   and ``x86_64apx-windows-gnu`` target triples
    +   (``X86_64TargetInfo::getDefaultCallingConv`` returns ``CC_WinCall`` for
    +   ``getTriple().isWindowsAPX()``).
    +
    +2. It can be selected per-function with the ``wincall`` attribute
    +   (``__attribute__((wincall))``, ``__wincall``, ``_wincall``), which maps to
    +   ``CC_WinCall`` in the frontend.
    +
    +WinCall is **x86-64 only**. On 32-bit x86 or on any non-x86 target the
    +attribute is ignored with a warning
    +(``X86TargetInfo::checkCallingConvention`` does not accept it there).
    +
    +## The x86_64apx sub-architecture
    +
    +The ``x86_64apx`` triple component is a *sub-architecture* of ``x86_64``,
    +modelled on how ``arm64ec`` is a sub-architecture of ``aarch64``:

    https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types

    > Since arm64ec has different PE/COFF machine types, should we define a new one for x86_64apx as well?

    the entire arm64ec, arm64x are just hot mess. arm64ec is a terrible mistake

    trcrsired trcrsired commented on code on Aug 12, 2026 05:36 UTC
    Code Review
    llvm/docs/WinCall.md:1
    @@ -0,0 +1,454 @@
    +# The WinCall Calling Convention Draft
    +
    +## What WinCall is
    +
    +WinCall is an x86-64 **calling convention for Windows targets**. It is
    +spelled ``x86_wincallcc`` in LLVM IR and corresponds to
    +``CallingConv::X86_WinCall`` (CC ID 128).
    +
    +Its purpose is to exploit the 16 additional general-purpose registers
    +(R16-R31) introduced by Intel APX. On a conventional Windows x64 ABI only
    +four integer arguments can be passed in registers; WinCall doubles that to
    +eight by using R16-R19 as argument registers. It also relaxes the aggregate
    +passing and return rules of the Microsoft x64 ABI so that C++ types such as
    +``std::span`` (a ``{pointer, size}`` pair) and other small aggregates can
    +travel in registers.
    +
    +WinCall does **not** replace any existing ABI. Existing Windows APIs keep
    +their ``stdcall``, ``cdecl`` and ``fastcall`` conventions; the convention is
    +opt-in and only affects code that is explicitly built for it.
    +
    +## When WinCall is used
    +
    +WinCall applies in two situations:
    +
    +1. It is the **default calling convention** of the ``x86_64apx-windows-msvc``
    +   and ``x86_64apx-windows-gnu`` target triples
    +   (``X86_64TargetInfo::getDefaultCallingConv`` returns ``CC_WinCall`` for
    +   ``getTriple().isWindowsAPX()``).
    +
    +2. It can be selected per-function with the ``wincall`` attribute
    +   (``__attribute__((wincall))``, ``__wincall``, ``_wincall``), which maps to
    +   ``CC_WinCall`` in the frontend.
    +
    +WinCall is **x86-64 only**. On 32-bit x86 or on any non-x86 target the
    +attribute is ignored with a warning
    +(``X86TargetInfo::checkCallingConvention`` does not accept it there).
    +
    +## The x86_64apx sub-architecture
    +
    +The ``x86_64apx`` triple component is a *sub-architecture* of ``x86_64``,
    +modelled on how ``arm64ec`` is a sub-architecture of ``aarch64``:

    the wincall is supposed to be compatible with existing as much as possible. Adding new header is completely far away from the goal

    void2012 void2012 commented on Aug 12, 2026 07:30 UTC
    Contributor

    Does x86 (32-bit) have a similar problem? I recall things like std::string_view weren't optimized properly due to the calling convention, too.

    trcrsired trcrsired commented on Aug 12, 2026 07:46 UTC
    Author

    Does x86 (32-bit) have a similar problem? I recall things like std::string_view weren't optimized properly due to the calling convention, too.

    no

    Andarwinux Andarwinux commented on Aug 12, 2026 07:49 UTC
    Contributor

    As far as I know, APX is only supported in 64-bit long mode.

    trcrsired trcrsired commented on Aug 12, 2026 07:59 UTC
    Author

    Does x86 (32-bit) have a similar problem? I recall things like std::string_view weren't optimized properly due to the calling convention, too.

    Well. Technically the nuance is that on i686 (aka 32 bit windows) windows has stdcall and fastcall and they are different.

    but neither case if i remember correctly would cause a std::span to be passed/returned differently from a pointer + size combo. Because the size is 8 which satisifies the 1,2,4,8 size requirement. but on x86_64 they did not expand it to 16 cause issues like this, plus the rdx is no longer used for returning even 32bit uses edx for the 2nd parameter.

    WinCall is trying to fix issues like this too.

    However, if i rememebered correctly 32 bit windows has some other minor issues.

    void2012 void2012 commented on Aug 12, 2026 08:35 UTC
    Contributor

    I think on 32-bit x86 there was a mregparm=3, can something like this be introduced on x64 or does this draft cc defeat the purpose of such parameters

    trcrsired trcrsired commented on Aug 13, 2026 01:06 UTC
    Author

    I think on 32-bit x86 there was a mregparm=3, can something like this be introduced on x64 or does this draft cc defeat the purpose of such parameters

    wincall should not do anything to i686 but only x86_64

    github-actions[bot] github-actions[bot] commented on Aug 25, 2026 16:05 UTC
    Bot

    <!--PREMERGE ADVISOR COMMENT: Windows-->

    :window: Windows x64 Test Results

    148928 tests passed
    2301 tests skipped

  • 1 test failed
  • Failed Tests


    (click on a test name to see its output)

    Clang


    <details>
    <summary>Clang.CodeGen/X86/wincall-uefi.c</summary>

    Exit Code: 1
    
    Command Output (stdout):
    --
    # RUN: at line 1
    c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c
    # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # note: command had no output on stdout or stderr
    # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # note: command had no output on stdout or stderr
    # RUN: at line 2
    c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple x86_64apx-unknown-uefi -O2 -mframe-pointer=all -o - -S C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=FRAME C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c
    # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple x86_64apx-unknown-uefi -O2 -mframe-pointer=all -o - -S 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # note: command had no output on stdout or stderr
    # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=FRAME 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # note: command had no output on stdout or stderr
    # RUN: at line 3
    c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=SEH C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c
    # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple x86_64apx-unknown-uefi -o - -emit-llvm 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # note: command had no output on stdout or stderr
    # executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=SEH 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # .---command stderr------------
    # | C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c:30:9: error: SEH: expected string not found in input
    # | // SEH: !llvm.module.flags = !{!0}
    # |         ^
    # | <stdin>:1:1: note: scanning from here
    # | ; ModuleID = 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c'
    # | ^
    # | <stdin>:60:1: note: possible intended match here
    # | !llvm.module.flags = !{!2, !3}
    # | ^
    # | 
    # | Input file: <stdin>
    # | Check file: C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c
    # | 
    # | -dump-input=help explains the following input dump.
    # | 
    # | Input was:
    # | <<<<<<
    # |             1: ; ModuleID = 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\X86\wincall-uefi.c' 
    # | check:30'0    {                                                                                          search range start (exclusive)
    # | check:30'1                                                                                               error: no match found in search range
    # |             2: source_filename = "C:\\_work\\llvm-project\\llvm-project\\clang\\test\\CodeGen\\X86\\wincall-uefi.c" 
    # |             3: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 
    # |             4: target triple = "x86_64apx-unknown-uefi" 
    # |             5:  
    # |             6: ; Function Attrs: noinline nounwind optnone 
    # |             .
    # |             .
    # |             .
    # |            55:  
    # |            56: attributes #0 = { noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+avx,+avx2,+avx512f,+ccmp,+crc32,+cx8,+egpr,+f16c,+fma,+jmpabs,+mmx,+ndd,+nf,+popcnt,+ppx,+push2pop2,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+zu" } 
    # |            57: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+avx,+avx2,+avx512f,+ccmp,+crc32,+cx8,+egpr,+f16c,+fma,+jmpabs,+mmx,+ndd,+nf,+popcnt,+ppx,+push2pop2,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+zu" } 
    # |            58:  
    # |            59: !llvm.dbg.cu = !{!0} 
    # |            60: !llvm.module.flags = !{!2, !3} 
    # | check:30'2     ?                                possible intended match
    # |            61: !llvm.ident = !{!4} 
    # |            62:  
    # |            63: !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 24.0.0git (https://github.com/llvm/llvm-project 8d3ae96615bc72de06a5338df6608454dbdbed05)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, splitDebugInlining: false, nameTableKind: None) 
    # |            64: !1 = !DIFile(filename: "C:\\_work\\llvm-project\\llvm-project\\clang\\test\\CodeGen\\X86\\<stdin>", directory: "") 
    # |            65: !2 = !{i32 2, !"Debug Info Version", i32 3} 
    # |            66: !3 = !{i32 2, !"winx64-eh-unwind", i32 3} 
    # |            67: !4 = !{!"clang version 24.0.0git (https://github.com/llvm/llvm-project 8d3ae96615bc72de06a5338df6608454dbdbed05)"} 
    # | check:30'3                                                                                                                        } search range end (exclusive)
    # | >>>>>>
    # `-----------------------------
    # error: command failed with exit status: 1
    
    --
    
    

    </details>

    If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

    trcrsired trcrsired commented on Aug 25, 2026 23:22 UTC
    Author

    As far as I know, APX is only supported in 64-bit long mode.

    That is the whole point. You get support when you buy new hardware. Or it confuses the user.

    Reviewers
    Assignees
    trcrsired trcrsired
    Labels
    risk: low confidence: 88.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 78.5% (HIGH) · Higher = larger blast radius
    78.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88.6% · Lower = rushed or shallow review
    88.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8.9% · Safe to merge
    8.9%