[InstCombine] bool mul (from memory) generated mul instead of and
Closed
llvm:instcombine
missed-optimization
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```c++
bool foo(bool & a, bool & b){
return a*b;
}
```
gcc:
```asm
"foo(bool&, bool&)":
movzx eax, BYTE PTR [rdi]
and al, BYTE PTR [rsi]
ret
```
clang:
```asm
foo(bool&, bool&):
movzx eax, byte ptr [rsi]
mul byte ptr [rdi]
ret
```
https://godbolt.org/z/ex3aj3KPb
Not sure if this is a clang or InstCombine problem, but simply replacing mul with and doesn't satisfy alive2.
Contributor guide
Assessment
This issue has not been assessed yet.