Skip to content

Commit 89c80ad

Browse files
resolve comments
1 parent e5e0cee commit 89c80ad

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

llvm/include/llvm/CodeGen/MachineJumpTableInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ struct MachineJumpTableEntry {
3636
/// MBBs - The vector of basic blocks from which to create the jump table.
3737
std::vector<MachineBasicBlock*> MBBs;
3838

39+
/// The hotness of MJTE is inferred from the hotness of the source basic
40+
/// block(s) that reference it.
3941
MachineFunctionDataHotness Hotness;
4042

4143
explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock *> &M);

llvm/lib/CodeGen/MachineFunction.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,9 +1347,7 @@ unsigned MachineJumpTableInfo::createJumpTableIndex(
13471347
bool MachineJumpTableInfo::updateJumpTableEntryHotness(
13481348
size_t JTI, MachineFunctionDataHotness Hotness) {
13491349
assert(JTI < JumpTables.size() && "Invalid JTI!");
1350-
// Note record the largest hotness is important for mergable data (constant
1351-
// pools). Even if jump table instances are not merged, record the largest
1352-
// value seen fwiw.
1350+
// Record the largest hotness value.
13531351
if (Hotness <= JumpTables[JTI].Hotness)
13541352
return false;
13551353

llvm/lib/CodeGen/StaticDataSplitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class StaticDataSplitter : public MachineFunctionPass {
5858
bool splitJumpTables(MachineFunction &MF);
5959

6060
// Same as above but works on functions with profile information.
61-
bool splitJumpTablesWithProfiles(MachineFunction &MF,
61+
bool splitJumpTablesWithProfiles(const MachineFunction &MF,
6262
MachineJumpTableInfo &MJTI);
6363

6464
public:
@@ -89,7 +89,7 @@ bool StaticDataSplitter::runOnMachineFunction(MachineFunction &MF) {
8989
}
9090

9191
bool StaticDataSplitter::splitJumpTablesWithProfiles(
92-
MachineFunction &MF, MachineJumpTableInfo &MJTI) {
92+
const MachineFunction &MF, MachineJumpTableInfo &MJTI) {
9393
int NumChangedJumpTables = 0;
9494

9595
// Jump table could be used by either terminating instructions or

llvm/test/CodeGen/X86/jump-table-partition.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
; RUN: llc --run-pass=static-data-splitter -stats -x mir %t.mir -o - 2>&1 | FileCheck %s --check-prefix=STAT
88

99
; Tests stat messages are expected.
10-
; TODO: Update test to verify section suffixes when target-lowering and assembler changes are implemented.
11-
; TODO: Also run static-data-splitter pass with -static-data-default-hotness=cold and check data section suffix.
10+
; COM: Update test to verify section suffixes when target-lowering and assembler changes are implemented.
11+
; COM: Also run static-data-splitter pass with -static-data-default-hotness=cold and check data section suffix.
1212

1313
; STAT-DAG: 2 static-data-splitter - Number of cold jump tables seen
1414
; STAT-DAG: 2 static-data-splitter - Number of hot jump tables seen

0 commit comments

Comments
 (0)