Skip to content

Update llvm to 22.1.8 - #16807

Merged
AniLeo merged 2 commits into
RPCS3:masterfrom
Megamouse:llvm20
Jul 26, 2026
Merged

Update llvm to 22.1.8#16807
AniLeo merged 2 commits into
RPCS3:masterfrom
Megamouse:llvm20

Conversation

@Megamouse

@Megamouse Megamouse commented Mar 4, 2025

Copy link
Copy Markdown
Contributor
  • Updates LLVM to 22.1.8

closes #19039

@Megamouse Megamouse added the Build and CI Anything related to the build process and continuous integration label Mar 4, 2025
@Megamouse
Megamouse force-pushed the llvm20 branch 5 times, most recently from 1156c4b to 702fab7 Compare March 10, 2025 20:14
@Megamouse Megamouse changed the title Update llvm to 20.1.0 Update llvm to 20.1.1 Mar 20, 2025
@cipherxof

Copy link
Copy Markdown
Contributor

I'm getting slightly worse performance in LLVM 20 compared to 19, which already had worse AVX512 performance than LLVM 17 (#16733). Tested on a 8945HS.

LLVM 19:

image

LLVM 20:

image

@Megamouse Megamouse changed the title Update llvm to 20.1.1 Update llvm to 20.1.2 Apr 9, 2025
@crashGG

crashGG commented Apr 9, 2025

Copy link
Copy Markdown

But there is no
https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-20.1.2/llvmlibs_mt.7z
So can't build the win64 version to test.
Can anyone help?

@Megamouse

Copy link
Copy Markdown
Contributor Author

There won't be a prebuilt until we decide to merge this.

@Megamouse Megamouse changed the title Update llvm to 20.1.2 Update llvm to 20.1.3 Apr 24, 2025
@Megamouse Megamouse changed the title Update llvm to 20.1.3 Update llvm to 20.1.4 May 14, 2025
@Megamouse Megamouse changed the title Update llvm to 20.1.4 Update llvm to 20.1.5 May 19, 2025
@Megamouse Megamouse changed the title Update llvm to 20.1.5 Update llvm to 20.1.6 May 28, 2025
@Megamouse
Megamouse force-pushed the llvm20 branch 2 times, most recently from 2ace833 to e46d46d Compare June 1, 2025 16:14
@Megamouse Megamouse changed the title Update llvm to 20.1.6 Update llvm to 20.1.7 Jul 3, 2025
@Darkhost1999

Copy link
Copy Markdown
Contributor

Rpcs3_default.props doesn't change from llvm 20.1.7 to 20.1.8.
Are minor performance regressions a stopper for PRs like these?
I thought the goal is to test stability. Performance is allowed to fluctuate a little bit, especially with numbers as high as 120+

@kd-11

kd-11 commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

Rpcs3_default.props doesn't change from llvm 20.1.7 to 20.1.8. Are minor performance regressions a stopper for PRs like these? I thought the goal is to test stability. Performance is allowed to fluctuate a little bit, especially with numbers as high as 120+

It's incremental just like optimizations are. We already had another drop coming from 17 to 19 then 19 to 20. Obviously something is wrong and needs to be identified. Otherwise by the time we reach llvm30 we'll have lost a lot of performance without making any significant code changes in our own code.

When no code changes product side have been made, regressions are a lot more concerning than when our own code is being modified because then we know the pros vs cons. We never commit our own code changes if they do nothing but hurt performance - the amount of experimental code that gets thrown out could probably create another (horrible) PS3 emulator.

In this case we have a change that provides zero pros, just cons, making it not worth the effort. If the cause is identified, we can proceed just to be up to date with the latest version of llvm. Something I am curious about is whether the problem goes away if we use the clang64 windows binaries?

@Megamouse
Megamouse force-pushed the llvm20 branch 2 times, most recently from cab4198 to b2f4494 Compare March 12, 2026 18:15
@Megamouse Megamouse changed the title Update llvm to 22.1.0 Update llvm to 22.1.1 Mar 12, 2026
@Megamouse Megamouse changed the title Update llvm to 22.1.1 Update llvm to 22.1.2 Mar 29, 2026
@Megamouse Megamouse changed the title Update llvm to 22.1.2 Update llvm to 22.1.3 Apr 8, 2026
@cipherxof

Copy link
Copy Markdown
Contributor

Someone had mentioned improved performance on discord, so I figured I would re-check. On my end (/w AVX512), performance still seems to be slightly lower with LLVM 22 vs 19. Although this is a MSVC vs Clang comparison as the CI failed to build for MSVC for this PR.

Master (where this PR is rebased):
Capture2

PR:
Capture

The difference is fairly small, so if non-avx512 machines see a decent speedup then it may be worth merging anyways.

@Darkhost1999

Copy link
Copy Markdown
Contributor

What's the best llvmcpu configuration value to test without avx512 support? Is there a reference file or link to verify the spelling of the enumerator and what options are available inside LLVM?

@cipherxof

Copy link
Copy Markdown
Contributor

What's the best llvmcpu configuration value to test without avx512 support? Is there a reference file or link to verify the spelling of the enumerator and what options are available inside LLVM?

For my machine it would likely be alderlake. I'll test without avx512 later and post the results.

@Megamouse Megamouse changed the title Update llvm to 22.1.3 Update llvm to 22.1.4 Apr 28, 2026
@Megamouse Megamouse changed the title Update llvm to 22.1.4 Update llvm to 22.1.6 May 19, 2026
@Megamouse Megamouse changed the title Update llvm to 22.1.6 Update llvm to 22.1.7 Jun 5, 2026
@AniLeo

AniLeo commented Jul 13, 2026

Copy link
Copy Markdown
Member

I think it's time we go ahead and merge this, since we're lagging quite a bit on LLVM versions, and the newer ones have better arm64 support as discussed internally

@Whatcookie

Copy link
Copy Markdown
Member

Codegen should be better on newer llvm versions for arm64 , but need confirmation that comparability doesn't regress

@schm1dtmac

schm1dtmac commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Also needs a version bump in the macOS scripts, slightly complicated by the fact that Homebrew doesn’t have a version tag for 22 yet (as it’s the latest stable version). I’ll see what can be done there though. Shouldn't be an issue, llvm stable has an alternate name of llvm@22 on brew.

@AniLeo

AniLeo commented Jul 15, 2026

Copy link
Copy Markdown
Member

Unfortunately, all llvm22 versions have broken codegen

Latest working version that can be used is LLVM 21.1.8

I tried 22.1.0, 22.1.6 and 22.1.8 and they're all broken, the easiest repro is to boot RDR and see vertex explosion on the title screen 3D preview

Can't test LLVM release/23.x because our code is not compatible with the new API changes

@Megamouse Megamouse mentioned this pull request Jul 16, 2026
2 tasks
Comment thread .github/workflows/rpcs3.yml Outdated
@RipleyTom

Copy link
Copy Markdown
Contributor

in rpcs3/Emu/CMakeLists.txt:

if(USE_ASAN)
    set_source_files_properties(../../Utilities/Thread.cpp PROPERTIES COMPILE_DEFINITIONS USE_ASAN)
endif()

...

# GCC overemits weak type information when using LTO
# This causes an issue with LLVM 22 which is build without RTTI
# Issue is specifically related to vfs::ProxyFileSystem
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    set_source_files_properties(
        Cell/PPUThread.cpp
        Cell/SPULLVMRecompiler.cpp
        PROPERTIES COMPILE_OPTIONS -fno-lto
    )
endif()

...

if(NOT USE_SYSTEM_OPENAL)
    target_compile_definitions(rpcs3_emu PUBLIC AL_LIBTYPE_STATIC)
endif()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build and CI Anything related to the build process and continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.