Displaying 1 result from an estimated 1 matches for "wplmfr".
2019 Jul 08
4
Question on Aliasing and invariant load hoisting
...-snip--
struct st {
int a;
int b;
};
int * ptr;
int x,y;
void bar(int *x);
void foo() {
struct st obj;
bar(&obj.b);
if(x)
obj.a =x;
else
obj.a =y;
for (int i=0; i<obj.a;i++)
ptr[i]=i;
}
--snip--
LLVM IR produced at -O3 is shown below.
ref: https://godbolt.org/z/WPlmfr
--Snip--
%8 = getelementptr inbounds %struct.st, %struct.st* %1, i64 0, i32 0, !dbg !
39
store i32 %7, i32* %8, align 4, !dbg !40
call void @llvm.dbg.value(metadata i32 0, metadata !26, metadata !
DIExpression()), !dbg !41
%9 = icmp sgt i32 %7, 0, !dbg !42
br i1 %9, label %10, label %12, !dbg !44...