[llvm-dev] LoopStrengthReduce.cpp

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 28 18:50:28 PDT 2016


Hi Jonas,

Are you talking specifically about the induction variable? You might look at what I did for PowerPC's counter-based loops (lib/Target/PowerPC/PPCCTRLoops.cpp, etc.).

 -Hal

----- Original Message -----
> From: "Jonas Paulsson via llvm-dev" <llvm-dev at lists.llvm.org>
> To: "llvm-dev" <llvm-dev at lists.llvm.org>
> Sent: Monday, March 28, 2016 8:02:40 AM
> Subject: [llvm-dev] LoopStrengthReduce.cpp
> 
> Hi,
> 
> I am looking for a way to rewrite induction variables to use an
> addition
> of -1 whenever possible (and not otherwise unprofitable). This is
> needed
> to utilize hardware loop instructions, which are present on SystemZ
> (branch on count). Later in the backend, an 'add -1; compare w/ 0;
> jne
> 0'-sequence can be replaced with a brct instruction.
> 
> I could not find any way in the LSR pass to generate a formula for
> this
> (neither to express the lower target cost). I would like to generate
> a
> formula with a step of -1 and make the cost for it to be less than
> that
> of a similar formula with another constant.
> 
> Could someone please give me any clue as to if there is a way to
> currently do this, or if not, what would be the normal way?
> 
> thanks,
> 
> Jonas paulsson
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 

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


More information about the llvm-dev mailing list