[X86] meaningless vzeroupper
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
noticed from #40250
```llvm
define double @copysign_v4f64(<4 x double> %x, <4 x double> %y) nounwind {
%v = call <4 x double> @llvm.copysign.v4f64(<4 x double> %x, <4 x double> %y)
%r = extractelement <4 x double> %v, i32 0
ret double %r
}
```
```asm
.LCPI0_0:
.quad 0x7fffffffffffffff # double NaN
copysign_v4f64: # @copysign_v4f64
vpternlogq $228, .LCPI0_0(%rip){1to2}, %xmm1, %xmm0 # xmm0 = xmm1 ^ (m64bcst & (xmm0 ^ xmm1))
vzeroupper
retq
```
https://godbolt.org/z/6vYTb4xhx
Contributor guide
Research direction
Start by reproducing the LLVM IR and x86 assembly shown in the issue, using the linked Compiler Explorer example as a reference. Trace the compiler's handling of this vector operation and verify that the completed change no longer emits the meaningless vzeroupper while preserving the generated result.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100