[PATCH] D21496: LoadCombine Load Aliasing Fix
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 18 19:02:56 PDT 2016
eli.friedman added inline comments.
================
Comment at: /Users/rriddle/Desktop/llvm/llvm/test/Transforms/LoadCombine/load-combine-alias.ll:12
@@ +11,3 @@
+ %i1 = getelementptr inbounds %struct.Str, %struct.Str* %1, i64 0, i32 0
+ store i32 %0, i32* %i1, align 4
+ %add.ptr = getelementptr inbounds i32, i32* %i, i64 1
----------------
rriddle wrote:
> eli.friedman wrote:
> > What transform is this testcase checking for? I don't think you can prove any useful aliasing property between %i, %i1, and %str?
> In the current implementation %1 is being aliased in that store operation which would cause every load chain to try and combine which would prevent the load at %0 from being able to combine with %2, %4, etc.
>
I'm not sure I follow... is the transform you're trying to perform something like this?
```
void f(int* a, int* b) {
a[0] = b[0];
a[1] = b[1];
a[2] = b[2];
a[3] = b[3];
// Combine to "memcpy(a, b, 16)"???
}
```
http://reviews.llvm.org/D21496
More information about the llvm-commits
mailing list