aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorAkshay Khadse <akshayskhadse@gmail.com>2023-04-17 16:16:23 +0800
committerLuo, Yuanke <yuanke.luo@intel.com>2023-04-17 16:32:46 +0800
commit8bf7f86d7966ff835967669fb6bf23897e20b71d (patch)
treeac732355d5e16c7444bcf1a20c59ed65bcdab7c2 /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent83ab5708d1d00f4ec2541e960bff3b5c68001c9e (diff)
downloadllvm-8bf7f86d7966ff835967669fb6bf23897e20b71d.zip
llvm-8bf7f86d7966ff835967669fb6bf23897e20b71d.tar.gz
llvm-8bf7f86d7966ff835967669fb6bf23897e20b71d.tar.bz2
Fix uninitialized pointer members in CodeGen
This change initializes the members TSI, LI, DT, PSI, and ORE pointer feilds of the SelectOptimize class to nullptr. Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D148303
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 4f9f5de..e652105 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -353,15 +353,15 @@ class MachineBlockPlacement : public MachineFunctionPass {
/// Pair struct containing basic block and taildup profitability
struct BlockAndTailDupResult {
- MachineBasicBlock *BB;
+ MachineBasicBlock *BB = nullptr;
bool ShouldTailDup;
};
/// Triple struct containing edge weight and the edge.
struct WeightedEdge {
BlockFrequency Weight;
- MachineBasicBlock *Src;
- MachineBasicBlock *Dest;
+ MachineBasicBlock *Src = nullptr;
+ MachineBasicBlock *Dest = nullptr;
};
/// work lists of blocks that are ready to be laid out
@@ -372,32 +372,32 @@ class MachineBlockPlacement : public MachineFunctionPass {
DenseMap<const MachineBasicBlock *, BlockAndTailDupResult> ComputedEdges;
/// Machine Function
- MachineFunction *F;
+ MachineFunction *F = nullptr;
/// A handle to the branch probability pass.
- const MachineBranchProbabilityInfo *MBPI;
+ const MachineBranchProbabilityInfo *MBPI = nullptr;
/// A handle to the function-wide block frequency pass.
std::unique_ptr<MBFIWrapper> MBFI;
/// A handle to the loop info.
- MachineLoopInfo *MLI;
+ MachineLoopInfo *MLI = nullptr;
/// Preferred loop exit.
/// Member variable for convenience. It may be removed by duplication deep
/// in the call stack.
- MachineBasicBlock *PreferredLoopExit;
+ MachineBasicBlock *PreferredLoopExit = nullptr;
/// A handle to the target's instruction info.
- const TargetInstrInfo *TII;
+ const TargetInstrInfo *TII = nullptr;
/// A handle to the target's lowering info.
- const TargetLoweringBase *TLI;
+ const TargetLoweringBase *TLI = nullptr;
/// A handle to the post dominator tree.
- MachinePostDominatorTree *MPDT;
+ MachinePostDominatorTree *MPDT = nullptr;
- ProfileSummaryInfo *PSI;
+ ProfileSummaryInfo *PSI = nullptr;
/// Duplicator used to duplicate tails during placement.
///