[PATCH] D17643: Fix failing assertion when the X87 stackifier runs on functions containing IRETs

David Kreitzer via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 06:17:19 PST 2016


DavidKreitzer created this revision.
DavidKreitzer added reviewers: nadav, qcolombet, aaboud.
DavidKreitzer added a subscriber: llvm-commits.

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.


http://reviews.llvm.org/D17643

Files:
  lib/Target/X86/X86FloatingPoint.cpp
  test/CodeGen/X86/x86-32-intrcc.ll
  test/CodeGen/X86/x86-64-intrcc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17643.49176.patch
Type: text/x-patch
Size: 11165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160226/70710ce2/attachment.bin>


More information about the llvm-commits mailing list