[PATCH] D20027: [RegAlloc, NFC] Extract LastSplitPoint computation to a new class
Wei Mi via llvm-commits
llvm-commits at lists.llvm.org
Fri May 6 15:14:26 PDT 2016
wmi added a comment.
Address Matthias's comments.
================
Comment at: lib/CodeGen/SplitKit.h:41-44
@@ -40,1 +40,6 @@
+/// Analyze the last point in BB to insert split with respect to current
+/// LiveInterval. HoistSpillHelper also depends on the same analysis to find
+/// the last point to insert spill.
+class LLVM_LIBRARY_VISIBILITY LSplitPointAnalysis {
+private:
----------------
I renamed LSplitPointAnalysis to InsertPointAnalysis and changed related fields and comments.
================
Comment at: lib/CodeGen/SplitKit.h:47
@@ +46,3 @@
+ const MachineFunction &MF;
+ const VirtRegMap &VRM;
+ const LiveIntervals &LIS;
----------------
Removed.
================
Comment at: lib/CodeGen/SplitKit.h:50
@@ +49,3 @@
+
+ // Current LiveInterval to split or spill.
+ const LiveInterval *CurLI;
----------------
Fixed.
================
Comment at: lib/CodeGen/SplitKit.h:61
@@ +60,3 @@
+ LSplitPointAnalysis(const VirtRegMap &vrm, const LiveIntervals &lis);
+
+ void setInterval(const LiveInterval *LI) { CurLI = LI; }
----------------
CurLI is usually not initialized when constructor is called. It is setup in the process of split/spill and reset from time to time. So I feel const LiveInterval *CurLI is easier here.
================
Comment at: lib/CodeGen/SplitKit.h:63
@@ +62,3 @@
+ void setInterval(const LiveInterval *LI) { CurLI = LI; }
+
+ /// getLastSplitPoint - Return the base index of the last valid split point
----------------
Done.
================
Comment at: lib/CodeGen/SplitKit.h:76
@@ +75,3 @@
+ MachineBasicBlock::iterator getLastSplitPointIter(MachineBasicBlock *);
+};
+
----------------
Done.
================
Comment at: lib/CodeGen/SplitKit.h:217
@@ -197,1 +216,3 @@
bool shouldSplitSingleBlock(const BlockInfo &BI, bool SingleInstrs) const;
+
+ SlotIndex getLastSplitPoint(unsigned Num) {
----------------
Fixed.
Repository:
rL LLVM
http://reviews.llvm.org/D20027
More information about the llvm-commits
mailing list