[PATCH] D59626: [AMDGPU] Add MachineDCE pass after RenameIndependentSubregs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 12:37:28 PDT 2019


rampitec added a comment.

In D59626#1460173 <https://reviews.llvm.org/D59626#1460173>, @rampitec wrote:

> In D59626#1460006 <https://reviews.llvm.org/D59626#1460006>, @bjope wrote:
>
> > For the record, I think the "multiple connected components" problem could have been solved by something like this after the call to "createAndComputeVirtRegInterval"
> >
> >   LiveInterval &LI = LIS->getInterval(Reg);
> >   assert(Reg == LI.reg && "Invalid reg to interval mapping");
> >   if (TargetRegisterInfo::isVirtualRegister(LI.reg)) {
> >     // Check whether or not LI is composed by multiple connected
> >     // components and if that is the case, fix that.
> >     SmallVector<LiveInterval*, 8> SplitLIs;
> >     LIS->splitSeparateComponents(LI, SplitLIs);
> >   }
> >   
> >
> > However, that still leaves the questions about if the pass should do less optimizations related to physregs when LIS is available, or how to preserve LIS if optimizing on physregs.
> >  And I'm not sure about the cost of using splitSeparateComponents compared to a full recompute.
>
>
> For the record, this code works if applied after createAndComputeVirtRegInterval() call.


The problem with phys regs is that I see no way to recompute liveins. If I remove reg units for affected register they are reconstructed on the next query. However if it was a livein I will drop it as well, and it is only recomputed in private LiveIntervals::computeLiveInRegUnits(), which is only called from LiveIntervals::runOnMachineFunction()...


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59626/new/

https://reviews.llvm.org/D59626





More information about the llvm-commits mailing list