Skip to content

Commit 4b97642

Browse files
committed
Fixes to be upstreamed - 10
1. add support for DumpRegUsage in NPM (currntly I have added it in the destructor of RegisterUsageInfo, this seems to work but im not sure if it has any side effects)
1 parent c0c13d2 commit 4b97642

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

llvm/include/llvm/CodeGen/RegisterUsageInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class TargetMachine;
3434

3535
class PhysicalRegisterUsageInfo {
3636
public:
37+
38+
~PhysicalRegisterUsageInfo();
3739
/// Set TargetMachine which is used to print analysis.
3840
void setTargetMachine(const TargetMachine &TM);
3941

llvm/lib/CodeGen/RegisterUsageInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ bool PhysicalRegisterUsageInfo::doFinalization(Module &M) {
5656
return false;
5757
}
5858

59+
PhysicalRegisterUsageInfo::~PhysicalRegisterUsageInfo() {
60+
if (DumpRegUsage)
61+
print(errs());
62+
63+
RegMasks.shrink_and_clear();
64+
}
65+
5966
void PhysicalRegisterUsageInfo::storeUpdateRegUsageInfo(
6067
const Function &FP, ArrayRef<uint32_t> RegMask) {
6168
RegMasks[&FP] = RegMask;

0 commit comments

Comments
 (0)