search for: sp_2_ptr

Displaying 4 results from an estimated 4 matches for "sp_2_ptr".

Did you mean: sp_1_ptr
2016 Feb 10
4
Memory Store/Load Optimization Issue (Emulating stack)
...ptr: define { i32, i32, i8* } @test(i32 %foo, i32 %bar, i8* %sp) { entry: ; push foo (On "stack") %sp_1 = getelementptr i8, i8* %sp, i32 -4 %sp_1_ptr = bitcast i8* %sp_1 to i32* store i32 %foo, i32* %sp_1_ptr, align 4 ; push bar %sp_2 = getelementptr i8, i8* %sp_1, i32 -4 %sp_2_ptr = bitcast i8* %sp_2 to i32* store i32 %bar, i32* %sp_2_ptr, align 4 ; val1 = pop (val1 = bar) %sp_3_ptr = bitcast i8* %sp_2 to i32* %val1 = load i32, i32* %sp_3_ptr, align 4 %sp_3 = getelementptr i8, i8* %sp_2, i32 4 ; val2 = pop (val2 = foo) %sp_4_ptr = bitcast i8* %sp_3 to i32*...
2016 Feb 10
2
Memory Store/Load Optimization Issue (Emulating stack)
...add esp, 2 push ecx ... ; push foo (On "stack") %sp_1 = getelementptr i8, i8* %sp, i32 -4 %sp_1_ptr = bitcast i8* %sp_1 to i32* store i32 %foo, i32* %sp_1_ptr, align 4 %sp_x = getelementptr i8, i8* %sp_1, i32 2 ; push bar %sp_2 = getelementptr i8, i8* %sp_x, i32 -4 %sp_2_ptr = bitcast i8* %sp_2 to i32* store i32 %bar, i32* %sp_2_ptr, align 4 Both objects (eax, ecx) will overlap because of the size difference (eax = i32). What are the consequences when doing this. Will this break alias analysis for the further instructions? 2016-02-10 21:24 GMT+01:00 Daniel Berlin &...
2016 Feb 08
2
Memory Store/Load Optimization Issue (Emulating stack)
...plify (reduce junk) the code. The LLVM IR code: define { i32, i32, i32 } @test(i32 %foo, i32 %bar, i32 %sp) { ; push foo (On "stack") %sp_1 = sub i32 %sp, 4 %sp_1_ptr = inttoptr i32 %sp_1 to i32* store i32 %foo, i32* %sp_1_ptr, align 4 ; push bar %sp_2 = sub i32 %sp_1, 4 %sp_2_ptr = inttoptr i32 %sp_2 to i32* store i32 %bar, i32* %sp_2_ptr, align 4 ; val1 = pop (val1 = bar) %sp_3_ptr = inttoptr i32 %sp_2 to i32* %val1 = load i32, i32* %sp_3_ptr, align 4 %sp_3 = add i32 %sp_2, 4 ; val2 = pop (val2 = foo) %sp_4_ptr = inttoptr i32 %sp_3 to i32* %val2 = load i3...
2016 Feb 12
2
Memory Store/Load Optimization Issue (Emulating stack)
...ry: >> ; push foo (On "stack") >> %sp_1 = getelementptr i8, i8* %sp, i32 -4 >> %sp_1_ptr = bitcast i8* %sp_1 to i32* >> store i32 %foo, i32* %sp_1_ptr, align 4 >> >> ; push bar >> %sp_2 = getelementptr i8, i8* %sp_1, i32 -4 >> %sp_2_ptr = bitcast i8* %sp_2 to i32* >> store i32 %bar, i32* %sp_2_ptr, align 4 >> >> ; val1 = pop (val1 = bar) >> %sp_3_ptr = bitcast i8* %sp_2 to i32* >> %val1 = load i32, i32* %sp_3_ptr, align 4 >> %sp_3 = getelementptr i8, i8* %sp_2, i32 4 >> >>...