Skip to content

[Float2Int] Miscompilation at O3 #167627

@dtcxzyw

Description

@dtcxzyw

Reproducer: https://alive2.llvm.org/ce/z/u3J86e

; bin/opt -passes=float2int test.ll -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"
target triple = "x86_64-unknown-linux-gnu"

define i1 @src() {
entry:
  %0 = fadd float 0xC5AAD8ABE0000000, 0xC57E819700000000
  %1 = fcmp one float %0, 0.000000e+00
  ret i1 %1
}
=>
define i1 @src() {
entry:
  ret i1 0
}
Transformation doesn't verify!

ERROR: Value mismatch

NOTE: The counterexample is unique.

Example:

Source:
float %#0 = #xed7546f6 (-4744350869734834488282710016)
i1 %#1 = #x1 (1)

Target:
Source value: #x1 (1)
Target value: #x0 (0)

llvm version: cf35502

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions