Displaying 4 results from an estimated 4 matches for "getnewloc".
Did you mean:
getendloc
2009 Jun 29
4
[LLVMdev] Limitations of Alias Analysis?
...rastructure", I
evaluated the AA performance by using the paramenters '-basicaa -ds-aa
-anders-aa'. The source code 'test.c' is listed as follow:
//------------=== Source code ===------------//
#include<stdlib.h>
typedef struct
{
int x;
int y;
} Location;
Location* getNewLocation(int x, int y)
{
Location* newLoc = (Location *)malloc(sizeof(Location));
newLoc->x = x;
newLoc->y = y;
return newLoc;
}
Location* getDifference(Location *a, Location *b)
{
Location* newLoc = (Location *)malloc(sizeof(Location));
newLoc->x = a->x - b->x;
newLoc->y...
2009 Jun 29
0
[LLVMdev] Limitations of Alias Analysis?
.... But in
> fact it's not.
>
> Maybe a flow-sensitive, context-sensitive alias analysis algorithm is
> needed to generate more precise result? Correct me, if I'm wrong. Thank
> you.
>
Running the functionattrs pass should be enough to add the 'noalias'
marker on getNewLocation(), and then even basic-aa can see that loc1 and
loc2 are NoAlias.
You also need to run -mem2reg, because otherwise -functionattrs doesn't
see that the return value is coming from a malloc (which already has
noalias attribute).
Best regards,
--Edwin
2009 Jun 30
2
[LLVMdev] Limitations of Alias Analysis?
...c -o mem2reg.bc
llvm-dis mem2reg.bc
opt -functionattrs -basicaa -aa-eval -print-all-alias-modref-info
mem2reg.bc
The content of main() in mem2reg.ll:
define i32 @main() nounwind {
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%0 = call %struct.Location* @getNewLocation(i32 0, i32 0) nounwind ; <
%struct.Location*> [#uses=2]
%1 = call %struct.Location* @getNewLocation(i32 1, i32 2) nounwind ; <
%struct.Location*> [#uses=2]
%2 = call %struct.Location* @sub(%struct.Location* %0, %
struct.Location* %1) nounwind ; <%struct.Location*> [#uses...
2009 Jun 29
0
[LLVMdev] Limitations of Alias Analysis?
Hi,
> llvm-gcc -emit-llvm -O0 -c test.c -o test.bc
try compiling with optimization.
Ciao,
Duncan.