From 06fa17c1c232d748e310ff987e41a5318635d9dd Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Tue, 19 Mar 2002 00:59:08 +0000 Subject: [PATCH] Big bug fix: killed uses were being inserted instead of erased! Also added a set of debug options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1917 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../Analysis/LiveVar/FunctionLiveVarInfo.h | 21 ++++++++++++------- include/llvm/CodeGen/FunctionLiveVarInfo.h | 21 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h index 41e7b1d5cf6..87853345724 100644 --- a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h +++ b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h @@ -61,17 +61,24 @@ #ifndef METH_LIVE_VAR_INFO_H #define METH_LIVE_VAR_INFO_H -// set DEBUG_LV for printing out debug messages -// if DEBUG_LV is 1 normal output messages -// if DEBUG_LV is 2 extensive debug info for each instr - -static const int DEBUG_LV = 0; - #include "llvm/Pass.h" #include "llvm/Analysis/LiveVar/ValueSet.h" +#include "Support/CommandLine.h" + class BBLiveVar; class MachineInstr; + +enum LiveVarDebugLevel_t { + LV_DEBUG_None, + LV_DEBUG_Normal, + LV_DEBUG_Instr, + LV_DEBUG_Verbose +}; + +extern cl::Enum DEBUG_LV; + + class MethodLiveVarInfo : public MethodPass { // Machine Instr to LiveVarSet Map for providing LVset BEFORE each inst std::map MInst2LVSetBI; @@ -88,7 +95,7 @@ class MethodLiveVarInfo : public MethodPass { void constructBBs(const Method *M); // do one backward pass over the CFG - bool doSingleBackwardPass(const Method *M); + bool doSingleBackwardPass(const Method *M, unsigned int iter); // calculates live var sets for instructions in a BB void calcLiveVarSetsForBB(const BasicBlock *BB); diff --git a/include/llvm/CodeGen/FunctionLiveVarInfo.h b/include/llvm/CodeGen/FunctionLiveVarInfo.h index 41e7b1d5cf6..87853345724 100644 --- a/include/llvm/CodeGen/FunctionLiveVarInfo.h +++ b/include/llvm/CodeGen/FunctionLiveVarInfo.h @@ -61,17 +61,24 @@ #ifndef METH_LIVE_VAR_INFO_H #define METH_LIVE_VAR_INFO_H -// set DEBUG_LV for printing out debug messages -// if DEBUG_LV is 1 normal output messages -// if DEBUG_LV is 2 extensive debug info for each instr - -static const int DEBUG_LV = 0; - #include "llvm/Pass.h" #include "llvm/Analysis/LiveVar/ValueSet.h" +#include "Support/CommandLine.h" + class BBLiveVar; class MachineInstr; + +enum LiveVarDebugLevel_t { + LV_DEBUG_None, + LV_DEBUG_Normal, + LV_DEBUG_Instr, + LV_DEBUG_Verbose +}; + +extern cl::Enum DEBUG_LV; + + class MethodLiveVarInfo : public MethodPass { // Machine Instr to LiveVarSet Map for providing LVset BEFORE each inst std::map MInst2LVSetBI; @@ -88,7 +95,7 @@ class MethodLiveVarInfo : public MethodPass { void constructBBs(const Method *M); // do one backward pass over the CFG - bool doSingleBackwardPass(const Method *M); + bool doSingleBackwardPass(const Method *M, unsigned int iter); // calculates live var sets for instructions in a BB void calcLiveVarSetsForBB(const BasicBlock *BB); -- 2.34.1