Open
Description
This issue is about removing IR and SelectionDAG/Codegen support. Assembler support should remain.
Previous discussion on discourse Proposal to remove MMX support
The idea is, at the LLVM level, to keep only minimal support for the inlineasm "y" constraints, and remove as much of the rest as possible.
Overall plan:
- Delete all support for 3dNow! (PR Remove support for 3DNow!, both intrinsics and builtins. #96246)
- Delete the
x86_mmx
type from IR. Can be done by using (at the IR level only) a standard vector type,<1 x i64>
, instead. Notably, Clang already uses<1 x i64>
for everything except where required to interface with mmx intrinsics and inline-asm. The conversion for those interfaces can be pushed down into SelectionDAG instead. (PR Remove thex86_mmx
IR type. #98505) (PR Cleanup x86_mmx after removing IR type #100646) - Migrate Clang-side MMX builtins to be backed by SSE2 instead of MMX so they can continue to work without requiring the MMX intrinsic functions in IR (and as a bonus, they'll likely get faster, too). (bug [X86] Implement MMX intrinsics with SSE equivalents #41665, PR Clang: convert
__m64
intrinsics to unconditionally use SSE2 instead of MMX. #96540) - Delete the IR-side MMX intrinsic functions.
- Open question: how to deal with bitcode backwards compatibility for these? Maybe simplest to convert the intrinsics to inline-asm in autoupgrade.
- Delete as much of the remaining X86 backend code related to MMX as possible, without breaking inline asm "y" constraints.
- Decide whether to do anything about inserting EMMS instructions (bug [X86] Add pass to insert EMMS/FEMMS instructions to separate MMX and X87 states #41664). At this point, it'd be only relevant to inline-asm. So we could potentially insert such an instruction directly after all inline-asm which have MMX register inputs/outputs/clobbers. Or we could also (continue to) not bother.