[llvm] r257129 - LiveInterval: A LiveRange is enough for ConnectedVNInfoEqClasses::Classify()

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 11:13:28 PST 2016


Matthias Braun via llvm-commits <llvm-commits at lists.llvm.org> writes:
> Author: matze
> Date: Thu Jan  7 19:16:35 2016
> New Revision: 257129
>
> URL: http://llvm.org/viewvc/llvm-project?rev=257129&view=rev
> Log:
> LiveInterval: A LiveRange is enough for ConnectedVNInfoEqClasses::Classify()
>
> Modified:
>     llvm/trunk/include/llvm/CodeGen/LiveInterval.h
>     llvm/trunk/lib/CodeGen/LiveInterval.cpp
>     llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
>     llvm/trunk/lib/CodeGen/MachineVerifier.cpp
>
> Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=257129&r1=257128&r2=257129&view=diff
> ==============================================================================
>
> --- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Thu Jan  7 19:16:35 2016
> @@ -848,9 +848,9 @@ namespace llvm {
>    public:
>      explicit ConnectedVNInfoEqClasses(LiveIntervals &lis) : LIS(lis) {}
>  
> -    /// Classify - Classify the values in LI into connected components.
> -    /// Return the number of connected components.
> -    unsigned Classify(const LiveInterval *LI);
> +    /// Classify the values in LI into connected components.
> +    /// Returns the number of connected components.
> +    unsigned Classify(const LiveRange &LR);

Looks like you missed s/LI/LR/ in the comment here.

>  
>      /// getEqClass - Classify creates equivalence classes numbered 0..N. Return
>      /// the equivalence class assigned the VNI.
>
> Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=257129&r1=257128&r2=257129&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Thu Jan  7 19:16:35 2016
> @@ -1328,15 +1328,15 @@ void LiveRangeUpdater::flush() {
>    LR->verify();
>  }
>  
> -unsigned ConnectedVNInfoEqClasses::Classify(const LiveInterval *LI) {
> +unsigned ConnectedVNInfoEqClasses::Classify(const LiveRange &LR) {
>    // Create initial equivalence classes.
>    EqClass.clear();
> -  EqClass.grow(LI->getNumValNums());
> +  EqClass.grow(LR.getNumValNums());
>  
>    const VNInfo *used = nullptr, *unused = nullptr;
>  
>    // Determine connections.
> -  for (const VNInfo *VNI : LI->valnos) {
> +  for (const VNInfo *VNI : LR.valnos) {
>      // Group all unused values into one class.
>      if (VNI->isUnused()) {
>        if (unused)
> @@ -1351,14 +1351,14 @@ unsigned ConnectedVNInfoEqClasses::Class
>        // Connect to values live out of predecessors.
>        for (MachineBasicBlock::const_pred_iterator PI = MBB->pred_begin(),
>             PE = MBB->pred_end(); PI != PE; ++PI)
> -        if (const VNInfo *PVNI = LI->getVNInfoBefore(LIS.getMBBEndIdx(*PI)))
> +        if (const VNInfo *PVNI = LR.getVNInfoBefore(LIS.getMBBEndIdx(*PI)))
>            EqClass.join(VNI->id, PVNI->id);
>      } else {
>        // Normal value defined by an instruction. Check for two-addr redef.
>        // FIXME: This could be coincidental. Should we really check for a tied
>        // operand constraint?
>        // Note that VNI->def may be a use slot for an early clobber def.
> -      if (const VNInfo *UVNI = LI->getVNInfoBefore(VNI->def))
> +      if (const VNInfo *UVNI = LR.getVNInfoBefore(VNI->def))
>          EqClass.join(VNI->id, UVNI->id);
>      }
>    }
>
> Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=257129&r1=257128&r2=257129&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Jan  7 19:16:35 2016
> @@ -1446,7 +1446,7 @@ void LiveIntervals::removeVRegDefAt(Live
>  void LiveIntervals::splitSeparateComponents(LiveInterval &LI,
>      SmallVectorImpl<LiveInterval*> &SplitLIs) {
>    ConnectedVNInfoEqClasses ConEQ(*this);
> -  unsigned NumComp = ConEQ.Classify(&LI);
> +  unsigned NumComp = ConEQ.Classify(LI);
>    if (NumComp <= 1)
>      return;
>    DEBUG(dbgs() << "  Split " << NumComp << " components: " << LI << '\n');
>
> Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=257129&r1=257128&r2=257129&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Jan  7 19:16:35 2016
> @@ -1736,7 +1736,7 @@ void MachineVerifier::verifyLiveInterval
>  
>    // Check the LI only has one connected component.
>    ConnectedVNInfoEqClasses ConEQ(*LiveInts);
> -  unsigned NumComp = ConEQ.Classify(&LI);
> +  unsigned NumComp = ConEQ.Classify(LI);
>    if (NumComp > 1) {
>      report("Multiple connected components in live interval", MF);
>      report_context(LI);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list