use TypeStructure in bespoke layout selection
Summary:
This diff adds logic to profile arrays and decide when to use bespoke type structures. The layout is gated on the runtime-option `EmitBespokeTypeStructures` , which is set to `false`.
Current logic: the bespoke type structure layout will only be selected if the array source exactly matches the fields in a type structure and if the array is never modified.
In the future, we could consider more detailed conditions (e.g. we still select the bespoke layout if a user modifies some fields and the modified array is still a valid type structure) but for now, the current logic is sufficient.
Reviewed By: arnabde03
Differential Revision:
D36901413
fbshipit-source-id:
1eb3856f389ec6ee13818bfadba815c995af372e