[PATCH] [AArch64] Improve and enable the SeparateConstOffsetFromGEP for AArch64 backend.

Hao Liu Hao.Liu at arm.com
Sun Nov 2 17:25:12 PST 2014


>>! In D5864#35, @jingyue wrote:
> I mean the issue we spotted previously with the following example:
> ```
> struct S {
>   int a[4]; // sizeof(int) = 4
>   double b[8]; // sizeof(double) = 8
> };
> 
> %s = alloca struct %S
> %p = getelementptr %s, 0, 1, i ; &s.b[i] = s + 4*sizeof(int) + i*sizeof(double)
> ```
> 
> I thought we agreed that your diff had a correctness issue with this example, and I didn't see any change to fix that issue in your latest diff. Am I missing something? 

Sorry, my words misled you. I said "we can transform it to either of two simpler forms", I meant this patch had already done like that.
The correctness issue has already been solved in the first patch. See more details in transformToSimplerGEPs(), which does the same as my explanation. Transformation to simpler GEPs is similar to transformation to arithmetic operations. It just replace ADDs by GEPs. So your concern about correctness issue has already been resolved. Also I have two test cases to test structure indices.

Thanks,
-Hao

http://reviews.llvm.org/D5864






More information about the llvm-commits mailing list