[llvm-branch-commits] [llvm] 5bec082 - VirtRegMap: Use Register

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 22 18:16:55 PST 2020


Author: Matt Arsenault
Date: 2020-12-22T20:56:14-05:00
New Revision: 5bec0828347893544ab863ddf4caa2f0b5ef79dd

URL: https://github.com/llvm/llvm-project/commit/5bec0828347893544ab863ddf4caa2f0b5ef79dd
DIFF: https://github.com/llvm/llvm-project/commit/5bec0828347893544ab863ddf4caa2f0b5ef79dd.diff

LOG: VirtRegMap: Use Register

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/VirtRegMap.h
    llvm/lib/CodeGen/LiveRangeEdit.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index 1775afb51bdf..deef4b90279a 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -151,7 +151,7 @@ class TargetInstrInfo;
     bool hasKnownPreference(Register VirtReg);
 
     /// records virtReg is a split live interval from SReg.
-    void setIsSplitFromReg(Register virtReg, unsigned SReg) {
+    void setIsSplitFromReg(Register virtReg, Register SReg) {
       Virt2SplitMap[virtReg.id()] = SReg;
       if (hasShape(SReg)) {
         Virt2ShapeMap[virtReg.id()] = getShape(SReg);
@@ -159,7 +159,7 @@ class TargetInstrInfo;
     }
 
     /// returns the live interval virtReg is split from.
-    unsigned getPreSplitReg(Register virtReg) const {
+    Register getPreSplitReg(Register virtReg) const {
       return Virt2SplitMap[virtReg.id()];
     }
 
@@ -167,8 +167,8 @@ class TargetInstrInfo;
     /// from through splitting.
     /// A register that was not created by splitting is its own original.
     /// This operation is idempotent.
-    unsigned getOriginal(unsigned VirtReg) const {
-      unsigned Orig = getPreSplitReg(VirtReg);
+    Register getOriginal(Register VirtReg) const {
+      Register Orig = getPreSplitReg(VirtReg);
       return Orig ? Orig : VirtReg;
     }
 

diff  --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index dbf02802d473..037cb5426235 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -435,7 +435,7 @@ void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead,
     if (!SplitLIs.empty())
       ++NumFracRanges;
 
-    unsigned Original = VRM ? VRM->getOriginal(VReg) : 0;
+    Register Original = VRM ? VRM->getOriginal(VReg) : Register();
     for (const LiveInterval *SplitLI : SplitLIs) {
       // If LI is an original interval that hasn't been split yet, make the new
       // intervals their own originals instead of referring to LI. The original


        


More information about the llvm-branch-commits mailing list