[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / llvm / lib / CodeGen / LiveDebugVariables.h
blob9998ce9e8dad861d82d8f7ce41870d66a4d564e3
1 //===- LiveDebugVariables.h - Tracking debug info variables -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides the interface to the LiveDebugVariables analysis.
11 // The analysis removes DBG_VALUE instructions for virtual registers and tracks
12 // live user variables in a data structure that can be updated during register
13 // allocation.
15 // After register allocation new DBG_VALUE instructions are emitted to reflect
16 // the new locations of user variables.
18 //===----------------------------------------------------------------------===//
20 #ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
21 #define LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H
23 #include "llvm/CodeGen/MachineFunctionPass.h"
24 #include "llvm/Support/Compiler.h"
26 namespace llvm {
28 template <typename T> class ArrayRef;
29 class LiveIntervals;
30 class VirtRegMap;
32 class LLVM_LIBRARY_VISIBILITY LiveDebugVariables : public MachineFunctionPass {
33 void *pImpl = nullptr;
35 public:
36 static char ID; // Pass identification, replacement for typeid
38 LiveDebugVariables();
39 ~LiveDebugVariables() override;
41 /// splitRegister - Move any user variables in OldReg to the live ranges in
42 /// NewRegs where they are live. Mark the values as unavailable where no new
43 /// register is live.
44 void splitRegister(Register OldReg, ArrayRef<Register> NewRegs,
45 LiveIntervals &LIS);
47 /// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
48 /// that happened during register allocation.
49 /// @param VRM Rename virtual registers according to map.
50 void emitDebugValues(VirtRegMap *VRM);
52 /// dump - Print data structures to dbgs().
53 void dump() const;
55 private:
56 bool runOnMachineFunction(MachineFunction &) override;
57 void releaseMemory() override;
58 void getAnalysisUsage(AnalysisUsage &) const override;
60 MachineFunctionProperties getSetProperties() const override {
61 return MachineFunctionProperties().set(
62 MachineFunctionProperties::Property::TracksDebugUserValues);
66 } // end namespace llvm
68 #endif // LLVM_LIB_CODEGEN_LIVEDEBUGVARIABLES_H