From ea1d9cdc4e4f4e4570acddb7c4a63f703b110dad Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 2 Apr 2008 18:04:08 +0000 Subject: Now that I am told MachineRegisterInfo also tracks physical register uses / defs, I can do away with the horribleness I introduced a while back. It's impossible to detect if there is any use of a physical register below an instruction (and before any def of the register) with some cheap book keeping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49105 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/LiveVariables.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/llvm/CodeGen') diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 1e49babe69..49fc90f00e 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -31,11 +31,13 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/ADT/BitVector.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" namespace llvm { +class MachineRegisterInfo; class TargetRegisterInfo; class LiveVariables : public MachineFunctionPass { @@ -128,6 +130,8 @@ private: private: // Intermediate data structures MachineFunction *MF; + MachineRegisterInfo* MRI; + const TargetRegisterInfo *TRI; // PhysRegInfo - Keep track of which instruction was the last def/use of a @@ -152,6 +156,10 @@ private: // Intermediate data structures SmallVector *PHIVarInfo; + // DistanceMap - Keep track the distance of a MI from the start of the + // current basic block. + DenseMap DistanceMap; + void addRegisterKills(unsigned Reg, MachineInstr *MI, SmallSet &SubKills); -- cgit v1.2.3-70-g09d2