Skip to content

X86: Delete MMX types/intrinsics from LLVM IR/backends #98272

Open
@jyknight

Description

@jyknight

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:

  1. Delete all support for 3dNow! (PR Remove support for 3DNow!, both intrinsics and builtins. #96246)
  2. 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 the x86_mmx IR type. #98505) (PR Cleanup x86_mmx after removing IR type  #100646)
  3. 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)
  4. 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.
  5. Delete as much of the remaining X86 backend code related to MMX as possible, without breaking inline asm "y" constraints.
  6. 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.

@efriedma-quic @phoebewang @topperc @RKSimon

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions