diff options
-rw-r--r-- | llvm/include/llvm/Transforms/Scalar/GVN.h | 22 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/NewGVN.cpp | 18 |
3 files changed, 23 insertions, 23 deletions
diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h index 67c23b9c084..930969f9121 100644 --- a/llvm/include/llvm/Transforms/Scalar/GVN.h +++ b/llvm/include/llvm/Transforms/Scalar/GVN.h @@ -94,7 +94,7 @@ public: // value number to the index of Expression in Expressions. We use it // instead of a DenseMap because filling such mapping is faster than // filling a DenseMap and the compile time is a little better. - uint32_t nextExprNumber; + uint32_t nextExprNumber = 0; std::vector<Expression> Expressions; std::vector<uint32_t> ExprIdx; @@ -107,9 +107,9 @@ public: DenseMap<std::pair<uint32_t, const BasicBlock *>, uint32_t>; PhiTranslateMap PhiTranslateTable; - AliasAnalysis *AA; - MemoryDependenceResults *MD; - DominatorTree *DT; + AliasAnalysis *AA = nullptr; + MemoryDependenceResults *MD = nullptr; + DominatorTree *DT = nullptr; uint32_t nextValueNumber = 1; @@ -155,14 +155,14 @@ private: friend class gvn::GVNLegacyPass; friend struct DenseMapInfo<Expression>; - MemoryDependenceResults *MD; - DominatorTree *DT; - const TargetLibraryInfo *TLI; - AssumptionCache *AC; + MemoryDependenceResults *MD = nullptr; + DominatorTree *DT = nullptr; + const TargetLibraryInfo *TLI = nullptr; + AssumptionCache *AC = nullptr; SetVector<BasicBlock *> DeadBlocks; - OptimizationRemarkEmitter *ORE; - ImplicitControlFlowTracking *ICF; - LoopInfo *LI; + OptimizationRemarkEmitter *ORE = nullptr; + ImplicitControlFlowTracking *ICF = nullptr; + LoopInfo *LI = nullptr; ValueTable VN; diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 097c548f675..8c7ee9f0518 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -112,7 +112,7 @@ static cl::opt<uint32_t> MaxNumDeps( struct llvm::GVN::Expression { uint32_t opcode; - Type *type; + Type *type = nullptr; bool commutative = false; SmallVector<uint32_t, 4> varargs; @@ -173,7 +173,7 @@ struct llvm::gvn::AvailableValue { PointerIntPair<Value *, 2, ValType> Val; /// Offset - The byte offset in Val that is interesting for the load query. - unsigned Offset; + unsigned Offset = 0; static AvailableValue get(Value *V, unsigned Offset = 0) { AvailableValue Res; @@ -237,7 +237,7 @@ struct llvm::gvn::AvailableValue { /// the associated BasicBlock. struct llvm::gvn::AvailableValueInBlock { /// BB - The basic block in question. - BasicBlock *BB; + BasicBlock *BB = nullptr; /// AV - The actual available value AvailableValue AV; diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp index b213264de55..f49442b9cdd 100644 --- a/llvm/lib/Transforms/Scalar/NewGVN.cpp +++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -489,11 +489,11 @@ namespace { class NewGVN { Function &F; - DominatorTree *DT; - const TargetLibraryInfo *TLI; - AliasAnalysis *AA; - MemorySSA *MSSA; - MemorySSAWalker *MSSAWalker; + DominatorTree *DT = nullptr; + const TargetLibraryInfo *TLI = nullptr; + AliasAnalysis *AA = nullptr; + MemorySSA *MSSA = nullptr; + MemorySSAWalker *MSSAWalker = nullptr; const DataLayout &DL; std::unique_ptr<PredicateInfo> PredInfo; @@ -505,7 +505,7 @@ class NewGVN { const SimplifyQuery SQ; // Number of function arguments, used by ranking - unsigned int NumFuncArgs; + unsigned int NumFuncArgs = 0; // RPOOrdering of basic blocks DenseMap<const DomTreeNode *, unsigned> RPOOrdering; @@ -516,9 +516,9 @@ class NewGVN { // startsout in, and represents any value. Being an optimistic analysis, // anything in the TOP class has the value TOP, which is indeterminate and // equivalent to everything. - CongruenceClass *TOPClass; + CongruenceClass *TOPClass = nullptr; std::vector<CongruenceClass *> CongruenceClasses; - unsigned NextCongruenceNum; + unsigned NextCongruenceNum = 0; // Value Mappings. DenseMap<Value *, CongruenceClass *> ValueToClass; @@ -862,7 +862,7 @@ private: // Debug counter info. When verifying, we have to reset the value numbering // debug counter to the same state it started in to get the same results. - int64_t StartingVNCounter; + int64_t StartingVNCounter = 0; }; } // end anonymous namespace |