handleSpecialFP is currently hitting llvm_unreachable("Unknown SpecialFP instruction!"), because the IRET opcodes are marked as "FPForm = SpecialFP" but are unsupported in handleSpecialFP.
I chose to fix this by handling all the return opcodes uniformly in handleSpecialFP, as that seemed like the most robust choice. An alternative would be to change X86InstrControl.td so that the IRETs are not marked "FPForm = SpecialFP" since interrupt handlers cannot actually return x87 values (or any other values for that matter). But that clutters X86InstrControl.td for no good reason.
The code in the new handleReturn function is virtually identical to the original return-handling code in handleSpecialFP. The only differences are in the indentation and the "MachineInstr *MI = I;" at the top.
Could you check we generate sensible code here?