[PATCH] Remove dead code from LoopUnswitch

Hal Finkel hfinkel at anl.gov
Fri Nov 8 12:03:54 PST 2013


----- Original Message -----
> ----- Original Message -----
> > 
> > On Oct 26, 2013, at 11:09 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> > 
> > > Chris, et al.,
> > > 
> > > LoopUnswitch's code simplification routine has code to convert
> > > conditional to unconditional branches, after unswitching makes
> > > the
> > > condition constant, and then remove any blocks that renders dead.
> > > Unfortunately, this code is dead, currently broken, and
> > > furthermore, has never been alive (at least as far back at 2006).
> > > I propose that, at least for now, we nuke it.

Dead code removal committed in r194277. Chris approved (in person).

 -Hal

> > > 
> > > Regarding the general functionality, I see (at least) two
> > > possible
> > > options:
> > > 
> > > 1. Fix/rewrite this functionality within LoopUnswitch
> > > 
> > > 2. Run SimplifyCFG after running LoopUnswitch: we currently run
> > > InstCombine after running LoopUnswitch, and so the loop pass
> > > manager is already done after running LoopUnswitch, and SE is
> > > already being invalidated by InstCombine, so it does not look
> > > like, if we added SimplifyCFG after InstCombine, we'd really lose
> > > much.
> > > 
> > > Thoughts?
> > 
> > Hi Hal,
> 
> Andy,
> 
> In retrospect, my phrasing of this question was bad. What I should
> have said is, "If we still want this functionality at this point in
> the pipeline..." -- I have no particular evidence that it is needed
> (although it looks like Chris thought that it was needed at some
> point in the "distant" past).
> 
> It sounds like you don't think it is needed, and we can just remove
> the current dead code.
> 
> > 
> > SimplifyCFG does run after Unswitch... way after. But at least it
> > will be rerun before any other loop opts, like Vectorizer. Actually
> > I think SCCP would catch this first.
> 
> Looks like jump threading catches some of them too.
> 
> > The problem with running SimplifyCFG in between loop pass managers
> > is
> > that it invalidates loop info.
> 
> Good point.
> 
> > 
> > Which pass are you concerned will see the dead blocks? GVN?
> 
> Idiom recognition?
> 
> > 
> > Long term I envision the pass order looking like: GVN -> Unswitch
> > ->
> > SCCP -> … -> LoopVectorize.
> 
> Sounds good.
> 
> Thanks again,
> Hal
> 
> > 
> > -Andy
> > 
> > 
> 
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

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




More information about the llvm-commits mailing list