[llvm-dev] loop invariant code hoisting

Bardia Mahjour via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 7 07:38:27 PST 2020


Hi,

I think the issue is not specific to LICM and can be observed with other
transforms like the SCEV expander. This was brought up in one of the Loop
Optimization WG calls before
http://lists.llvm.org/pipermail/llvm-dev/2019-September/135058.html as
well. The general feedback at the time was that it would be better to deal
with the issue in the back-end perhaps through rematerialization of the
hoisted instructions in RA using LiveRangeEdit.

I don't have much in-depth knowledge in this area, but the blocker issue at
that time appeared to be that the register allocator could only
rematerialize single instructions and we needed groups of instructions to
be moved/copied. Does anyone know if any progress is under way in that
area?

Bardia Mahjour
Compiler Optimizations
IBM Toronto Software Lab




From:	Sjoerd Meijer via llvm-dev <llvm-dev at lists.llvm.org>
To:	"llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org>
Date:	2020/12/07 08:25 AM
Subject:	[EXTERNAL] [llvm-dev] loop invariant code hoisting
Sent by:	"llvm-dev" <llvm-dev-bounces at lists.llvm.org>



Hello, I would like to restrict LICM in the number of memory operations...
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                This Message Is From an External Sender     
                                This message came from outside your         
                                organization.                               
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            

Hello,

I would like to restrict LICM in the number of memory operations it hoists
out of a loop. Blindly hoisting out all instructions out could result in a
lot of spilling/reloading, which is what I'd like to avoid. We see this for
example on (inner)loops with small constant bounds that are unrolled. I am
drafting something in https://reviews.llvm.org/D92488, which contains a
reduced version of my motivating example.
It was brought to my attention that LICM might not have any restrictions by
design because hoisting out all instructions could be some sort of
canonical form that other passes depend on, so sinking back defs closer to
their user(s) might be a back-end problem. I was wondering if there are any
opinions on this.

Cheers,
Sjoerd._______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201207/1493ae47/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201207/1493ae47/attachment-0001.gif>


More information about the llvm-dev mailing list