Skip to content

Port SVF to LLVM 21#1815

Merged
yuleisui merged 4 commits intoSVF-tools:masterfrom
cjsrxzdyzds:llvm21-port-slim
Apr 30, 2026
Merged

Port SVF to LLVM 21#1815
yuleisui merged 4 commits intoSVF-tools:masterfrom
cjsrxzdyzds:llvm21-port-slim

Conversation

@cjsrxzdyzds
Copy link
Copy Markdown
Contributor

@cjsrxzdyzds cjsrxzdyzds commented Apr 29, 2026

Summary

Ports SVF to LLVM 21 and restores full Test-Suite parity on a clean LLVM 21 host. Supersedes the now-closed #1813 with a simplified diff (18 → 4 commits, 18 → 12 files, +759/-247 → +333/-37).

Commits

34153b67 Handle LLVM 21 byte-layout memcpy in SVFIRExtAPI
46e9a345 Handle LLVM 21 opaque-pointer array accesses in SVFIRBuilder
eefcc703 Port svf-llvm to LLVM 21
7908f205 Bump shared LLVM toolchain to 21.1.0

What's in each

  1. 7908f205 — Toolchain bump. Dockerfile / build.sh / setup.sh point at LLVM 21.1.0 prebuilts. (See note below on the prebuilt URL host.)
  2. eefcc703 — svf-llvm API port. Mechanical only: StringRef::equals → ==, DataLayout(Module*) → Module::getDataLayout(), CloneFunctionInto parent-attachment fix (build clone detached, attach via getFunctionList().push_back() afterwards — LLVM 21 requires the destination to be parentless or share the source's parent module while cloning), header includes that LLVM 21 no longer pulls in transitively, and a scoped -Wno-maybe-uninitialized for a known GCC false positive in LLVMModule.cpp. No analysis behavior changes.
  3. 46e9a345 — Opaque-pointer array accesses in SVFIRBuilder. LLVM 21 emits pointer-array initialisation/access in three shapes that pre-21 IR never produced:
    • one-index pointer GEPs into an inferred [K x ptr] base (gep ptr, ptr %arr, i64 0 collapses to a copy edge),
    • byte-offset GEPs into globals (StructLayout walk to recover the pointed field),
    • direct loads/stores through the array base with no GEP at all (store ptr %v, ptr %arr for element zero — synthesised field-zero GEP value when the pointer operand is an inferred [K x ptr] and the access type matches the pointer element type).
      Also includes a guarded memcpy-derived base-recovery fallback for the canonical funptr-nested-struct shape: only fires when the loaded pointer comes from an alloca whose only relevant initialiser is a memcpy in the same basic block, the copy covers the loaded field, the destination is the alloca, the length is constant, and there is no intervening write between memcpy and load.
  4. 34153b67 — Byte-layout memcpy in SVFIRExtAPI. Opaque-pointer memcpy/memmove walks source/destination by byte offset using the inferred object type plus DataLayout, re-deriving the field-level constraints that pre-21 element-typed memcpy carried implicitly.

Notes

Supersedes #1813. The branch was originally named llvm21-llvmmodule-lto-safety because an earlier draft included LTO-related helper extraction; that work was dropped per @yuleisui's review and the branch is now correctly named llvm21-port-slim to reflect the actual scope.

Update Dockerfile, build.sh, and setup.sh to point at LLVM 21.1.0
prebuilt artifacts. The dyn_lib/RTTI default path on Ubuntu (x86_64
and aarch64) now resolves to the 21.1.0 RTTI tarballs; the source-
only fallback URL is also retained for non-Ubuntu hosts.
Adapt the svf-llvm bridge to LLVM 21's API surface while keeping
existing semantics intact. Touches only build glue, headers, and
mechanical API call sites; no analysis behavior changes.

* BasicTypes.h / LLVMUtil.h: include the headers LLVM 21 no longer
  pulls in transitively, and update signatures whose argument or
  return types changed.
* LLVMModule.cpp: replace removed StringRef::equals with operator==,
  switch DataLayout(Module*) construction to Module::getDataLayout(),
  and detach the CloneFunctionInto destination function before cloning
  (LLVM 21 requires the destination to be parentless or share the
  source's parent module). The cloned function is reattached to the
  app module via getFunctionList().push_back() afterwards. The
  UnifyFunctionExitNodesPass include path moved on LLVM 17+.
* LLVMUtil.cpp / svf-ex.cpp: minor signature alignment and an
  llvm_shutdown guard.
* svf-llvm/CMakeLists.txt: bump the supported LLVM major to 21 and
  add a scoped -Wno-maybe-uninitialized for a known GCC false
  positive in LLVMModule.cpp.
LLVM 21's opaque-pointer IR loses the destination element type at
the GEP/load/store level, so pointer-array initialisation and access
are emitted in three shapes that pre-21 IR never exhibited. Each
shape needs explicit modelling in SVFIRBuilder:

1. One-index pointer-typed GEPs into an inferred [K x ptr] base.
   visitGetElementPtrInst now emits a copy edge for the constant-zero
   case (gep ptr, ptr %arr, i64 0) and falls through to the normal
   array-element path for non-zero indices.

2. Byte-offset GEPs into globals. computeGepOffset walks the
   StructLayout of the inferred object type plus the DataLayout
   stride to recover the pointed field for accesses that LLVM 21
   collapses to flat i8/byte offsets.

3. Direct loads/stores through the array base with no GEP at all.
   Under -model-arrays=true, LLVM 21 emits the first element of an
   array initialiser as `store ptr %v, ptr %arr` (no GEP for index
   zero). A new helper synthesises a field-zero GEP value when the
   pointer operand is an inferred [K x ptr], the access type matches
   the element pointer type, and the operand is not already a GEP,
   so the access lands on field object base_0 instead of the base
   object.

A guarded memcpy-derived base-recovery fallback is also added for
the canonical funptr-nested-struct shape, where LLVM 21 lowers a
nested struct copy to a byte-layout memcpy and the loaded function
pointer would otherwise read an empty points-to set. The fallback
only fires when the loaded pointer comes from an alloca whose only
relevant initialiser is a memcpy in the same basic block, the copy
covers the loaded field, the destination is the alloca, the length
is a constant, and there is no intervening write between the memcpy
and the load. The CallBase iteration also guards arg_size() before
indexing argument operands. Anything more complex falls back to the
ordinary loaded value.
memcpy/memmove under LLVM 21 opaque pointers no longer carries a
destination element type, so the prior addComplexConsForExt logic
that walked source/destination by element index falls back to a
single base-to-base copy and drops field-level constraints.

This commit re-derives the field constraints by walking the byte
layout of the inferred source and destination object types using
the module DataLayout. For each byte offset within the copy length
the routine resolves the source field, the destination field, and
emits the corresponding copy edge. Aggregate types are recursed
into via StructLayout; arrays use the element stride.

When the inferred type is a single pointer or simple scalar the
routine collapses to the original single-edge behaviour, so
non-aggregate memcpy patterns are unchanged.
@cjsrxzdyzds
Copy link
Copy Markdown
Contributor Author

build.sh lines 28 and 30 currently point the prebuilt LLVM 21.1.0 RTTI tarballs at github.com/bjjwwang/SVF-LLVM/releases/.... generic_download_file does not checksum the artifact, so the default Ubuntu dyn_lib build path depends on a personal-account release. Would you prefer to host the LLVM 21.1.0 RTTI tarballs under SVF-tools/SVF (the way SVF-3.2 did) so the URLs can point at the org?

@cjsrxzdyzds cjsrxzdyzds mentioned this pull request Apr 29, 2026
@yuleisui
Copy link
Copy Markdown
Collaborator

build.sh lines 28 and 30 currently point the prebuilt LLVM 21.1.0 RTTI tarballs at github.com/bjjwwang/SVF-LLVM/releases/.... generic_download_file does not checksum the artifact, so the default Ubuntu dyn_lib build path depends on a personal-account release. Would you prefer to host the LLVM 21.1.0 RTTI tarballs under SVF-tools/SVF (the way SVF-3.2 did) so the URLs can point at the org?

We could use bjjwwang for now and later it could change the rtti under SVF-3.3.

@bjjwwang
Copy link
Copy Markdown
Contributor

--- /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/zstd.llvm18.stats 2026-04-30 15:39:57.469848646 +1000
+++ /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/zstd.llvm21.stats 2026-04-30 15:39:57.470683400 +1000
@@ -1,29 +1,29 @@
################ (program : zstd.bc)###############
-AddrsNum 31465
+AddrsNum 31463
CallsNum 3109
ConstArrayObj 5
ConstStructObj 0
ConstantObj 0
-CopysNum 20014
-FIObjNum 1394
+CopysNum 20040
+FIObjNum 1392
FSObjNum 29313
-FunctionObjs 1302
-GepsNum 39015
+FunctionObjs 1300
+GepsNum 38985
GlobalObjs 23
HeapObjs 38
IndCallSites 136
LoadsNum 119413
MaxStructSize 257
-NonPtrObj 18982
+NonPtrObj 18980
ReturnsNum 8712
StackObjs 29344
StoresNum 53343
TotalCallSite 12540
-TotalFieldObjects 2435
-TotalObjects 33143
-TotalPTASVFStmts 152629
-TotalPointers 397790
-TotalSVFStmts 354626
+TotalFieldObjects 2414
+TotalObjects 33120
+TotalPTASVFStmts 152627
+TotalPointers 369570
+TotalSVFStmts 354702
VarArrayObj 138
VarStructObj 600
----------------Time and memory stats--------------------
@@ -34,24 +34,24 @@
MaxNodeInCycle 4
NodeInCycle 13
TotalCycle 4
-TotalEdge 13119
-TotalNode 1302
+TotalEdge 13054
+TotalNode 1300
#######################################################
################ (program : zstd.bc)###############
----------------Time and memory stats--------------------
-AvgPtsSetSize 5.08104
-AvgTopLvlPtsSize 14.6536
-MemoryUsageVmrss 479272
-MemoryUsageVmsize 478452
+AvgPtsSetSize 5.23075
+AvgTopLvlPtsSize 14.1071
+MemoryUsageVmrss 465096
+MemoryUsageVmsize 464304
----------------Numbers stats----------------------------
-AddrProcessed 31465
-CopyProcessed 157786
+AddrProcessed 31463
+CopyProcessed 151938
DummyFieldPtrs 754
-FieldObjs 2435
-GepProcessed 58227
+FieldObjs 2414
+GepProcessed 56577
IndCallSites 136
-IndEdgeSolved 713
-LoadProcessed 191869
+IndEdgeSolved 648
+LoadProcessed 185209
LocalVarInRecur 129
MaxInAddrEdge 1
MaxInCopyEdge 667
@@ -59,49 +59,49 @@
MaxInStoreEdge 29
MaxNodesInSCC 241
MaxOutAddrEdge 759
-MaxOutCopyEdge 4567
+MaxOutCopyEdge 4369
MaxOutLoadEdge 209
MaxOutStoreEdge 1782
-MaxPtsSetSize 81
-MemObjects 33143
+MaxPtsSetSize 60
+MemObjects 33120
NodesInCycles 7438
-NullPointer 2640
-NumOfAddrs 31208
-NumOfCGEdge 197167
-NumOfCGNode 156720
-NumOfCopys 87088
+NullPointer 3219
+NumOfAddrs 31206
+NumOfCGEdge 196713
+NumOfCGNode 156695
+NumOfCopys 86664
NumOfFieldExpand 0
-NumOfGeps 35714
+NumOfGeps 35684
NumOfLoads 56613
NumOfSCCDetect 7
NumOfSFRs 0
NumOfStores 17752
-NumOfValidNode 155850
-NumOfValidObjNode 31656
-Pointers 397790
+NumOfValidNode 155846
+NumOfValidObjNode 31654
+Pointers 369570
PointsToBlkPtr 0
-PointsToConstPtr 14947
+PointsToConstPtr 14404
SolveIterations 7
StoreProcessed 33251
TotalCycleNum 789
-TotalObjects 33143
+TotalObjects 33120
TotalPWCCycleNum 198
-TotalPointers 397790
+TotalPointers 369570
#######################################################
################ (program : zstd.bc)###############
-UniquePointsToSets 34951
-TotalUnions 263421
-PropertyUnions 155289
-UniqueUnions 1669
-LookupUnions 103308
-PreemptiveUnions 3155
-TotalComplements 1114577
-PropertyComplements 1024898
+UniquePointsToSets 34928
+TotalUnions 255879
+PropertyUnions 151017
+UniqueUnions 1648
+LookupUnions 100101
+PreemptiveUnions 3113
+TotalComplements 1114465
+PropertyComplements 1027330
UniqueComplements 1426
-LookupComplements 86827
+LookupComplements 84283
PreemptiveComplements 1426
-TotalIntersections 126864
-PropertyIntersections 124007
+TotalIntersections 124142
+PropertyIntersections 121285
UniqueIntersections 4
LookupIntersections 0
PreemptiveIntersections 2853
@@ -109,59 +109,59 @@
Memory SSA Statistics******
################ (program : zstd.bc)###############
----------------Time and memory stats--------------------
-AverageRegSize 1.20917
+AverageRegSize 1.20297
----------------Numbers stats----------------------------
-BBHasMSSAPhi 8344
-CSChiNode 5758
-CSHasChi 2905
-CSHasMu 9151
-CSMuNode 17911
-FunEntryChi 34284
+BBHasMSSAPhi 8350
+CSChiNode 5712
+CSHasChi 2883
+CSHasMu 9129
+CSMuNode 17839
+FunEntryChi 34261
FunHasEntryChi 1233
FunHasRetMu 1264
-FunRetMu 34284
+FunRetMu 34261
LoadHasMu 119413
-LoadMuNode 133596
-MSSAPhi 100365
+LoadMuNode 132636
+MSSAPhi 100234
MaxRegSize 175
-MemRegions 31697
-StoreChiNode 58181
+MemRegions 31679
+StoreChiNode 58007
StoreHasChi 52884
#######################################################
SVFG Statistics******
################ (program : zstd.bc)###############
----------------Time and memory stats--------------------
----------------Numbers stats----------------------------
-ActualIn 17911
-ActualOut 5758
+ActualIn 17839
+ActualOut 5712
ActualParam 29895
ActualRet 9236
-Addr 31465
+Addr 31463
AvgInDegree 1
AvgIndInDeg 1
AvgIndOutDeg 2
AvgOutDegree 1
-Copy 20014
-DirectCallEdge 26759
-DirectEdge 451009
-DirectRetEdge 9421
-FormalIn 34284
-FormalOut 34284
+Copy 20040
+DirectCallEdge 26499
+DirectEdge 450742
+DirectRetEdge 9356
+FormalIn 34261
+FormalOut 34261
FormalParam 3782
FormalRet 993
-Gep 39015
-IndCallEdge 21118
-IndRetEdge 7664
-IndirectEdge 483184
-IndirectEdgeLabels 1518409
+Gep 38985
+IndCallEdge 20959
+IndRetEdge 7533
+IndirectEdge 481803
+IndirectEdgeLabels 1490820
Load 119413
-MSSAPhi 100365
+MSSAPhi 100234
MaxInDegree 669
MaxIndInDeg 669
MaxIndOutDeg 299
-MaxOutDegree 24342
+MaxOutDegree 24420
PHI 4323
Store 53343
-TotalEdge 934193
-TotalNode 579313
+TotalEdge 932545
+TotalNode 579094
#######################################################

@bjjwwang
Copy link
Copy Markdown
Contributor

--- /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/sqlite.llvm18.stats 2026-04-30 15:39:20.906705257 +1000
+++ /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/sqlite.llvm21.stats 2026-04-30 15:39:20.907685005 +1000
@@ -1,92 +1,92 @@
################ (program : sqlite.bc)###############
-AddrsNum 21200
+AddrsNum 21153
CallsNum 5049
ConstArrayObj 39
ConstStructObj 21
ConstantObj 0
-CopysNum 12994
-FIObjNum 2822
-FSObjNum 15367
-FunctionObjs 2562
-GepsNum 42041
+CopysNum 13144
+FIObjNum 2821
+FSObjNum 15362
+FunctionObjs 2560
+GepsNum 41988
GlobalObjs 96
-HeapObjs 79
+HeapObjs 75
IndCallSites 252
-LoadsNum 90961
+LoadsNum 90963
MaxStructSize 122
-NonPtrObj 9860
+NonPtrObj 9856
ReturnsNum 7643
StackObjs 15452
-StoresNum 37132
+StoresNum 37136
TotalCallSite 13058
-TotalFieldObjects 3764
-TotalObjects 21954
-TotalPTASVFStmts 141374
-TotalPointers 315026
-TotalSVFStmts 283088
+TotalFieldObjects 3785
+TotalObjects 21969
+TotalPTASVFStmts 141428
+TotalPointers 300238
+TotalSVFStmts 283134
VarArrayObj 112
VarStructObj 356
----------------Time and memory stats--------------------
#######################################################
################ (program : sqlite.bc)###############
----------------Numbers stats----------------------------
-CalRetPairInCycle 16998
-MaxNodeInCycle 1562
-NodeInCycle 1584
+CalRetPairInCycle 14198
+MaxNodeInCycle 1514
+NodeInCycle 1536
TotalCycle 18
-TotalEdge 26048
-TotalNode 2562
+TotalEdge 23526
+TotalNode 2560
#######################################################
################ (program : sqlite.bc)###############
----------------Time and memory stats--------------------
-AvgPtsSetSize 140.627
-AvgTopLvlPtsSize 342.243
-MemoryUsageVmrss 2.1212e+06
-MemoryUsageVmsize 2.12027e+06
+AvgPtsSetSize 134.746
+AvgTopLvlPtsSize 313.622
+MemoryUsageVmrss 1.98063e+06
+MemoryUsageVmsize 1.97995e+06
----------------Numbers stats----------------------------
-AddrProcessed 21200
-CopyProcessed 547426
+AddrProcessed 21153
+CopyProcessed 607292
DummyFieldPtrs 626
-FieldObjs 3764
-GepProcessed 279176
+FieldObjs 3785
+GepProcessed 311448
IndCallSites 252
-IndEdgeSolved 13204
-LoadProcessed 23171046
-LocalVarInRecur 5075
+IndEdgeSolved 10682
+LoadProcessed 21426749
+LocalVarInRecur 5042
MaxInAddrEdge 1
-MaxInCopyEdge 1723
-MaxInLoadEdge 5673
+MaxInCopyEdge 1602
+MaxInLoadEdge 5654
MaxInStoreEdge 191
-MaxNodesInSCC 13897
-MaxOutAddrEdge 3087
-MaxOutCopyEdge 20728
+MaxNodesInSCC 13809
+MaxOutAddrEdge 3042
+MaxOutCopyEdge 20598
MaxOutLoadEdge 860
-MaxOutStoreEdge 4529
-MaxPtsSetSize 527
-MemObjects 21954
-NodesInCycles 15865
-NullPointer 1765
-NumOfAddrs 18235
-NumOfCGEdge 436338
-NumOfCGNode 131703
-NumOfCopys 327207
+MaxOutStoreEdge 4519
+MaxPtsSetSize 491
+MemObjects 21969
+NodesInCycles 15790
+NullPointer 2053
+NumOfAddrs 18232
+NumOfCGEdge 431030
+NumOfCGNode 131795
+NumOfCopys 321945
NumOfFieldExpand 0
-NumOfGeps 41015
-NumOfLoads 53602
+NumOfGeps 40959
+NumOfLoads 53606
NumOfSCCDetect 19
NumOfSFRs 0
-NumOfStores 14514
-NumOfValidNode 130593
-NumOfValidObjNode 16037
-Pointers 315026
+NumOfStores 14520
+NumOfValidNode 130709
+NumOfValidObjNode 16079
+Pointers 300238
PointsToBlkPtr 0
-PointsToConstPtr 26734
+PointsToConstPtr 26449
SolveIterations 20
-StoreProcessed 3673689
-TotalCycleNum 300
-TotalObjects 21954
-TotalPWCCycleNum 39
-TotalPointers 315026
+StoreProcessed 1832056
+TotalCycleNum 304
+TotalObjects 21969
+TotalPWCCycleNum 42
+TotalPointers 300238
#######################################################
################ (program : sqlite.bc)###############
----------------Numbers stats----------------------------
@@ -94,134 +94,134 @@
MaxNodeInCycle 1565
NodeInCycle 1587
TotalCycle 18
-TotalEdge 26692
-TotalNode 2562
+TotalEdge 26691
+TotalNode 2560
#######################################################
################ (program : sqlite.bc)###############
----------------Time and memory stats--------------------
-AvgPtsSetSize 142.62
-AvgTopLvlPtsSize 351.057
-MemoryUsageVmrss 2.23523e+06
-MemoryUsageVmsize 2.23435e+06
+AvgPtsSetSize 149.21
+AvgTopLvlPtsSize 350.803
+MemoryUsageVmrss 2.21065e+06
+MemoryUsageVmsize 2.20993e+06
----------------Numbers stats----------------------------
-AddrProcessed 21200
-CopyProcessed 754470
+AddrProcessed 21153
+CopyProcessed 903270
DummyFieldPtrs 626
-FieldObjs 1927
-GepProcessed 373567
+FieldObjs 1928
+GepProcessed 436681
IndCallSites 252
-IndEdgeSolved 13848
-LoadProcessed 37822728
-LocalVarInRecur 5084
+IndEdgeSolved 13847
+LoadProcessed 34959377
+LocalVarInRecur 5085
MaxInAddrEdge 1
MaxInCopyEdge 1657
-MaxInLoadEdge 5800
+MaxInLoadEdge 5802
MaxInStoreEdge 191
-MaxNodesInSCC 13897
-MaxOutAddrEdge 3087
+MaxNodesInSCC 13809
+MaxOutAddrEdge 3042
MaxOutCopyEdge 20836
MaxOutLoadEdge 860
-MaxOutStoreEdge 4623
+MaxOutStoreEdge 4625
MaxPtsSetSize 537
-MemObjects 21954
+MemObjects 21969
NodesInCycles 1970
-NullPointer 1617
-NumOfAddrs 18158
-NumOfCGEdge 188617
-NumOfCGNode 131431
-NumOfCopys 79512
+NullPointer 1619
+NumOfAddrs 18105
+NumOfCGEdge 195708
+NumOfCGNode 131462
+NumOfCopys 86652
NumOfFieldExpand 0
-NumOfGeps 41007
-NumOfLoads 53592
-NumOfSCCDetect 23
+NumOfGeps 40954
+NumOfLoads 53594
+NumOfSCCDetect 26
NumOfSFRs 0
-NumOfStores 14506
-NumOfValidNode 130334
-NumOfValidObjNode 15943
-Pointers 315026
+NumOfStores 14508
+NumOfValidNode 130378
+NumOfValidObjNode 15937
+Pointers 300238
PointsToBlkPtr 0
-PointsToConstPtr 53616
-SolveIterations 23
-StoreProcessed 7061149
+PointsToConstPtr 53333
+SolveIterations 26
+StoreProcessed 2778375
TotalCycleNum 300
-TotalObjects 21954
+TotalObjects 21969
TotalPWCCycleNum 38
-TotalPointers 315026
+TotalPointers 300238
#######################################################
################ (program : sqlite.bc)###############
-UniquePointsToSets 33518
-TotalUnions 1223218
-PropertyUnions 170931
-UniqueUnions 10064
-LookupUnions 1023305
-PreemptiveUnions 18918
-TotalComplements 3174268
-PropertyComplements 2263049
-UniqueComplements 9175
-LookupComplements 892869
-PreemptiveComplements 9175
-TotalIntersections 2467209
-PropertyIntersections 2446948
-UniqueIntersections 141
-LookupIntersections 1683
-PreemptiveIntersections 18437
+UniquePointsToSets 34363
+TotalUnions 1442011
+PropertyUnions 190458
+UniqueUnions 10908
+LookupUnions 1220250
+PreemptiveUnions 20395
+TotalComplements 3576330
+PropertyComplements 2496212
+UniqueComplements 9940
+LookupComplements 1060239
+PreemptiveComplements 9939
+TotalIntersections 2573178
+PropertyIntersections 2552176
+UniqueIntersections 120
+LookupIntersections 927
+PreemptiveIntersections 19955
#######################################################
Memory SSA Statistics******
################ (program : sqlite.bc)###############
----------------Time and memory stats--------------------
-AverageRegSize 5.29433
+AverageRegSize 5.29677
----------------Numbers stats----------------------------
BBHasMSSAPhi 9785
-CSChiNode 42297
-CSHasChi 10133
-CSHasMu 12042
-CSMuNode 58414
-FunEntryChi 29598
+CSChiNode 42288
+CSHasChi 10132
+CSHasMu 12041
+CSMuNode 58390
+FunEntryChi 29605
FunHasEntryChi 2496
FunHasRetMu 2514
-FunRetMu 29598
-LoadHasMu 90961
-LoadMuNode 139252
-MSSAPhi 66492
+FunRetMu 29605
+LoadHasMu 90963
+LoadMuNode 139254
+MSSAPhi 66487
MaxRegSize 536
-MemRegions 18119
-StoreChiNode 50555
-StoreHasChi 35534
+MemRegions 18125
+StoreChiNode 50561
+StoreHasChi 35538
#######################################################
SVFG Statistics******
################ (program : sqlite.bc)###############
----------------Time and memory stats--------------------
----------------Numbers stats----------------------------
-ActualIn 58414
-ActualOut 42297
+ActualIn 58390
+ActualOut 42288
ActualParam 33294
ActualRet 7942
-Addr 21200
+Addr 21153
AvgInDegree 1
AvgIndInDeg 2
AvgIndOutDeg 2
AvgOutDegree 1
-Copy 12994
-DirectCallEdge 58674
-DirectEdge 389432
-DirectRetEdge 11517
-FormalIn 29598
-FormalOut 29598
+Copy 13144
+DirectCallEdge 58673
+DirectEdge 389413
+DirectRetEdge 11516
+FormalIn 29605
+FormalOut 29605
FormalParam 6152
FormalRet 1595
-Gep 42041
-IndCallEdge 148880
-IndRetEdge 116140
-IndirectEdge 683882
-IndirectEdgeLabels 34895709
-Load 90961
-MSSAPhi 66492
+Gep 41988
+IndCallEdge 148859
+IndRetEdge 116132
+IndirectEdge 683730
+IndirectEdgeLabels 34907935
+Load 90963
+MSSAPhi 66487
MaxInDegree 848
MaxIndInDeg 848
MaxIndOutDeg 991
MaxOutDegree 25481
PHI 2653
-Store 37132
-TotalEdge 1073314
-TotalNode 545779
+Store 37136
+TotalEdge 1073143
+TotalNode 545801
#######################################################

@bjjwwang
Copy link
Copy Markdown
Contributor

--- /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/lua.llvm18.stats 2026-04-30 15:40:27.850247449 +1000
+++ /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/lua.llvm21.stats 2026-04-30 15:40:27.851247485 +1000
@@ -1,130 +1,130 @@
################ (program : lua.bc)###############
-AddrsNum 7604
+AddrsNum 7602
CallsNum 2166
ConstArrayObj 28
ConstStructObj 2
ConstantObj 0
-CopysNum 3504
-FIObjNum 1223
-FSObjNum 5034
-FunctionObjs 1141
-GepsNum 8669
+CopysNum 3602
+FIObjNum 1217
+FSObjNum 5038
+FunctionObjs 1139
+GepsNum 8571
GlobalObjs 39
HeapObjs 14
IndCallSites 17
LoadsNum 21787
MaxStructSize 85
-NonPtrObj 3203
+NonPtrObj 3201
ReturnsNum 2194
StackObjs 5063
StoresNum 9340
TotalCallSite 4288
-TotalFieldObjects 356
-TotalObjects 6614
-TotalPTASVFStmts 38644
-TotalPointers 80047
-TotalSVFStmts 69499
+TotalFieldObjects 360
+TotalObjects 6616
+TotalPTASVFStmts 38642
+TotalPointers 75180
+TotalSVFStmts 69533
VarArrayObj 29
VarStructObj 140
----------------Time and memory stats--------------------
#######################################################
################ (program : lua.bc)###############
----------------Numbers stats----------------------------
-CalRetPairInCycle 3048
-MaxNodeInCycle 720
-NodeInCycle 725
+CalRetPairInCycle 3001
+MaxNodeInCycle 713
+NodeInCycle 718
TotalCycle 3
-TotalEdge 4840
-TotalNode 1141
+TotalEdge 4828
+TotalNode 1139
#######################################################
################ (program : lua.bc)###############
----------------Time and memory stats--------------------
-AvgPtsSetSize 61.2108
-AvgTopLvlPtsSize 140.079
-MemoryUsageVmrss 291160
-MemoryUsageVmsize 290300
+AvgPtsSetSize 63.5719
+AvgTopLvlPtsSize 137.353
+MemoryUsageVmrss 286828
+MemoryUsageVmsize 285928
----------------Numbers stats----------------------------
-AddrProcessed 7604
-CopyProcessed 80006
+AddrProcessed 7602
+CopyProcessed 80031
DummyFieldPtrs 162
-FieldObjs 356
-GepProcessed 28742
+FieldObjs 360
+GepProcessed 28624
IndCallSites 17
-IndEdgeSolved 559
-LoadProcessed 1709829
+IndEdgeSolved 547
+LoadProcessed 1680013
LocalVarInRecur 1557
MaxInAddrEdge 1
-MaxInCopyEdge 234
-MaxInLoadEdge 1593
+MaxInCopyEdge 262
+MaxInLoadEdge 1586
MaxInStoreEdge 37
MaxNodesInSCC 136
MaxOutAddrEdge 1348
MaxOutCopyEdge 3491
MaxOutLoadEdge 230
-MaxOutStoreEdge 1456
-MaxPtsSetSize 245
-MemObjects 6614
+MaxOutStoreEdge 1449
+MaxPtsSetSize 241
+MemObjects 6616
NodesInCycles 738
NullPointer 42
-NumOfAddrs 6490
-NumOfCGEdge 46047
-NumOfCGNode 34470
-NumOfCopys 20149
+NumOfAddrs 6499
+NumOfCGEdge 46153
+NumOfCGNode 34523
+NumOfCopys 20325
NumOfFieldExpand 0
-NumOfGeps 8049
-NumOfLoads 13145
+NumOfGeps 7951
+NumOfLoads 13173
NumOfSCCDetect 12
NumOfSFRs 0
NumOfStores 4704
-NumOfValidNode 34270
-NumOfValidObjNode 5277
-Pointers 80047
+NumOfValidNode 34322
+NumOfValidObjNode 5289
+Pointers 75180
PointsToBlkPtr 0
PointsToConstPtr 5108
SolveIterations 12
-StoreProcessed 569988
+StoreProcessed 560018
TotalCycleNum 65
-TotalObjects 6614
+TotalObjects 6616
TotalPWCCycleNum 14
-TotalPointers 80047
+TotalPointers 75180
#######################################################
################ (program : lua.bc)###############
-UniquePointsToSets 9293
-TotalUnions 138708
-PropertyUnions 53204
-UniqueUnions 2000
-LookupUnions 79690
-PreemptiveUnions 3814
-TotalComplements 452541
-PropertyComplements 376382
-UniqueComplements 1569
-LookupComplements 73021
-PreemptiveComplements 1569
-TotalIntersections 291264
-PropertyIntersections 288115
+UniquePointsToSets 9295
+TotalUnions 138559
+PropertyUnions 53108
+UniqueUnions 2003
+LookupUnions 79628
+PreemptiveUnions 3820
+TotalComplements 452875
+PropertyComplements 376758
+UniqueComplements 1570
+LookupComplements 72977
+PreemptiveComplements 1570
+TotalIntersections 286175
+PropertyIntersections 283024
UniqueIntersections 2
LookupIntersections 7
-PreemptiveIntersections 3140
+PreemptiveIntersections 3142
#######################################################
Memory SSA Statistics******
################ (program : lua.bc)###############
----------------Time and memory stats--------------------
-AverageRegSize 3.88272
+AverageRegSize 3.89636
----------------Numbers stats----------------------------
-BBHasMSSAPhi 2018
+BBHasMSSAPhi 2032
CSChiNode 10627
CSHasChi 3489
CSHasMu 3857
-CSMuNode 19397
-FunEntryChi 10604
+CSMuNode 19523
+FunEntryChi 10644
FunHasEntryChi 1062
FunHasRetMu 1044
-FunRetMu 10414
+FunRetMu 10453
LoadHasMu 21787
LoadMuNode 26266
-MSSAPhi 9457
-MaxRegSize 244
-MemRegions 5875
+MSSAPhi 9508
+MaxRegSize 240
+MemRegions 5886
StoreChiNode 10481
StoreHasChi 8865
#######################################################
@@ -132,36 +132,36 @@
################ (program : lua.bc)###############
----------------Time and memory stats--------------------
----------------Numbers stats----------------------------
-ActualIn 19397
+ActualIn 19523
ActualOut 10627
ActualParam 10600
ActualRet 2368
-Addr 7604
+Addr 7602
AvgInDegree 1
AvgIndInDeg 1
AvgIndOutDeg 2
AvgOutDegree 1
-Copy 3504
-DirectCallEdge 10383
-DirectEdge 90334
-DirectRetEdge 2727
-FormalIn 10604
-FormalOut 10414
+Copy 3602
+DirectCallEdge 10371
+DirectEdge 90253
+DirectRetEdge 2715
+FormalIn 10644
+FormalOut 10453
FormalParam 2393
FormalRet 648
-Gep 8669
-IndCallEdge 25907
-IndRetEdge 13889
-IndirectEdge 127158
-IndirectEdgeLabels 2754689
+Gep 8571
+IndCallEdge 26020
+IndRetEdge 13859
+IndirectEdge 127411
+IndirectEdgeLabels 2728012
Load 21787
-MSSAPhi 9457
+MSSAPhi 9508
MaxInDegree 468
MaxIndInDeg 468
MaxIndOutDeg 464
-MaxOutDegree 4814
+MaxOutDegree 4850
PHI 1038
Store 9340
-TotalEdge 217492
-TotalNode 141648
+TotalEdge 217664
+TotalNode 141938
#######################################################

@bjjwwang
Copy link
Copy Markdown
Contributor

--- /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/curl.llvm18.stats 2026-04-30 15:40:12.931701860 +1000
+++ /data1/wjw/SVF-Big/results/wpa_llvm18_vs_llvm21/curl.llvm21.stats 2026-04-30 15:40:12.932701897 +1000
@@ -1,29 +1,29 @@
################ (program : curl.bc)###############
-AddrsNum 7733
+AddrsNum 7670
CallsNum 1624
ConstArrayObj 17
ConstStructObj 15
ConstantObj 0
-CopysNum 2239
-FIObjNum 1094
+CopysNum 2013
+FIObjNum 1092
FSObjNum 4596
-FunctionObjs 927
-GepsNum 16386
+FunctionObjs 925
+GepsNum 16404
GlobalObjs 53
HeapObjs 139
IndCallSites 574
-LoadsNum 26608
-MaxStructSize 385
-NonPtrObj 3006
+LoadsNum 26620
+MaxStructSize 395
+NonPtrObj 3004
ReturnsNum 1623
StackObjs 4571
-StoresNum 14131
+StoresNum 14170
TotalCallSite 3537
-TotalFieldObjects 679
-TotalObjects 6370
-TotalPTASVFStmts 49739
-TotalPointers 104898
-TotalSVFStmts 95030
+TotalFieldObjects 675
+TotalObjects 6364
+TotalPTASVFStmts 49751
+TotalPointers 100440
+TotalSVFStmts 94806
VarArrayObj 108
VarStructObj 173
----------------Time and memory stats--------------------
@@ -34,134 +34,134 @@
MaxNodeInCycle 143
NodeInCycle 163
TotalCycle 11
-TotalEdge 5245
-TotalNode 927
+TotalEdge 5212
+TotalNode 925
#######################################################
################ (program : curl.bc)###############
----------------Time and memory stats--------------------
-AvgPtsSetSize 42.4287
-AvgTopLvlPtsSize 99.6395
-MemoryUsageVmrss 291700
-MemoryUsageVmsize 290832
+AvgPtsSetSize 43.8534
+AvgTopLvlPtsSize 98.7651
+MemoryUsageVmrss 288644
+MemoryUsageVmsize 287848
----------------Numbers stats----------------------------
-AddrProcessed 7733
-CopyProcessed 126598
+AddrProcessed 7670
+CopyProcessed 126852
DummyFieldPtrs 234
-FieldObjs 679
-GepProcessed 69484
+FieldObjs 675
+GepProcessed 69401
IndCallSites 574
-IndEdgeSolved 2250
-LoadProcessed 1953123
-LocalVarInRecur 248
+IndEdgeSolved 2217
+LoadProcessed 1943454
+LocalVarInRecur 247
MaxInAddrEdge 1
-MaxInCopyEdge 457
-MaxInLoadEdge 1721
+MaxInCopyEdge 466
+MaxInLoadEdge 1718
MaxInStoreEdge 319
MaxNodesInSCC 315
-MaxOutAddrEdge 2181
-MaxOutCopyEdge 4016
+MaxOutAddrEdge 2120
+MaxOutCopyEdge 4034
MaxOutLoadEdge 280
-MaxOutStoreEdge 1654
-MaxPtsSetSize 252
-MemObjects 6370
+MaxOutStoreEdge 1651
+MaxPtsSetSize 251
+MemObjects 6364
NodesInCycles 1284
-NullPointer 700
-NumOfAddrs 7142
-NumOfCGEdge 65330
-NumOfCGNode 46746
-NumOfCopys 26577
+NullPointer 723
+NumOfAddrs 7081
+NumOfCGEdge 65468
+NumOfCGNode 46780
+NumOfCopys 26635
NumOfFieldExpand 0
-NumOfGeps 15859
-NumOfLoads 17024
+NumOfGeps 15883
+NumOfLoads 17068
NumOfSCCDetect 19
NumOfSFRs 0
-NumOfStores 5870
-NumOfValidNode 46159
-NumOfValidObjNode 5292
-Pointers 104898
+NumOfStores 5882
+NumOfValidNode 46192
+NumOfValidObjNode 5288
+Pointers 100440
PointsToBlkPtr 0
-PointsToConstPtr 6487
+PointsToConstPtr 6471
SolveIterations 19
-StoreProcessed 516340
+StoreProcessed 515976
TotalCycleNum 121
-TotalObjects 6370
+TotalObjects 6364
TotalPWCCycleNum 18
-TotalPointers 104898
+TotalPointers 100440
#######################################################
################ (program : curl.bc)###############
-UniquePointsToSets 11518
-TotalUnions 226219
-PropertyUnions 72254
-UniqueUnions 3621
-LookupUnions 143940
-PreemptiveUnions 6404
-TotalComplements 927505
-PropertyComplements 788792
-UniqueComplements 3968
-LookupComplements 130777
-PreemptiveComplements 3968
-TotalIntersections 274733
-PropertyIntersections 266087
+UniquePointsToSets 11519
+TotalUnions 226311
+PropertyUnions 72336
+UniqueUnions 3616
+LookupUnions 143962
+PreemptiveUnions 6397
+TotalComplements 927964
+PropertyComplements 789272
+UniqueComplements 3973
+LookupComplements 130746
+PreemptiveComplements 3973
+TotalIntersections 272945
+PropertyIntersections 264301
UniqueIntersections 57
-LookupIntersections 614
-PreemptiveIntersections 7975
+LookupIntersections 602
+PreemptiveIntersections 7985
#######################################################
Memory SSA Statistics******
################ (program : curl.bc)###############
----------------Time and memory stats--------------------
-AverageRegSize 4.71476
+AverageRegSize 4.6187
----------------Numbers stats----------------------------
-BBHasMSSAPhi 3051
-CSChiNode 4959
-CSHasChi 1996
-CSHasMu 2367
-CSMuNode 9857
-FunEntryChi 7953
+BBHasMSSAPhi 3049
+CSChiNode 4925
+CSHasChi 1994
+CSHasMu 2366
+CSMuNode 9590
+FunEntryChi 7946
FunHasEntryChi 850
FunHasRetMu 852
-FunRetMu 7953
-LoadHasMu 26608
-LoadMuNode 32502
-MSSAPhi 11861
-MaxRegSize 245
-MemRegions 5385
-StoreChiNode 15380
-StoreHasChi 13167
+FunRetMu 7946
+LoadHasMu 26620
+LoadMuNode 32480
+MSSAPhi 11839
+MaxRegSize 244
+MemRegions 5379
+StoreChiNode 15410
+StoreHasChi 13206
#######################################################
SVFG Statistics******
################ (program : curl.bc)###############
----------------Time and memory stats--------------------
----------------Numbers stats----------------------------
-ActualIn 9857
-ActualOut 4959
+ActualIn 9590
+ActualOut 4925
ActualParam 8500
ActualRet 2118
-Addr 7733
+Addr 7670
AvgInDegree 1
AvgIndInDeg 1
AvgIndOutDeg 2
AvgOutDegree 1
-Copy 2239
-DirectCallEdge 12255
-DirectEdge 120459
-DirectRetEdge 2765
-FormalIn 7953
-FormalOut 7953
+Copy 2013
+DirectCallEdge 12102
+DirectEdge 120112
+DirectRetEdge 2736
+FormalIn 7946
+FormalOut 7946
FormalParam 2232
FormalRet 654
-Gep 16386
-IndCallEdge 17508
-IndRetEdge 9752
-IndirectEdge 118506
-IndirectEdgeLabels 3366534
-Load 26608
-MSSAPhi 11861
+Gep 16404
+IndCallEdge 17137
+IndRetEdge 9601
+IndirectEdge 117646
+IndirectEdgeLabels 3341494
+Load 26620
+MSSAPhi 11839
MaxInDegree 250
MaxIndInDeg 250
MaxIndOutDeg 473
MaxOutDegree 10447
PHI 1314
-Store 14131
-TotalEdge 238965
-TotalNode 147871
+Store 14170
+TotalEdge 237758
+TotalNode 147310
#######################################################

@bjjwwang
Copy link
Copy Markdown
Contributor

project LLVM TotalTime (s) LLVMIRTime (s) SVFIRTime (s) VmRSS (KB) AvgPtsSetSize AvgTopLvlPtsSize MaxPtsSetSize TotalPointers
sqlite 18 36.49 0.726 2.152 2,121,200 140.63 342.24 527 315,026
sqlite 21 34.23 0.593 2.143 1,980,630 134.75 313.62 491 300,238
zstd 18 3.82 0.854 2.875 479,272 5.08 14.65 81 397,790
zstd 21 3.83 0.723 2.937 465,096 5.23 14.11 60 369,570
curl 18 3.68 0.233 0.623 291,700 42.43 99.64 252 104,898
curl 21 3.54 0.215 0.605 288,644 43.85 98.77 251 100,440
lua 18 2.77 0.164 0.447 291,160 61.21 140.08 245 80,047
lua 21 2.74 0.140 0.464 286,828 63.57 137.35 241 75,180
project TotalTime VmRSS AvgTopLvlPtsSize MaxPtsSetSize TotalPointers
sqlite −6.2% −6.6% −8.4% −6.8% −4.7%
zstd +0.3% −3.0% −3.7% −25.9% −7.1%
curl −3.8% −1.0% −0.9% −0.4% −4.3%
lua −1.1% −1.5% −2.0% −1.6% −6.1%

@yuleisui yuleisui merged commit 899d00a into SVF-tools:master Apr 30, 2026
10 checks passed
@cjsrxzdyzds cjsrxzdyzds deleted the llvm21-port-slim branch April 30, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants