https://bugs.llvm.org/show_bug.cgi?id=45478
Bug ID: 45478
Summary: Incorrect translation of minnum with nnan flag
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: l...@cs.utah.edu
CC: llvm-bugs@lists.llvm.org
As stated in LangRef, if either operand for llvm.minnum is a NaN, returns the
other non-NaN operand. If llvm.minnum is attached with nnan flag, when an
argument is a NaN, it produces a poison value.
See below the incorrect transformation. When input %x is NaN, the source
program returns 0.0, while the target program returns poison. Target is more
poisonous than source.
llvm/test/Transforms/InstCombine/minnum.ll
define float @minnum_f32_1_minnum_p0_val_nnan_ninf(float %x) {
; CHECK-LABEL: @minnum_f32_1_minnum_p0_val_nnan_ninf(
; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf float @llvm.minnum.f32(float
[[X:%.*]], float 0.000000e+00)
; CHECK-NEXT: ret float [[TMP1]]
;
%y = call float @llvm.minnum.f32(float 0.0, float %x)
%z = call nnan ninf float @llvm.minnum.f32(float %y, float 1.0)
ret float %z
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs