llvm / llvm/llvm-project

[X86] no longer producing vector shifts after instcombine change

Open
#208,410 1 comment 0 reactions 0 assignees View on GitHub
backend:X86 llvm:instcombine regression:14
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```c
#include

__m128i s32(__m128i a){
return _mm_srai_epi32(_mm_slli_epi32(a, 31),31);
}
__m128i s16(__m128i a){
return _mm_srai_epi16(_mm_slli_epi16(a, 15),15);
}
```

regressed since e71870512fd896bf6cf34e8ae650f4cf20923258

https://godbolt.org/z/W88oGfExK

Contributor guide

Open the contributing guide

Research direction

Start with the C reproducer and compare its output on Godbolt before and after commit e71870512fd896bf6cf34e8ae650f4cf20923258. Trace the instcombine change affecting the two SIMD shift sequences and verify that compilation produces vector shifts again for both s32 and s16.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.