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

Hao Liu Hao.Liu at arm.com
Wed Oct 22 00:23:11 PDT 2014


Hi James,

 

I think there are two main reasons this approach is outside of CGP:

(1)    I want to make use of the constant extraction logic in SeparateConstOffsetFromGEP pass. It can find more constants 

(2)    CGP only sinks GEPs, it doesn’t do CSE. So I think it’s better to do such logic separately in SeparateConstOffsetFromGEP pass before CGP. This won’t affect the address sinking logic in CGP.

 

Thanks,

-Hao

 

From: mankeyrabbit at gmail.com [mailto:mankeyrabbit at gmail.com] On Behalf Of James Molloy
Sent: Wednesday, October 22, 2014 4:01 AM
To: reviews+D5864+public+2de5fd757ea4c578 at reviews.llvm.org
Cc: Hao Liu; t.p.northover at gmail.com; jingyue at google.com; llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] [AArch64] Improve and enable the SeparateConstOffsetFromGEP for AArch64 backend.

 

Hi Hao,

 

It's great to finally see this go upstream!

 

When you started working on this, the approach was to modify the GEP lowering logic in CGP. Hal's comment has reminded me that your approach has moved away from that, so could you please explain why you're doing this outside of CGP, and why your solution does not duplicate the CGP lowering code?

 

How do they interact?

 

Cheers,

 

James


On Tuesday, 21 October 2014, hfinkel at anl.gov <hfinkel at anl.gov> wrote:

> And most important is that it will also transform complex GEPs into a "ptrtoint + arithmetic + inttoptr" form, so that it is able to find CSE opportunities across basic blocks.

You'll need to disable this transformation when AA is enabled in CodeGen. You can do this just like CGP does (essentially by calling TM->getSubtarget<TargetSubtargetInfo>().useAA()). CGP splits the GEPs into simpler GEPs when AA is in use, and uses inttoptr otherwise. This all relates to the way that we use BasicAA to override TBAA and catch cases of basic type punning -- but BasicAA does not analyze inttoptr, and so can no longer fulfill this need after new inttoptrs are introduced. You could try using simpler GEPs like CGP does when AA is in use, or just disable this part of the transformation for now. Either is fine with me.

http://reviews.llvm.org/D5864



_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu <javascript:;> 
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141022/f40c3609/attachment.html>


More information about the llvm-commits mailing list