Added support for LLVM 20.1.0 and fix .editorconfig glob pattern for Vim#1685
Added support for LLVM 20.1.0 and fix .editorconfig glob pattern for Vim#1685bsdb0y wants to merge 16 commits intoSVF-tools:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1685 +/- ##
=======================================
Coverage 63.59% 63.59%
=======================================
Files 244 244
Lines 25736 25736
Branches 4508 4508
=======================================
Hits 16366 16366
Misses 9370 9370
🚀 New features to boost your workflow:
|
|
Thanks for your contribution. It would be good to support a more stable version of LLVM.20.1.0. Could you also change the buid.sh for the CI to trigger the build of svf on top of new LLVM here? Line 26 in 1f7fcb8 |
|
done, in the build.sh I have added 20.1.0 as stable. |
Looks like brew install llvm@20 is not available. It might need a few iterations to update the build.sh and github actions to fix these configuration errors. |
Tested with LLVM 19.1.7 - compilation is working fine. Let me know if anything else is required on my end. root@e857b7fe3f28:~/SVF# cat /etc/os-release
PRETTY_NAME="Ubuntu Plucky Puffin (development branch)"
NAME="Ubuntu"
VERSION_ID="25.04"
VERSION="25.04 (Plucky Puffin)"
VERSION_CODENAME=plucky
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=plucky
LOGO=ubuntu-logo |
Could you then update the build.sh and github action? |
On Mac OS - Sequoia 15.3.2: $ brew list --versions llvm@20 && clang --version && llvm-config --version && uname -a && sw_vers && xcodebuild -version
llvm 20.1.1
clang version 20.0.0git (https://github.com/llvm/llvm-project.git 2e30df740ef0b9f8edb7075768540ce08678023d)
Target: arm64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /usr/local/bin
20.0.0git
Darwin test-2.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64
ProductName: macOS
ProductVersion: 15.3.2
BuildVersion: 24D81
Xcode 16.2
Build version 16C5032a |
build.sh:
GitHub Actions:
currently, trying |
|
Currently, the tests are failing because the Test-Suite still has old Could you help me figure out how to run |
|
I get errors during linking of svf-llvm. I'm building with llvm 19.1.4 See bsdb0y@df92120 |
|
@yuleisui It updates the test suite to be compatible with LLVM 20 and ensures all tests run correctly. Merging it first will help us get accurate test results here. |
Could you clean up your pull request in test-suite? There are lots of svf.svf.bc files and pre.bc files committed. Please make sure the commit is clean with mimum changes. |
Thank you for pointing that out! I had pushed the precompiled .bc files as we are using them, but I mistakenly forgot to clean up the .pre. and *.svf.bc files. I've already made the suggested changes and cleaned up the pull request to ensure it includes only the relevant files. Please let me know if there’s anything else I can do or adjust to make it merge. |
thank you so much @van-ema for testing it on macOS. I have added a check for OS detection to |
|
@yuleisui could you please approve the latest commit so we can confirm whether it's failing or success? It’s working perfectly on my end, I tested it locally on both Ubuntu and macOS, even using the act tool to simulate GitHub Actions. I’m happy to integrate this work if everything works out. Let me know if you need anything from my side! |
@yuleisui I can see from the GitHub Actions that the code is compiling successfully on both environments, but the tests are failing. That’s because this PR (SVF-tools/Test-Suite#156) still needs to be reviewed, approved, and merged. Once that happens, it should fetch the latest test cases that are compatible with LLVM 20. |
@yuleisui could kindly merge this request. It seems the testcases that are failing are from the Test-Suite. |
@bernardnongpoh thanks for your contributions. I have left comments in test-suite as the bc files are auto generated using scripts configured by github actions, they are not supposed to be part of the pull request. |
Adapt SVF to build against LLVM 22, following ideas from PR SVF-tools#1685. Build/setup: - build.sh: bump MajorLLVMVer 18 -> 22, point Linux tarballs at bjjwwang/SVF-LLVM 22.1.0 releases (x86_64 and aarch64). - setup.sh: LLVM_DIR -> llvm-22.1.0.obj. LLVM 22 API migration: - BasicTypes.h: guard removed Atomic{Mem,MemSet,MemTransfer,MemCpy, MemMove}Intrinsic and MemCpyInlineInst typedefs under LLVM_VERSION_MAJOR < 22. - LLVMUtil.h: getDataLayout() now returns const DataLayout* via Module::getDataLayout() on LLVM >= 22 (DataLayout(Module*) removed). - LLVMModule.cpp: replace StringRef::equals() with operator== (4 sites). - LLVMUtil.cpp: use findDVRDeclares + DbgVariableRecord on LLVM >= 22 (findDbgDeclares signature changed). - SVFIRBuilder.cpp: adapt computeGepOffset to const DataLayout*. - svf-ex.cpp: skip llvm_shutdown() on LLVM >= 22. Semantic fixes for new clang codegen: - Options.cpp: default FirstFieldEqBase to true. LLVM 22 clang more often emits opaque-pointer GEPs that collapse base and first field; keeping them equivalent avoids spurious NOALIAS/false positives. - AEDetector.cpp: handle BaseObjVar in updateGepObjOffsetFromBase so GEP results that fold to the base under ff-eq-base are treated as offset 0 instead of asserting. - PointerAnalysisImpl.cpp: skip base->fields expansion in expandFIObjs when FirstFieldEqBase is on, preserving the equivalence. - SVFIRBuilder.cpp (InitialGlobal): detect [N x i8] padding fields in anonymous literal struct initializers and skip them so logical field indices stay aligned with access-side GEPs. Test results on Test-Suite (Debug-build ctest, -j 1): 92% passed, 1720/1879. Remaining 159 failures are 155 ae_semi_sparse (upstream incomplete feature) and 4 cfl_tests on one arraycopy1.c.bc file (pre-existing CFL grammar limitation, not LLVM 22 related).
No description provided.