diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp | |
parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) |
Notes
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp index a82501cabb9bf..5b61d1084e08a 100644 --- a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp +++ b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp @@ -134,11 +134,21 @@ namespace { uint32_t properties() const; unsigned size() const { return Size; } - LatticeCell &operator= (const LatticeCell &L) { + LatticeCell(const LatticeCell &L) { + // This memcpy also copies Properties (when L.Size == 0). + uint32_t N = + L.IsSpecial ? sizeof L.Properties : L.Size * sizeof(const Constant *); + memcpy(Values, L.Values, N); + Kind = L.Kind; + Size = L.Size; + IsSpecial = L.IsSpecial; + } + + LatticeCell &operator=(const LatticeCell &L) { if (this != &L) { // This memcpy also copies Properties (when L.Size == 0). uint32_t N = L.IsSpecial ? sizeof L.Properties - : L.Size*sizeof(const Constant*); + : L.Size * sizeof(const Constant *); memcpy(Values, L.Values, N); Kind = L.Kind; Size = L.Size; @@ -260,7 +270,7 @@ namespace { void propagate(MachineFunction &MF); bool rewrite(MachineFunction &MF); - MachineRegisterInfo *MRI; + MachineRegisterInfo *MRI = nullptr; MachineConstEvaluator &MCE; using CFGEdge = std::pair<unsigned, unsigned>; |