[llvm-dev] Pre/post-increment addressing mode in LSR

73 views
Skip to first unread message

Jamie Hanlon via llvm-dev

unread,
Jan 23, 2017, 8:01:42 AM1/23/17
to llvm...@lists.llvm.org, Jon Chesterfield

Dear all,

 

From what I can gather, there is currently no way for loop strength reduction to target pre- and post-increment addressing modes. This is because the target hook `isLegalAddressingMode` in TargetTransformInfo.h doesn’t allow for pre- and post-increment. There is in fact a comment to that effect on the function prototype: “TODO: handle pre/postinc as well” (see http://llvm.org/docs/doxygen/html/TargetTransformInfo_8h_source.html line 310).

 

So I was wondering: is there a way to work around this limitation? And are there any plans to add support for pre- and post-increment addressing modes?

 

Thanks in advance for any help on this.

 

Jamie Hanlon (from Graphcore, www.graphcore.ai)

Hal Finkel via llvm-dev

unread,
Jan 23, 2017, 9:10:36 AM1/23/17
to Jamie Hanlon, llvm...@lists.llvm.org, Jon Chesterfield



On 01/23/2017 05:52 AM, Jamie Hanlon via llvm-dev wrote:

Dear all,

 

From what I can gather, there is currently no way for loop strength reduction to target pre- and post-increment addressing modes. This is because the target hook `isLegalAddressingMode` in TargetTransformInfo.h doesn’t allow for pre- and post-increment. There is in fact a comment to that effect on the function prototype: “TODO: handle pre/postinc as well” (see http://llvm.org/docs/doxygen/html/TargetTransformInfo_8h_source.html line 310).

 

So I was wondering: is there a way to work around this limitation? And are there any plans to add support for pre- and post-increment addressing modes?


It is, unfortunately, a long-standing deficiency. There are some work-arounds in some targets (e.g. lib/Target/PowerPC/PPCLoopPreIncPrep.cpp), but work on this would be appreciated.

 -Hal

 

Thanks in advance for any help on this.

 

Jamie Hanlon (from Graphcore, www.graphcore.ai)



_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

Jamie Hanlon via llvm-dev

unread,
Jan 23, 2017, 10:14:24 AM1/23/17
to Hal Finkel, llvm...@lists.llvm.org, Jon Chesterfield

Thanks for the clarification Hal, that’s really useful. We will be sure to upstream any generic work we do on this.

 

Jamie

Reply all
Reply to author
Forward
0 new messages