llvm / llvm/llvm-project

[X86] Replace SSE mulh target intrinsics with generics

Open
#223,627 1 comment 0 reactions 0 assignees View on GitHub
backend:X86 code-cleanup
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Once #220293 has landed we can remove the (V)PMULHW + (V)PMULHUW x86 intrinsics and use the llvm.[su]mulh intrinsics directly:

- [ ] Move the `llvm.x86.*.pmulh.w` and `llvm.x86.*.pmulhu.w` intrinsic codegen to the *-intrinsics-upgrade.ll test files
- [ ] Handle `llvm.x86.*.pmulh.w` and `llvm.x86.*.pmulhu.w` intrinsics -> `llvm.[su]mulh` intrinsics in Autoupgrade
- [ ] Update stack folding tests to use the `llvm.[su]mulh` intrinsics directly
- [ ] clang\lib\CodeGen\TargetBuiltins\X86.cpp - emit `llvm.[su]mulh` intrinsics
- [ ] Remove `llvm.x86.*.pmulh.w` and `llvm.x86.*.pmulhu.w` intrinsic defs

Contributor guide

Open the contributing guide

Research direction

First confirm that #220293 has landed, then inspect clang/lib/CodeGen/TargetBuiltins/X86.cpp and the existing *-intrinsics-upgrade.ll and stack-folding tests. Trace the Autoupgrade handling and intrinsic definitions for the listed pmulh and pmulhu operations. Done means the tests use llvm.[su]mulh, Clang emits those intrinsics, upgrade handling exists, and the old x86 intrinsic definitions are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.