[llvm] c6ebe3f - [InstSimplify] add tests for FP constant miscompile; NFC (PR43907)
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 17 09:04:49 PDT 2020
Author: Sanjay Patel
Date: 2020-09-17T12:04:39-04:00
New Revision: c6ebe3fd002c1d3b903ab6e912ebd815fdb0e964
URL: https://github.com/llvm/llvm-project/commit/c6ebe3fd002c1d3b903ab6e912ebd815fdb0e964
DIFF: https://github.com/llvm/llvm-project/commit/c6ebe3fd002c1d3b903ab6e912ebd815fdb0e964.diff
LOG: [InstSimplify] add tests for FP constant miscompile; NFC (PR43907)
Added:
Modified:
llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll b/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
index 170e2d55421c..b1b879da1fbd 100644
--- a/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/cast.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
; Overflow on a float to int or int to float conversion is undefined (PR21130).
@@ -38,3 +39,20 @@ define float @overflow_sitofp() {
ret float %i
}
+; https://llvm.org/PR43907
+
+define float @nan_f64_trunc() {
+; CHECK-LABEL: @nan_f64_trunc(
+; CHECK-NEXT: ret float 0x7FF0000000000000
+;
+ %f = fptrunc double 0x7FF0000000000001 to float
+ ret float %f
+}
+
+define <2 x half> @nan_v2f32_trunc() {
+; CHECK-LABEL: @nan_v2f32_trunc(
+; CHECK-NEXT: ret <2 x half> <half 0xH7C00, half 0xH7C37>
+;
+ %f = fptrunc <2 x float> <float 0x7FF0000100000000, float 0x7FF0DEAD00000000> to <2 x half>
+ ret <2 x half> %f
+}
More information about the llvm-commits
mailing list