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

Hal Finkel hfinkel at anl.gov
Fri Oct 24 05:27:47 PDT 2014


----- Original Message -----
> From: "Hao Liu" <Hao.Liu at arm.com>
> To: "Hao Liu" <Hao.Liu at arm.com>, "t p northover" <t.p.northover at gmail.com>, jingyue at google.com,
> ssijaric at codeaurora.org, mcrosier at codeaurora.org
> Cc: hfinkel at anl.gov, "amara emerson" <amara.emerson at arm.com>, llvm-commits at cs.uiuc.edu
> Sent: Friday, October 24, 2014 3:25:14 AM
> Subject: Re: [PATCH] [AArch64] Improve and enable the SeparateConstOffsetFromGEP for AArch64 backend.
> 
> Hi Hal,
> 
> A new patch has been attached according to your comments.
> BTW. For the inbounds issue, the CGP just ignores it when creating
> new GEP/MUL/ADD, so I think maybe it is a minor problem in CGP.

FWIW, we only recently started propagating NSW/NUW into the SelectionDAG layer. We should add a FIXME (or just fix this) in CGP too.

> 
> >>! In D5864#17, @hfinkel wrote:
> > This generally looks good to me. It would be good to have someone
> > expert in this pass to also look it over.
> > 
> >> the performance test has not finished yet. But the assembly code
> >> looks similar to the old patch for cortex-a57. If the result is
> >> better than the old patch, I'll remove the logic about
> >> transformation to ptrtoint/inttoptr.
> > 
> > I am curious how this turns out; please let us know.
> I think this is because ptrtoint/inttoptr is similar to GEP.
> According to
> http://llvm.org/docs/GetElementPtr.html#how-is-gep-different-from-ptrtoint-arithmetic-and-inttoptr,
> the most difference is that GEP carries additional pointer aliasing
> rules. Also as the AA used in CodeGen doesn't change to much thing,
> so the assembly code is similar. It's just my guess. Two version
> still has much difference in instruction order.

Yep; I recommend testing the difference independently of enabling AA. (In CGP, as I imagine you noticed, I also have a separate flag for this purpose).

 -Hal

> 
> Thanks,
> -Hao
> 
> http://reviews.llvm.org/D5864
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list