On Linux, it was made possible by https://reviews.llvm.org/D38253 that __builtin_longjmp can jump between ARM mode and Thumb mode. However, it has been revealed that it does not work in some cases. This is because in Thumb mode __builtin_longjmp emits an assembly instruction ldr r11, [[BUFREG]] which is misassembled by the integrated assembler, leading to r11 (the frame pointer register in ARM mode) not being restored correctly.
The proposed change uses the instruction mov r11, r7 in place of ldr r11, [[BUFREG]]. Following ldr r7, [[BUFREG]], it should correctly restore r11.
This change looks good and seems to have been requested (and missed by me) in D38253, but we should do the same for Int_eh_sjlj_longjmp in ARMInstrInfo.td too - can you amend the patch to change that too?