Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getbasevalueforextarg #1652

Merged
merged 11 commits into from
Feb 19, 2025
Merged

fix getbasevalueforextarg #1652

merged 11 commits into from
Feb 19, 2025

Conversation

jumormt
Copy link
Contributor

@jumormt jumormt commented Feb 11, 2025

fix issue #1650
--- log/nginx.log 2025-02-11 10:27:54.119860076 +1100
+++ log/nginx-xiao.log 2025-02-11 10:28:55.531230995 +1100
@@ -39,9 +39,9 @@
VarArrayObj 153
VarStructObj 630
----------------Time and memory stats--------------------
-LLVMIRTime 1.236
-SVFIRTime 1.473
-SymbolTableTime 0.17
+LLVMIRTime 1.208
+SVFIRTime 1.429
+SymbolTableTime 0.169
#######################################################

PTACallGraph Stats (Andersen analysis)******
@@ -68,11 +68,11 @@
CollapseTime 0
CopyGepTime 0
LoadStoreTime 0
-MemoryUsageVmrss 2.3221e+06
+MemoryUsageVmrss 2.32208e+06
MemoryUsageVmsize 2.3222e+06
SCCDetectTime 0
SCCMergeTime 0
-TotalTime 126.089
+TotalTime 127.024
UpdateCGTime 0
----------------Numbers stats----------------------------
AddrProcessed 5909
@@ -144,11 +144,11 @@
CollapseTime 0
CopyGepTime 0
LoadStoreTime 0
-MemoryUsageVmrss 2.32711e+06
-MemoryUsageVmsize 2.32703e+06
+MemoryUsageVmrss 2.32708e+06
+MemoryUsageVmsize 2.32704e+06
SCCDetectTime 0
SCCMergeTime 0
-TotalTime 140.533
+TotalTime 141.498
UpdateCGTime 0
----------------Numbers stats----------------------------
AddrProcessed 5909
@@ -220,11 +220,11 @@
################ (program : nginx.bc)###############
----------------Time and memory stats--------------------
AverageRegSize 39.1348
-GenMUCHITime 1.135
-GenRegionTime 86.259
-InsertPHITime 0.388
-SSARenameTime 0.035
-TotalMSSATime 87.818
+GenMUCHITime 1.255
+GenRegionTime 86.796
+InsertPHITime 0.423
+SSARenameTime 0.033
+TotalMSSATime 88.509
----------------Numbers stats----------------------------
BBHasMSSAPhi 4056
CSChiNode 22213
@@ -247,13 +247,13 @@
SVFG Statistics******
################ (program : nginx.bc)###############
----------------Time and memory stats--------------------
-ATNodeTime 0.208
+ATNodeTime 0.202
AvgWeight 198.378
ConnDirEdgeTime 0
-ConnIndEdgeTime 1.323
+ConnIndEdgeTime 1.307
OptTime 0
TLNodeTime 0
-TotalTime 1.531
+TotalTime 1.509
----------------Numbers stats----------------------------
ActualIn 30142
ActualOut 22213
@@ -315,20 +315,20 @@
GepTime 0
IndirectPropaTime 0
LoadTime 0
-MemoryUsageVmrss 4.79128e+06
-MemoryUsageVmsize 4.84208e+06
+MemoryUsageVmrss 4.79166e+06
+MemoryUsageVmsize 4.84191e+06
PhiTime 0
-PrelabelingTime 0.156
+PrelabelingTime 0.167
ProcessTime 0
PropagationTime 0
SCCTime 0
-SolveTime 825.305
+SolveTime 846.687
StoreTime 0
Strong/WeakUpdTime 0
-TotalTime 895.608
+TotalTime 915.415
UpdateCGTime 0
VersionPropTime 0
-meldLabelingTime 67.586
+meldLabelingTime 65.894
----------------Numbers stats----------------------------
CopysNum 80
DummyFieldPtrs 1510
@@ -348,11 +348,11 @@
ProcessedAddr 23636
ProcessedCopy 324
ProcessedFRet 0
-ProcessedGep 1031986
-ProcessedLoad 1293940
+ProcessedGep 1031985
+ProcessedLoad 1294061
ProcessedMSSANode 344692
-ProcessedPhi 86796
-ProcessedStore 687765
+ProcessedPhi 86794
+ProcessedStore 687872
SolveIterations 4
StoresNum 14929
StrongUpdates 282
@@ -368,11 +368,11 @@
Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector
################ (program : nginx.bc)###############
UniquePointsToSets 30238
-TotalUnions 1937098543
-PropertyUnions 1237912403
-UniqueUnions 108827
-LookupUnions 698939016
-PreemptiveUnions 138297
+TotalUnions 1937482060
+PropertyUnions 1238078939
+UniqueUnions 108830
+LookupUnions 699155991
+PreemptiveUnions 138300
TotalComplements 0
PropertyComplements 0
UniqueComplements 0

@jumormt
Copy link
Contributor Author

jumormt commented Feb 11, 2025

cg
icfg

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.

Project coverage is 64.01%. Comparing base (193379c) to head (2d0d8e5).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
svf-llvm/lib/ObjTypeInference.cpp 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1652      +/-   ##
==========================================
+ Coverage   63.98%   64.01%   +0.03%     
==========================================
  Files         247      247              
  Lines       25952    25977      +25     
  Branches     4509     4524      +15     
==========================================
+ Hits        16605    16629      +24     
- Misses       9347     9348       +1     
Files with missing lines Coverage Δ
svf-llvm/include/SVF-LLVM/ObjTypeInference.h 100.00% <ø> (ø)
svf-llvm/lib/SVFIRBuilder.cpp 84.76% <100.00%> (+0.25%) ⬆️
svf-llvm/lib/ObjTypeInference.cpp 95.10% <93.33%> (-0.09%) ⬇️

@@ -1398,7 +1398,29 @@ const Value* SVFIRBuilder::getBaseValueForExtArg(const Value* V)
}
if(totalidx == 0 && !SVFUtil::isa<StructType>(value->getType()))
value = gep->getPointerOperand();
} else if (const LoadInst* load = SVFUtil::dyn_cast<LoadInst>(value)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put examples as the comments in this function?

/*

  • Example 1: LLVM IR
  • Example 2: LLVM IR
    /
    const Value
    SVFIRBuilder::getBaseValueForExtArg(const Value* V)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to make two examples one for the if branch when not dealing with global and the other for the case in the issue. Would be good to also point out which is the value and which is the gep and base corresponding llvm IR to the implementation code

@Frankenween
Copy link

For my small handwritten test it is fine, however, this patch introduces some regression. Without it:

*********General Stats***************
################ (program : netfilter-xt_nat.ll)###############
AddrsNum            1587
BBWith2Succ         11
BBWith3Succ         0
CallsNum            28
ConstArrayObj       2
ConstStructObj      2
ConstantObj         0
CopysNum            446
FIObjNum            158
FSObjNum            1222
FunctionObjs        669
GepsNum             26973
GlobalObjs          706
HeapObjs            1
IndCallSites        663
LoadsNum            13373
MaxStructSize       599
NonPtrObj           1378
ReturnsNum          9
StackObjs           4
StoresNum           13476
TotalCallSite       1540
TotalFieldObjects   5403
TotalObjects        6784
TotalPTASVFStmts    55646
TotalPointers       49496
TotalSVFStmts       56453
VarArrayObj         0
VarStructObj        705
----------------Time and memory stats--------------------
LLVMIRTime          0.033
SVFIRTime           0.171
SymbolTableTime     0.011
#######################################################

*********PTACallGraph Stats (Andersen analysis)***************
################ (program : netfilter-xt_nat.ll)###############
----------------Numbers stats----------------------------
CalRetPairInCycle   713
MaxNodeInCycle      7
NodeInCycle         645
TotalCycle          633
TotalEdge           1599
TotalNode           669
#######################################################

*********Andersen Pointer Analysis Stats***************
################ (program : netfilter-xt_nat.ll)###############
----------------Time and memory stats--------------------
AvgIn/OutAddrEdge   0.040777
AvgIn/OutCopyEdge   0.864135
AvgIn/OutEdge       1.68528
AvgIn/OutLoadEdge   0.389482
AvgIn/OutStoreEdge  0.390882
AvgPtsSetSize       1.47395
AvgTopLvlPtsSize    0.973308
CollapseTime        0
CopyGepTime         0
LoadStoreTime       0
MemoryUsageVmrss    97660
MemoryUsageVmsize   97164
SCCDetectTime       0
SCCMergeTime        0
TotalTime           0.334
UpdateCGTime        0
----------------Numbers stats----------------------------
AddrProcessed       1398
CopyProcessed       4194
DummyFieldPtrs      862
FieldObjs           5403
GepProcessed        38970
IndCallSites        663
IndEdgeSolved       722
LoadProcessed       13338
LocalVarInRecur     0
MaxInAddrEdge       1
MaxInCopyEdge       18
MaxInLoadEdge       2167
MaxInStoreEdge      17
MaxNodesInSCC       2770
MaxOutAddrEdge      19
MaxOutCopyEdge      3056
MaxOutLoadEdge      1
MaxOutStoreEdge     2167
MaxPtsSetSize       18
MemObjects          6784
NodesInCycles       17110
NullPointer         38
NumOfAddrs          1398
NumOfCGEdge         56380
NumOfCGNode         37062
NumOfCopys          2653
NumOfFieldExpand    0
NumOfGeps           26973
NumOfLoads          13353
NumOfSCCDetect      3
NumOfSFRs           0
NumOfStores         13401
NumOfValidNode      34284
NumOfValidObjNode   2373
Pointers            49496
PointsToBlkPtr      0
PointsToConstPtr    7
SolveIterations     3
StoreProcessed      13467
TotalCycleNum       2377
TotalObjects        6784
TotalPWCCycleNum    0
TotalPointers       49496
#######################################################
Writing 'callgraph_final.dot'...
****Persistent Points-To Cache Statistics: Andersen's analysis bitvector****
################ (program : netfilter-xt_nat.ll)###############
UniquePointsToSets       6802
TotalUnions              59359
PropertyUnions           59263
UniqueUnions             32
LookupUnions             0
PreemptiveUnions         64
TotalComplements         128056
PropertyComplements      128056
UniqueComplements        0
LookupComplements        0
PreemptiveComplements    0
TotalIntersections       41705
PropertyIntersections    41705
UniqueIntersections      0
LookupIntersections      0
PreemptiveIntersections  0
#######################################################

With it:

wpa: /home/vova/Diploma/SVF/llvm-16.0.0.obj/include/llvm/IR/GlobalVariable.h:136: const llvm::Constant* llvm::GlobalVariable::getInitializer() const: Assertion `hasInitializer() && "GV doesn't have initializer!"' failed.

Unfortunatelly, I have no small reproducer, only a big one.
netfilter-xt_nat.ll.zip

const Value * pointer_operand = gep->getPointerOperand();
if (auto *glob = SVFUtil::dyn_cast<GlobalVariable>(pointer_operand)) {
if (auto *initializer = llvm::dyn_cast<
ConstantStruct>(glob->getInitializer())) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use the existing method to get the object (that SVF has collected) rather than identifying the global object and its initializer.

@Frankenween
Copy link

Now it is fine, but the issue is not resolved completely. My case uses global variables for ponter exchange and here is the code:

struct file_operations {
        void (*f1)();
        void (*f2)();
};

struct miscdevice  {
        int minor;
        const char *name;
        const struct file_operations *fops;
};

void f1();
void f2();

static const struct file_operations fops = {
        .f1 = f1,
        .f2 = f2
};
  
static struct miscdevice mdev = {
        .minor=0,
        .name="dummy",
        .fops=&fops,
};

extern struct miscdevice mdev_stub;
extern struct file_operations fops_stub;

int misc_register(struct miscdevice *misc) {
        mdev_stub = *misc;
        return 0;
} 
  
void move_and_call() {
        fops_stub = *mdev_stub.fops;
        fops_stub.f1();
        fops_stub.f2();
} 

void init() {
        misc_register(misc: &mdev);
}

In this case I have this IR:

%struct.miscdevice = type { i32, i8*, %struct.file_operations* }
%struct.file_operations = type { void (...)*, void (...)* }
        
@mdev_stub = external global %struct.miscdevice, align 8
@fops_stub = external global %struct.file_operations, align 8
@mdev = internal global %struct.miscdevice { i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), %struct.file_  operations* @fops }, align 8
@.str = private unnamed_addr constant [6 x i8] c"dummy\00", align 1
@fops = internal constant %struct.file_operations { void (...)* @f1, void (...)* @f2 }, align 8

; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @misc_register(%struct.miscdevice* noundef %0) #0 {
  %2 = alloca %struct.miscdevice*, align 8
  store %struct.miscdevice* %0, %struct.miscdevice** %2, align 8
  %3 = load %struct.miscdevice*, %struct.miscdevice** %2, align 8
  %4 = bitcast %struct.miscdevice* %3 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 bitcast (%struct.miscdevice* @mdev_stub to i8*), i8* align 8 %4, i64 24, i1 false)
  ret i32 0
}

; Function Attrs: argmemonly nofree nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @move_and_call() #0 {
  %1 = load %struct.file_operations*, %struct.file_operations** getelementptr inbounds (%struct.miscdevice, %struct.miscdevice* @mdev_s  tub, i32 0, i32 2), align 8
  %2 = bitcast %struct.file_operations* %1 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 bitcast (%struct.file_operations* @fops_stub to i8*), i8* align 8 %2, i64 16, i1 fal  se)
  %3 = load void (...)*, void (...)** getelementptr inbounds (%struct.file_operations, %struct.file_operations* @fops_stub, i32 0, i32   0), align 8
  call void (...) %3()
  %4 = load void (...)*, void (...)** getelementptr inbounds (%struct.file_operations, %struct.file_operations* @fops_stub, i32 0, i32   1), align 8
  call void (...) %4()
  ret void
}

With -ff-eq-base flag f1 call is found(I belive it is because it has 0 offset), but not f2.
test.zip

@yuleisui
Copy link
Collaborator

Now it is fine, but the issue is not resolved completely. My case uses global variables for ponter exchange and here is the code:

struct file_operations {
        void (*f1)();
        void (*f2)();
};

struct miscdevice  {
        int minor;
        const char *name;
        const struct file_operations *fops;
};

void f1();
void f2();

static const struct file_operations fops = {
        .f1 = f1,
        .f2 = f2
};
  
static struct miscdevice mdev = {
        .minor=0,
        .name="dummy",
        .fops=&fops,
};

extern struct miscdevice mdev_stub;
extern struct file_operations fops_stub;

int misc_register(struct miscdevice *misc) {
        mdev_stub = *misc;
        return 0;
} 
  
void move_and_call() {
        fops_stub = *mdev_stub.fops;
        fops_stub.f1();
        fops_stub.f2();
} 

void init() {
        misc_register(misc: &mdev);
}

In this case I have this IR:

%struct.miscdevice = type { i32, i8*, %struct.file_operations* }
%struct.file_operations = type { void (...)*, void (...)* }
        
@mdev_stub = external global %struct.miscdevice, align 8
@fops_stub = external global %struct.file_operations, align 8
@mdev = internal global %struct.miscdevice { i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), %struct.file_  operations* @fops }, align 8
@.str = private unnamed_addr constant [6 x i8] c"dummy\00", align 1
@fops = internal constant %struct.file_operations { void (...)* @f1, void (...)* @f2 }, align 8

; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @misc_register(%struct.miscdevice* noundef %0) #0 {
  %2 = alloca %struct.miscdevice*, align 8
  store %struct.miscdevice* %0, %struct.miscdevice** %2, align 8
  %3 = load %struct.miscdevice*, %struct.miscdevice** %2, align 8
  %4 = bitcast %struct.miscdevice* %3 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 bitcast (%struct.miscdevice* @mdev_stub to i8*), i8* align 8 %4, i64 24, i1 false)
  ret i32 0
}

; Function Attrs: argmemonly nofree nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @move_and_call() #0 {
  %1 = load %struct.file_operations*, %struct.file_operations** getelementptr inbounds (%struct.miscdevice, %struct.miscdevice* @mdev_s  tub, i32 0, i32 2), align 8
  %2 = bitcast %struct.file_operations* %1 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 bitcast (%struct.file_operations* @fops_stub to i8*), i8* align 8 %2, i64 16, i1 fal  se)
  %3 = load void (...)*, void (...)** getelementptr inbounds (%struct.file_operations, %struct.file_operations* @fops_stub, i32 0, i32   0), align 8
  call void (...) %3()
  %4 = load void (...)*, void (...)** getelementptr inbounds (%struct.file_operations, %struct.file_operations* @fops_stub, i32 0, i32   1), align 8
  call void (...) %4()
  ret void
}

With -ff-eq-base flag f1 call is found(I belive it is because it has 0 offset), but not f2. test.zip

Thanks for reporting it. Would you be able to tweak my previous case to reproduce this issue?

struct interesting {
        int dummy;
        void (*f1)();
        void (*f2)();
};
struct nested_ptr {
        int dummy;
        struct interesting* ptr;
};
void f1();
void f2();
struct interesting i1 = {
        .f1 = f1,
        .f2 = f2
};
struct nested_ptr n1 = {
        .ptr = &i1
};
void test_ptr() {
        struct interesting interesting_stub;
        interesting_stub = *n1.ptr;
        interesting_stub.f1();
        interesting_stub.f2();
}

@Frankenween
Copy link

@yuleisui it seems that one indirection level breaks it: when I first store n1 in a temporal object, and then read ptr field from it, calls are not resolved:

struct interesting {
	int dummy;
	void (*f1)();
	void (*f2)();
};

struct nested_ptr {
	int dummy;
	struct interesting* ptr;
};
void f1();
void f2();
struct interesting i1 = {
	.f1 = f1,
	.f2 = f2
};

struct nested_ptr n1 = {
	.ptr = &i1
};

void test_ptr() {
	struct nested_ptr tmp = n1;
	struct interesting interesting_stub = *tmp.ptr;
	interesting_stub.f1();
	interesting_stub.f2();
}

LLVM IR looks this way:

; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @test_ptr() #1 {
  %1 = alloca %struct.nested_ptr, align 8
  %2 = alloca %struct.interesting, align 8
  %3 = bitcast %struct.nested_ptr* %1 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %3, i8* align 8 bitcast (%struct.nested_ptr* @n1 to i8*), i64 16, i1 false)
  %4 = getelementptr inbounds %struct.nested_ptr, %struct.nested_ptr* %1, i32 0, i32 1
  %5 = load %struct.interesting*, %struct.interesting** %4, align 8
  %6 = bitcast %struct.interesting* %2 to i8*
  %7 = bitcast %struct.interesting* %5 to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %6, i8* align 8 %7, i64 24, i1 false)
  %8 = getelementptr inbounds %struct.interesting, %struct.interesting* %2, i32 0, i32 1
  %9 = load void (...)*, void (...)** %8, align 8
  call void (...) %9()
  %10 = getelementptr inbounds %struct.interesting, %struct.interesting* %2, i32 0, i32 2
  %11 = load void (...)*, void (...)** %10, align 8
  call void (...) %11()
  ret void
}

SVFIR, full LLVM IR and source file are in the archive
test2.zip

* q = g->g_n (g is a global struct, g_n is the n-th field)
* p = *q
* extapi(p)
* The base value for p is g_n. Load -> GEP (collect the GEP index) based on g (a global struct) -> g_n.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g_n = getBaseValueForExtArg(p)

const Value* dst = cs->getArgOperand(0);
const Value* src = cs->getArgOperand(1);
const auto name = cs->getName();
assert(name == name);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always holds

if (const CallBase* cs = SVFUtil::dyn_cast<CallBase>(use)) {
if (const Function* calledFun = cs->getCalledFunction())
if (LLVMUtil::isMemcpyExtFun(LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(calledFun))) {
const Value* dst = cs->getArgOperand(0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put an assert to check the argument number >=2 before this line

@@ -135,6 +135,31 @@ LLVMContext &ObjTypeInference::getLLVMCtx()
*/
const Type *ObjTypeInference::inferObjType(const Value *var)
{
const Type* res = inferSingleObjType(var);
// infer type by leveraging the type alignment of src and dst in memcpy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to put an example here to mention the inference based on the use at a memcpy callsite

@@ -135,6 +135,31 @@ LLVMContext &ObjTypeInference::getLLVMCtx()
*/
const Type *ObjTypeInference::inferObjType(const Value *var)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the below methods.

inferSingleObjType => typeInference

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inferSingleObjType => inferPointsToType

@yuleisui
Copy link
Collaborator

@Frankenween could you check again whether this pull request works for your latest case?

%0 = getelementptr inbounds %struct.outer, %struct.inner %base, i32 0, i32 0
call void @llvm.memcpy(ptr %inner, ptr %0, i64 24, i1 false)
The base value for %0 is %base.
Note: We only handle the field index 0 for now.
Copy link
Collaborator

@yuleisui yuleisui Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: the %base is recognized as the base value if the offset (field index) is 0

Note: We only handle the field index 0 for now.

* Example 2:
* https://github.com/SVF-tools/SVF/issues/1650
Copy link
Collaborator

@yuleisui yuleisui Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add one more link: #1652

@yuleisui
Copy link
Collaborator

@Frankenween could you confirm again whether your test can pass now using this updated patch? I will need to merge it soon.

@jumormt
Copy link
Contributor Author

jumormt commented Feb 19, 2025

--- log/nginx.log 2025-02-19 17:55:02.325367811 +1100
+++ log/nginx-xiao.log 2025-02-19 17:54:56.417428590 +1100
@@ -20,28 +20,28 @@
FIObjNum 1060
FSObjNum 1917
FunctionObjs 1777
-GepsNum 44042
+GepsNum 45536
GlobalObjs 505
HeapObjs 13
IndCallSites 391
-LoadsNum 31750
+LoadsNum 32497
MaxStructSize 161
NonPtrObj 2856
ReturnsNum 3030
StackObjs 682
-StoresNum 28486
+StoresNum 29233
TotalCallSite 10749
-TotalFieldObjects 5529
-TotalObjects 8507
-TotalPTASVFStmts 99507
-TotalPointers 197736
-TotalSVFStmts 188620
-VarArrayObj 153
+TotalFieldObjects 5536
+TotalObjects 8514
+TotalPTASVFStmts 102495
+TotalPointers 199977
+TotalSVFStmts 191608
+VarArrayObj 154
VarStructObj 630
----------------Time and memory stats--------------------
-LLVMIRTime 1.224
-SVFIRTime 1.534
-SymbolTableTime 0.175
+LLVMIRTime 1.219
+SVFIRTime 1.538
+SymbolTableTime 0.176
#######################################################

PTACallGraph Stats (Andersen analysis)******
@@ -58,66 +58,66 @@
Andersen Pointer Analysis Stats******
################ (program : nginx.bc)###############
----------------Time and memory stats--------------------
-AvgIn/OutAddrEdge 0.0718204
-AvgIn/OutCopyEdge 1.69045
-AvgIn/OutEdge 2.26021
-AvgIn/OutLoadEdge 0.286335
-AvgIn/OutStoreEdge 0.211602
-AvgPtsSetSize 279.176
-AvgTopLvlPtsSize 648.646
+AvgIn/OutAddrEdge 0.0701392
+AvgIn/OutCopyEdge 1.67811
+AvgIn/OutEdge 2.25611
+AvgIn/OutLoadEdge 0.29042
+AvgIn/OutStoreEdge 0.217436
+AvgPtsSetSize 285.401
+AvgTopLvlPtsSize 651.247
CollapseTime 0
CopyGepTime 0
LoadStoreTime 0
-MemoryUsageVmrss 2.32234e+06
-MemoryUsageVmsize 2.32217e+06
+MemoryUsageVmrss 2.36884e+06
+MemoryUsageVmsize 2.3686e+06
SCCDetectTime 0
SCCMergeTime 0
-TotalTime 126.857
+TotalTime 130.737
UpdateCGTime 0
----------------Numbers stats----------------------------
AddrProcessed 5909
-CopyProcessed 188531
+CopyProcessed 189711
DummyFieldPtrs 1510
-FieldObjs 5529
-GepProcessed 263290
+FieldObjs 5536
+GepProcessed 274381
IndCallSites 391
IndEdgeSolved 50000
-LoadProcessed 160856569
+LoadProcessed 166740995
LocalVarInRecur 274
MaxInAddrEdge 1
-MaxInCopyEdge 3189
-MaxInLoadEdge 8568
+MaxInCopyEdge 3258
+MaxInLoadEdge 9215
MaxInStoreEdge 83
-MaxNodesInSCC 13156
+MaxNodesInSCC 13810
MaxOutAddrEdge 2933
-MaxOutCopyEdge 15362
+MaxOutCopyEdge 15467
MaxOutLoadEdge 253
-MaxOutStoreEdge 8038
+MaxOutStoreEdge 8681
MaxPtsSetSize 1072
-MemObjects 8507
-NodesInCycles 14369
-NullPointer 2271
+MemObjects 8514
+NodesInCycles 15030
+NullPointer 2316
NumOfAddrs 4857
-NumOfCGEdge 147994
-NumOfCGNode 70214
-NumOfCopys 71703
+NumOfCGEdge 151374
+NumOfCGNode 71795
+NumOfCopys 72095
NumOfFieldExpand 0
-NumOfGeps 42617
-NumOfLoads 19364
+NumOfGeps 44111
+NumOfLoads 20111
NumOfSCCDetect 19
NumOfSFRs 0
-NumOfStores 14310
-NumOfValidNode 67627
-NumOfValidObjNode 2757
-Pointers 197736
+NumOfStores 15057
+NumOfValidNode 69248
+NumOfValidObjNode 2791
+Pointers 199977
PointsToBlkPtr 0
-PointsToConstPtr 29333
+PointsToConstPtr 30443
SolveIterations 20
-StoreProcessed 74044567
+StoreProcessed 78061532
TotalCycleNum 413
-TotalObjects 8507
+TotalObjects 8514
TotalPWCCycleNum 36
-TotalPointers 197736
+TotalPointers 199977
#######################################################

PTACallGraph Stats (Andersen analysis)******
@@ -134,129 +134,129 @@
Andersen Pointer Analysis Stats******
################ (program : nginx.bc)###############
----------------Time and memory stats--------------------
-AvgIn/OutAddrEdge 0.0717964
-AvgIn/OutCopyEdge 1.15732
-AvgIn/OutEdge 1.72735
-AvgIn/OutLoadEdge 0.28652
-AvgIn/OutStoreEdge 0.211705
-AvgPtsSetSize 269.797
-AvgTopLvlPtsSize 653.477
+AvgIn/OutAddrEdge 0.0701146
+AvgIn/OutCopyEdge 1.15279
+AvgIn/OutEdge 1.73104
+AvgIn/OutLoadEdge 0.290603
+AvgIn/OutStoreEdge 0.21754
+AvgPtsSetSize 276.206
+AvgTopLvlPtsSize 655.994
CollapseTime 0
CopyGepTime 0
LoadStoreTime 0
-MemoryUsageVmrss 2.32708e+06
-MemoryUsageVmsize 2.32701e+06
+MemoryUsageVmrss 2.37383e+06
+MemoryUsageVmsize 2.37366e+06
SCCDetectTime 0
SCCMergeTime 0
-TotalTime 141.579
+TotalTime 145.906
UpdateCGTime 0
----------------Numbers stats----------------------------
AddrProcessed 5909
-CopyProcessed 237862
+CopyProcessed 239362
DummyFieldPtrs 1510
-FieldObjs 2438
-GepProcessed 307705
+FieldObjs 2439
+GepProcessed 320051
IndCallSites 391
IndEdgeSolved 50000
-LoadProcessed 177046471
+LoadProcessed 183623440
LocalVarInRecur 274
MaxInAddrEdge 1
-MaxInCopyEdge 3145
-MaxInLoadEdge 8606
+MaxInCopyEdge 3214
+MaxInLoadEdge 9253
MaxInStoreEdge 83
-MaxNodesInSCC 13156
+MaxNodesInSCC 13810
MaxOutAddrEdge 2933
-MaxOutCopyEdge 15389
+MaxOutCopyEdge 15494
MaxOutLoadEdge 252
-MaxOutStoreEdge 8076
+MaxOutStoreEdge 8719
MaxPtsSetSize 1073
-MemObjects 8507
+MemObjects 8514
NodesInCycles 1200
-NullPointer 2143
+NullPointer 2188
NumOfAddrs 4852
-NumOfCGEdge 111882
-NumOfCGNode 70167
-NumOfCopys 35597
+NumOfCGEdge 114938
+NumOfCGNode 71748
+NumOfCopys 35665
NumOfFieldExpand 0
-NumOfGeps 42615
-NumOfLoads 19363
+NumOfGeps 44109
+NumOfLoads 20110
NumOfSCCDetect 23
NumOfSFRs 0
-NumOfStores 14307
-NumOfValidNode 67580
-NumOfValidObjNode 2752
-Pointers 197736
+NumOfStores 15054
+NumOfValidNode 69201
+NumOfValidObjNode 2786
+Pointers 199977
PointsToBlkPtr 0
-PointsToConstPtr 58794
+PointsToConstPtr 61014
SolveIterations 23
-StoreProcessed 81561640
+StoreProcessed 86026220
TotalCycleNum 408
-TotalObjects 8507
+TotalObjects 8514
TotalPWCCycleNum 35
-TotalPointers 197736
+TotalPointers 199977
#######################################################

Persistent Points-To Cache Statistics: Andersen's analysis bitvector
################ (program : nginx.bc)###############
-UniquePointsToSets 14762
-TotalUnions 589461
-PropertyUnions 149148
-UniqueUnions 8201
-LookupUnions 418580
-PreemptiveUnions 13532
-TotalComplements 1731373
-PropertyComplements 1381996
-UniqueComplements 6543
-LookupComplements 336293
-PreemptiveComplements 6541
-TotalIntersections 1796736
-PropertyIntersections 1783038
+UniquePointsToSets 14790
+TotalUnions 604094
+PropertyUnions 151968
+UniqueUnions 8217
+LookupUnions 430351
+PreemptiveUnions 13558
+TotalComplements 1773313
+PropertyComplements 1412523
+UniqueComplements 6562
+LookupComplements 347668
+PreemptiveComplements 6560
+TotalIntersections 1865742
+PropertyIntersections 1852006
UniqueIntersections 34
LookupIntersections 561
-PreemptiveIntersections 13103
+PreemptiveIntersections 13141
#######################################################

Memory SSA Statistics******
################ (program : nginx.bc)###############
----------------Time and memory stats--------------------
-AverageRegSize 39.1348
-GenMUCHITime 1.114
-GenRegionTime 92.358
-InsertPHITime 0.374
-SSARenameTime 0.026
-TotalMSSATime 93.874
+AverageRegSize 38.8404
+GenMUCHITime 1.126
+GenRegionTime 90.303
+InsertPHITime 0.418
+SSARenameTime 0.037
+TotalMSSATime 91.889
----------------Numbers stats----------------------------
BBHasMSSAPhi 4056
-CSChiNode 22213
+CSChiNode 22207
CSHasChi 4979
CSHasMu 5195
-CSMuNode 30142
-FunEntryChi 7507
+CSMuNode 30307
+FunEntryChi 7554
FunHasEntryChi 1222
FunHasRetMu 1390
-FunRetMu 7407
-LoadHasMu 19949
-LoadMuNode 45016
-MSSAPhi 18904
+FunRetMu 7454
+LoadHasMu 20696
+LoadMuNode 46878
+MSSAPhi 18903
MaxRegSize 1039
-MemRegions 1891
-StoreChiNode 22993
-StoreHasChi 12145
+MemRegions 1936
+StoreChiNode 24421
+StoreHasChi 12892
#######################################################

SVFG Statistics******
################ (program : nginx.bc)###############
----------------Time and memory stats--------------------
-ATNodeTime 0.206
-AvgWeight 198.378
+ATNodeTime 0.217
+AvgWeight 202.529
ConnDirEdgeTime 0
-ConnIndEdgeTime 1.31
+ConnIndEdgeTime 1.352
OptTime 0
TLNodeTime 0
-TotalTime 1.516
+TotalTime 1.569
----------------Numbers stats----------------------------
-ActualIn 30142
-ActualOut 22213
+ActualIn 30307
+ActualOut 22207
ActualParam 15885
ActualRet 2266
Addr 5909
@@ -266,27 +266,27 @@
AvgOutDegree 1
Copy 80
DirectCallEdge 9898
-DirectEdge 127800
+DirectEdge 131535
DirectRetEdge 1707
-FormalIn 7507
-FormalOut 7407
+FormalIn 7554
+FormalOut 7454
FormalParam 2621
FormalRet 379
-Gep 44042
-IndCallEdge 34618
-IndRetEdge 26287
-IndirectEdge 207431
-IndirectEdgeLabels 41149841
-Load 19949
-MSSAPhi 18904
+Gep 45536
+IndCallEdge 34781
+IndRetEdge 26279
+IndirectEdge 209765
+IndirectEdgeLabels 42483447
+Load 20696
+MSSAPhi 18903
MaxInDegree 1450
MaxIndInDeg 1450
MaxIndOutDeg 1369
MaxOutDegree 2027
PHI 2993
-Store 14929
-TotalEdge 335231
-TotalNode 195227
+Store 15676
+TotalEdge 341300
+TotalNode 198467
#######################################################

PTACallGraph Stats (Flow-sensitive analysis)******
@@ -307,32 +307,32 @@
----------------Time and memory stats--------------------
AddrTime 0
AverageSCCSize 17.0813
-AvgPtsSize 321.805
-AvgTopLvlPtsSize 651.143
-AvgVersionPtsSize 159.747
+AvgPtsSize 390.167
+AvgTopLvlPtsSize 653.693
+AvgVersionPtsSize 194.177
CopyTime 0
DirectPropaTime 0
GepTime 0
IndirectPropaTime 0
LoadTime 0
-MemoryUsageVmrss 4.79161e+06
-MemoryUsageVmsize 4.84196e+06
+MemoryUsageVmrss 4.934e+06
+MemoryUsageVmsize 4.97965e+06
PhiTime 0
-PrelabelingTime 0.16
+PrelabelingTime 0.174
ProcessTime 0
PropagationTime 0
SCCTime 0
-SolveTime 921.569
+SolveTime 864.737
StoreTime 0
Strong/WeakUpdTime 0
-TotalTime 994.052
+TotalTime 941.325
UpdateCGTime 0
VersionPropTime 0
-meldLabelingTime 69.681
+meldLabelingTime 73.702
----------------Numbers stats----------------------------
CopysNum 80
DummyFieldPtrs 1510
-FieldObjs 2442
+FieldObjs 2443
IndEdgeSolved 50000
LocalVarInRecur 2334
MaxPtsSize 1081
@@ -340,39 +340,39 @@
MaxTopLvlPtsSize 1081
MaxVersionPtsSize 1032
MaxVersionsForObj 0
-MemObjects 8507
+MemObjects 8514
NumOfNodesInSCC 11769
NumOfSCC 689
-Pointers 197736
+Pointers 199977
ProcessedAParam 0
ProcessedAddr 23636
ProcessedCopy 324
ProcessedFRet 0
-ProcessedGep 1031986
-ProcessedLoad 1294059
-ProcessedMSSANode 344692
-ProcessedPhi 86796
-ProcessedStore 687871
+ProcessedGep 1080750
+ProcessedLoad 1330058
+ProcessedMSSANode 345700
+ProcessedPhi 86753
+ProcessedStore 715568
SolveIterations 4
-StoresNum 14929
-StrongUpdates 282
+StoresNum 15676
+StrongUpdates 306
TotalEmptyVPts 0
-TotalExistingVPts 10127755
-TotalNonEmptyVPts 10127755
-TotalObjects 8507
-TotalPointers 197736
+TotalExistingVPts 10551486
+TotalNonEmptyVPts 10551486
+TotalObjects 8514
+TotalPointers 199977
TotalSingleVObjs 0
-TotalVersions 10218675
+TotalVersions 10668677
#######################################################

Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector
################ (program : nginx.bc)###############
-UniquePointsToSets 30238
-TotalUnions 1937479836
-PropertyUnions 1238077603
-UniqueUnions 108829
-LookupUnions 699155105
-PreemptiveUnions 138299
+UniquePointsToSets 30352
+TotalUnions 1977194714
+PropertyUnions 1248048346
+UniqueUnions 108704
+LookupUnions 728899469
+PreemptiveUnions 138195
TotalComplements 0
PropertyComplements 0
UniqueComplements 0

@yuleisui yuleisui merged commit 2ad1e2d into SVF-tools:master Feb 19, 2025
5 checks passed
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