InstCombine does not check contract flag on all instructions in cos * tan -> sin combine
Open
floating-point
llvm:instcombine
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
This combine has a viral interpretation of contract which is incorrect: https://godbolt.org/z/YWshG18Ge
```llvm
; RUN: opt -S -p=instcombine %s
define float @missing_contract_cos_mul_tan(float %x) {
%tan = call float @llvm.tan.f32(float %x)
%cos = call float @llvm.cos.f32(float %x)
%mul = fmul contract float %tan, %cos
ret float %mul
}
```
This should require contract on both the tan and cos calls to perform the contraction.
Contributor guide
Assessment
This issue has not been assessed yet.