[Morello] Optimize global addressing for purecap
- Enable global merging for Morello
Instead of replacing with global uses with the merged global emit aliases. A later pass will optimize these. Some notable changes to the globals merge pass:
- We're attempting to pad globals to make capabilies to the emitted aliases representable. This doesn't do anything, since the maximum size of the merged global is 4096, but it's nice to have this in place.
- We're replacing the old globals with aliases to the merged global. This keeps size information and we can consume it in future optimizations.
- For purecap we merge BSS globals with non-BSS ones, which means globals that were in .bss now end up in .data. For purecap this is worth it as it's going to remove some loads/stores
AArch64SandboxGlobalsOpt also now processes aliases as well. The metadata format for determining the index of the capability table for a global has changed since global aliases cannot attach metadata.
-
Optimize address generation for aliases. These can use the underlying object and further refine bounds using a bounds setting instruction. Loads/stores known to be safe can use the underlying object directly.
-
Generate addresses of constants from PCC with and additional bounds setting instruction.