From fd38917d4d040759d75e9d1f4e2c885fb40ba2d7 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sat, 19 Feb 2011 00:38:43 +0000 Subject: This method belonged in VirtRegMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126002 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/VirtRegMap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/CodeGen/VirtRegMap.h') diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index 23101ce74f..ba50f4e423 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -218,6 +218,15 @@ namespace llvm { return Virt2SplitMap[virtReg]; } + /// getOriginal - Return the original virtual register that VirtReg descends + /// 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); + return Orig ? Orig : VirtReg; + } + /// @brief returns true if the specified virtual register is not /// mapped to a stack slot or rematerialized. bool isAssignedReg(unsigned virtReg) const { -- cgit v1.2.3