Displaying 5 results from an estimated 5 matches for "update_array".
2013 Apr 24
8
[LLVMdev] Another missed optimization opportunity?
I was suprised to find that some bitcode I'm generating isn't getting
optimized. Here, I'm doing the equivalent of "myarray[5]++" (on an
"extern int *myarray"), repeated three times:
@myarray = external global i32*
define void @update_array() #0 {
%1 = load i32** @myarray, align 8
%2 = getelementptr inbounds i32* %1, i64 5
%3 = load i32* %2, align 4
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2, align 4
%5 = load i32** @myarray, align 8
%6 = getelementptr inbounds i32* %5, i64 5
%...
2013 Apr 24
0
[LLVMdev] Another missed optimization opportunity?
...getting
> optimized. Here, I'm doing the equivalent of "myarray[5]++" (on an
> "extern int *myarray"), repeated three times:
does your bitcode contain data layout information?
Ciao, Duncan.
>
> @myarray = external global i32*
>
> define void @update_array() #0 {
> %1 = load i32** @myarray, align 8
> %2 = getelementptr inbounds i32* %1, i64 5
> %3 = load i32* %2, align 4
> %4 = add nsw i32 %3, 1
> store i32 %4, i32* %2, align 4
> %5 = load i32** @myarray, align 8
> %6 = getelementp...
2013 Apr 24
0
[LLVMdev] Another missed optimization opportunity?
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Scott Pakin
> Subject: [LLVMdev] Another missed optimization opportunity?
> I'm doing the equivalent of "myarray[5]++" (on an
> "extern int *myarray"), repeated three times:
> I had expected the three increments by 1 to
> be collapsed into a single increment
2013 Apr 24
2
[LLVMdev] Another missed optimization opportunity?
...at could possibly be aliased.
Here are some additional observations that might be helpful in solving
this mystery:
1) The increments are in fact coalesced when myarray is declared as
an array instead of a pointer:
@myarray = external global [10 x i32]
define void @update_array() #0 {
%1 = load i32* getelementptr inbounds ([10 x i32]* @myarray, i64 0, i64 5), align 4
%2 = add nsw i32 %1, 3
store i32 %2, i32* getelementptr inbounds ([10 x i32]* @myarray, i64 0, i64 5), align 4
ret void
}
2) Both clang and g...
2013 Apr 24
0
[LLVMdev] Another missed optimization opportunity?
...I was suprised to find that some bitcode I'm generating isn't getting
> optimized. Here, I'm doing the equivalent of "myarray[5]++" (on an
> "extern int *myarray"), repeated three times:
>
> @myarray = external global i32*
>
> define void @update_array() #0 {
> %1 = load i32** @myarray, align 8
> %2 = getelementptr inbounds i32* %1, i64 5
> %3 = load i32* %2, align 4
> %4 = add nsw i32 %3, 1
> store i32 %4, i32* %2, align 4
> %5 = load i32** @myarray, align 8
> %6 = getelementptr inbo...