This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Optimize the allocation of resizable operand lists
ClosedPublic

Authored by rriddle on Apr 24 2020, 8:48 PM.

Details

Summary

This revision optimizes resizable operand lists by allocating them in the same location as the trailing operands. This has numerous benefits:

  • If the operation has at least one operand at construction time, there is 0 additional memory overhead to the resizable storage.
  • There is less pointer arithmetic necessary as the resizable storage is now only used when the operands are dynamically allocated.

Diff Detail

Event Timeline

rriddle created this revision.Apr 24 2020, 8:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2020, 8:48 PM

Why do even keep the resizable=false possibility instead of nuking this and making it always resizable? Is there a cost to it after this change?

mehdi_amini accepted this revision.Apr 25 2020, 9:06 PM

I have some questions about possible follow-up improvements, but LGTM as is!

This revision is now accepted and ready to land.Apr 25 2020, 9:06 PM
This revision was automatically updated to reflect the committed changes.