use LdTypeStructureVal in IR optimization pass
Summary:
Add logic in `opt.cpp` to change BespokeGet and BespokeGetThrow into LdTypeStructureVal when the array is a bespoke type structure. We were only converting in `irgen-bespoke.cpp` before, which might not catch all bespoke cases.
This is similar logic to the current process for lowering StructDicts in `opt.cpp`: we loop through all arrays and check if any of them are bespoke type structs, then call the appropriate function to convert the IR instruction. Since LdTypeStructureVal is a branching instruction, the new control flow will add some new blocks.
Also fixed a small bug in `irlower-bespoke.cpp` so that we only set `dst.reg(1)` if the return type of the field is unknown.
Reviewed By: paulbiss
Differential Revision:
D37429307
fbshipit-source-id:
60de5e153557e6a7e6282c651a5deb4eaf5425d5