Hello,
I have been using cclyzer for running points-to analyses on some C programs. I have run into a potential issue. I have been looking at the results in pointer-dereferences.tsv for the following C program:
#include <stdlib.h>
int execute(double *b) {
double k = *b;
return (int)k;
}
int main(int argc, char *argv[])
{
double *t = (double *)NULL;
execute(t);
return 0;
}
When I run cclyzer, it tells me that %t in main and %1 in execute are both pointers to *null*, which is what I expected.
When I apply the LLVM -mem2reg optimization to the C code, I get the following IR code:
; Function Attrs: nounwind uwtable
define i32 @execute(double* %b) #0 {
%1 = load double, double* %b, align 8
%2 = fptosi double %1 to i32
ret i32 %2
}
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 {
%1 = call i32 @execute(double* null)
ret i32 0
}
In this code snippet, %1 is a pointer dereference to null. However, pointer-dereferences.tsv does not contain any dereferences after analyzing this code with cclyzer. Is it possible to expand the points-to analysis to account for loading from a pointer that does not have an associated alloca instruction (i.e. using mem2reg to promote memory operations to register operations)?
Thanks,
Leo
Hello,
I have been using cclyzer for running points-to analyses on some C programs. I have run into a potential issue. I have been looking at the results in
pointer-dereferences.tsvfor the following C program:When I run cclyzer, it tells me that
%tin main and%1in execute are both pointers to *null*, which is what I expected.When I apply the LLVM
-mem2regoptimization to the C code, I get the following IR code:In this code snippet,
%1is a pointer dereference to null. However,pointer-dereferences.tsvdoes not contain any dereferences after analyzing this code with cclyzer. Is it possible to expand the points-to analysis to account for loading from a pointer that does not have an associatedallocainstruction (i.e. usingmem2regto promote memory operations to register operations)?Thanks,
Leo