[llvm] [LLVM] Add FP instruction intrinsics (PR #193588)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 04:29:14 PDT 2026
dtcxzyw wrote:
The following correctness issue was found by [llvm-hackme](https://github.com/dtcxzyw/llvm-hackme).
<!-- llvm-hackme-state: bug_found -->
<!-- llvm-hackme-baseline: 7b58716d96c3ae4c0c4e6f72e29b16137bb6224b -->
<!-- llvm-hackme-head-sha: 167ff520775e89eee6cb8f955f139a7b9772d6ad -->
<!-- llvm-hackme-patch-sha256: b9c98bb6a5b77d9785cc982455ad0c4041a69a0c1551a4a3e810fc9362498c5b -->
<!-- llvm-hackme-kind: miscompilation -->
This comment is generated by an automated correctness checking service designed to help identify critical correctness bugs (opt crashes or Alive2 miscompilations) and improve PR review efficiency under limited reviewer bandwidth.
## Reproducer
**Kind**: miscompilation
**IR Reproducer**:
```llvm
; RUN: opt -passes=instcombine<no-verify-fixpoint> -S
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
declare float @llvm.fadd.f32(float, float)
define float @test(float %x) {
%r = call nnan float @llvm.fadd.f32(float %x, float -0.0)
ret float %r
}
```
**Alive2 Counterexample**:
```
----------------------------------------
declare float @llvm.fadd.f32(float, float)
define float @test(float %x) {
#0:
%r = call float @llvm.fadd.f32(float %x, float -0e+00) NNaN
ret float %r
}
=>
define float @test(float %x) {
#0:
ret float %x
}
Transformation doesn't verify!
ERROR: Source and target don't have the same return domain
Example:
float %x = poison
Source:
float %r = function did not return!
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x0
Block 1 > size: 0 align: 1 alloc type: 0 alive: true address: #x1
Target:
TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x0
Block 1 > size: 0 align: 1 alloc type: 0 alive: true address: #x1
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
```
**Baseline Revision**: `7b58716d96c3ae4c0c4e6f72e29b16137bb6224b`
**PR Head SHA**: `167ff520775e89eee6cb8f955f139a7b9772d6ad`
**Patch SHA256**: `b9c98bb6a5b77d9785cc982455ad0c4041a69a0c1551a4a3e810fc9362498c5b`
https://github.com/llvm/llvm-project/pull/193588
More information about the llvm-commits
mailing list