Support LLVM 22.1.0, but 4 CFL cases cannot pass. (maybe no need to pass)#1811
Open
bjjwwang wants to merge 1 commit intoSVF-tools:masterfrom
Open
Support LLVM 22.1.0, but 4 CFL cases cannot pass. (maybe no need to pass)#1811bjjwwang wants to merge 1 commit intoSVF-tools:masterfrom
bjjwwang wants to merge 1 commit intoSVF-tools:masterfrom
Conversation
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).
Collaborator
|
It looks quite good. Could you check the cases of field-sensitive Andersen analysis? I remember 1-2 cases will fail if we treat the first field as base. But we could turn off/on this option in the test-suite's cmakelist to pass those tests. |
Collaborator
|
Let us ignore the 4 CFL cases for now and make sure all other tests can pass. Please also add a few AE tests for loop/recursion and array handling (in case the codecov decreases) |
Contributor
Author
sure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapt SVF to build against LLVM 22, following ideas from PR #1685.
Default -ff-eq-base true
TODO: