Various forms of aarch64 instructions are finalised in this pass, and involve the replacement of one instruction with another. That requires a call to substituteDebugValuesForInst to patch up the variable location information: deleted instructions need to be accounted for, so that instruction-referencing variable locations can find the new value.
The test covers the major elements that get expanded; however I haven't written a test covering each form of pcrel 'add' instruction to ensure it gets salvaged; is it acceptable to skip that?