Diff Detail
Event Timeline
Not sure if I picked the right reviewers.
A downstream target broke because it exceeded 32768 opcodes.
I ran a test with 100 fadd float instructions ('-debug' reported 106 nodes) and measured memory with '--time-passes -track-memory' option.
There were small differences in reported memory between runs (not sure what is the reason for this).
Here are the results for 10 runs for 'AMDGPU DAG->DAG Pattern Instruction Selection' pass:
int16_t
205696
204768
204816
206528
206528
205696
205696
205648
206528
204816
avg = 205672
int32_t
209808
209808
210640
209760
209808
209808
210640
209808
210640
209808
avg = 210052.8
increase:
210052.8 / 205672 = 1.0212999338753
Other passes were mostly indentical with small variations between runs.
sizeof(SDNode) went from 88 to 96.
NodeType and NodeBitfields are supposed to pack into a 32-bit word. Maybe you could swap "uint16_t PersistentId;" to the start of the struct instead, and pack that with the NodeBitfields, to avoid increasing the size?
Great idea. That works. SDNode size is now 88.
'--time-passes -track-memory' now looks identical.
llvm/include/llvm/CodeGen/SelectionDAGNodes.h | ||
---|---|---|
477 | "with PersistentId" |
"with PersistentId"