1919#include " llvm/CodeGen/MachineInstr.h"
2020#include " llvm/CodeGen/TargetRegisterInfo.h"
2121#include " llvm/IR/DebugInfoMetadata.h"
22+ #include " llvm/Support/Compiler.h"
2223#include < optional>
2324
2425#include " LiveDebugValues.h"
@@ -204,8 +205,8 @@ class ValueIDNum {
204205 .str ();
205206 }
206207
207- static ValueIDNum EmptyValue;
208- static ValueIDNum TombstoneValue;
208+ LLVM_ABI_FOR_TEST static ValueIDNum EmptyValue;
209+ LLVM_ABI_FOR_TEST static ValueIDNum TombstoneValue;
209210};
210211
211212} // End namespace LiveDebugValues
@@ -425,7 +426,7 @@ struct DbgOpID {
425426 DbgOpID (uint32_t RawID) : RawID(RawID) {}
426427 DbgOpID (bool IsConst, uint32_t Index) : ID({IsConst, Index}) {}
427428
428- static DbgOpID UndefID;
429+ LLVM_ABI_FOR_TEST static DbgOpID UndefID;
429430
430431 bool operator ==(const DbgOpID &Other) const { return RawID == Other.RawID ; }
431432 bool operator !=(const DbgOpID &Other) const { return !(*this == Other); }
@@ -788,8 +789,9 @@ class MLocTracker {
788789 value_type operator *() { return value_type (Idx, ValueMap[LocIdx (Idx)]); }
789790 };
790791
791- MLocTracker (MachineFunction &MF, const TargetInstrInfo &TII,
792- const TargetRegisterInfo &TRI, const TargetLowering &TLI);
792+ LLVM_ABI_FOR_TEST MLocTracker (MachineFunction &MF, const TargetInstrInfo &TII,
793+ const TargetRegisterInfo &TRI,
794+ const TargetLowering &TLI);
793795
794796 // / Produce location ID number for a Register. Provides some small amount of
795797 // / type safety.
@@ -903,7 +905,7 @@ class MLocTracker {
903905
904906 // / Create a LocIdx for an untracked register ID. Initialize it to either an
905907 // / mphi value representing a live-in, or a recent register mask clobber.
906- LocIdx trackRegister (unsigned ID);
908+ LLVM_ABI_FOR_TEST LocIdx trackRegister (unsigned ID);
907909
908910 LocIdx lookupOrTrackRegister (unsigned ID) {
909911 LocIdx &Index = LocIDToLocIdx[ID];
@@ -968,7 +970,8 @@ class MLocTracker {
968970 // / Find LocIdx for SpillLoc \p L, creating a new one if it's not tracked.
969971 // / Returns std::nullopt when in scenarios where a spill slot could be
970972 // / tracked, but we would likely run into resource limitations.
971- std::optional<SpillLocationNo> getOrTrackSpillLoc (SpillLoc L);
973+ LLVM_ABI_FOR_TEST std::optional<SpillLocationNo>
974+ getOrTrackSpillLoc (SpillLoc L);
972975
973976 // Get LocIdx of a spill ID.
974977 LocIdx getSpillMLoc (unsigned SpillID) {
@@ -1342,7 +1345,7 @@ class InstrRefBasedLDV : public LDVImpl {
13421345 // / in an MLocTracker. Convert the observations into a per-block transfer
13431346 // / function in \p MLocTransfer, suitable for using with the machine value
13441347 // / location dataflow problem.
1345- void
1348+ LLVM_ABI_FOR_TEST void
13461349 produceMLocTransferFunction (MachineFunction &MF,
13471350 SmallVectorImpl<MLocTransferMap> &MLocTransfer,
13481351 unsigned MaxNumBlocks);
@@ -1352,20 +1355,20 @@ class InstrRefBasedLDV : public LDVImpl {
13521355 // / live-out arrays to the (initialized to zero) multidimensional arrays in
13531356 // / \p MInLocs and \p MOutLocs. The outer dimension is indexed by block
13541357 // / number, the inner by LocIdx.
1355- void buildMLocValueMap (MachineFunction &MF, FuncValueTable &MInLocs,
1356- FuncValueTable &MOutLocs,
1357- SmallVectorImpl<MLocTransferMap> &MLocTransfer);
1358+ LLVM_ABI_FOR_TEST void
1359+ buildMLocValueMap (MachineFunction &MF, FuncValueTable &MInLocs,
1360+ FuncValueTable &MOutLocs,
1361+ SmallVectorImpl<MLocTransferMap> &MLocTransfer);
13581362
13591363 // / Examine the stack indexes (i.e. offsets within the stack) to find the
13601364 // / basic units of interference -- like reg units, but for the stack.
13611365 void findStackIndexInterference (SmallVectorImpl<unsigned > &Slots);
13621366
13631367 // / Install PHI values into the live-in array for each block, according to
13641368 // / the IDF of each register.
1365- void placeMLocPHIs (MachineFunction &MF,
1366- SmallPtrSetImpl<MachineBasicBlock *> &AllBlocks,
1367- FuncValueTable &MInLocs,
1368- SmallVectorImpl<MLocTransferMap> &MLocTransfer);
1369+ LLVM_ABI_FOR_TEST void placeMLocPHIs (
1370+ MachineFunction &MF, SmallPtrSetImpl<MachineBasicBlock *> &AllBlocks,
1371+ FuncValueTable &MInLocs, SmallVectorImpl<MLocTransferMap> &MLocTransfer);
13691372
13701373 // / Propagate variable values to blocks in the common case where there's
13711374 // / only one value assigned to the variable. This function has better
@@ -1422,12 +1425,13 @@ class InstrRefBasedLDV : public LDVImpl {
14221425 // / \p AssignBlocks contains the set of blocks that aren't in \p DILoc's
14231426 // / scope, but which do contain DBG_VALUEs, which VarLocBasedImpl tracks
14241427 // / locations through.
1425- void buildVLocValueMap (const DILocation *DILoc,
1426- const SmallSet<DebugVariableID, 4 > &VarsWeCareAbout,
1427- SmallPtrSetImpl<MachineBasicBlock *> &AssignBlocks,
1428- LiveInsT &Output, FuncValueTable &MOutLocs,
1429- FuncValueTable &MInLocs,
1430- SmallVectorImpl<VLocTracker> &AllTheVLocs);
1428+ LLVM_ABI_FOR_TEST void
1429+ buildVLocValueMap (const DILocation *DILoc,
1430+ const SmallSet<DebugVariableID, 4 > &VarsWeCareAbout,
1431+ SmallPtrSetImpl<MachineBasicBlock *> &AssignBlocks,
1432+ LiveInsT &Output, FuncValueTable &MOutLocs,
1433+ FuncValueTable &MInLocs,
1434+ SmallVectorImpl<VLocTracker> &AllTheVLocs);
14311435
14321436 // / Attempt to eliminate un-necessary PHIs on entry to a block. Examines the
14331437 // / live-in values coming from predecessors live-outs, and replaces any PHIs
@@ -1436,16 +1440,17 @@ class InstrRefBasedLDV : public LDVImpl {
14361440 // / \p LiveIn Old live-in value, overwritten with new one if live-in changes.
14371441 // / \returns true if any live-ins change value, either from value propagation
14381442 // / or PHI elimination.
1439- bool vlocJoin (MachineBasicBlock &MBB, LiveIdxT &VLOCOutLocs,
1440- SmallPtrSet<const MachineBasicBlock *, 8 > &BlocksToExplore,
1441- DbgValue &LiveIn);
1443+ LLVM_ABI_FOR_TEST bool
1444+ vlocJoin (MachineBasicBlock &MBB, LiveIdxT &VLOCOutLocs,
1445+ SmallPtrSet<const MachineBasicBlock *, 8 > &BlocksToExplore,
1446+ DbgValue &LiveIn);
14421447
14431448 // / For the given block and live-outs feeding into it, try to find
14441449 // / machine locations for each debug operand where all the values feeding
14451450 // / into that operand join together.
14461451 // / \returns true if a joined location was found for every value that needed
14471452 // / to be joined.
1448- bool
1453+ LLVM_ABI_FOR_TEST bool
14491454 pickVPHILoc (SmallVectorImpl<DbgOpID> &OutValues, const MachineBasicBlock &MBB,
14501455 const LiveIdxT &LiveOuts, FuncValueTable &MOutLocs,
14511456 const SmallVectorImpl<const MachineBasicBlock *> &BlockOrders);
@@ -1461,7 +1466,7 @@ class InstrRefBasedLDV : public LDVImpl {
14611466
14621467 // / Boilerplate computation of some initial sets, artifical blocks and
14631468 // / RPOT block ordering.
1464- void initialSetup (MachineFunction &MF);
1469+ LLVM_ABI_FOR_TEST void initialSetup (MachineFunction &MF);
14651470
14661471 // / Produce a map of the last lexical scope that uses a block, using the
14671472 // / scopes DFSOut number. Mapping is block-number to DFSOut.
@@ -1490,7 +1495,7 @@ class InstrRefBasedLDV : public LDVImpl {
14901495
14911496public:
14921497 // / Default construct and initialize the pass.
1493- InstrRefBasedLDV ();
1498+ LLVM_ABI_FOR_TEST InstrRefBasedLDV ();
14941499
14951500 LLVM_DUMP_METHOD
14961501 void dump_mloc_transfer (const MLocTransferMap &mloc_transfer) const ;
0 commit comments