[llvm] r345206 - [InstCombine] add test for fptrunc with vector with undef elt; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 15:02:05 PDT 2018


Author: spatel
Date: Wed Oct 24 15:02:05 2018
New Revision: 345206

URL: http://llvm.org/viewvc/llvm-project?rev=345206&view=rev
Log:
[InstCombine] add test for fptrunc with vector with undef elt; NFC

This should be fixed with D53650.

Modified:
    llvm/trunk/test/Transforms/InstCombine/fpcast.ll

Modified: llvm/trunk/test/Transforms/InstCombine/fpcast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/fpcast.ll?rev=345206&r1=345205&r2=345206&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fpcast.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fpcast.ll Wed Oct 24 15:02:05 2018
@@ -29,8 +29,8 @@ define half @test3(float %a) {
   ret half %c
 }
 
-define half @test4(float %a) {
-; CHECK-LABEL: @test4(
+define half @fneg_fptrunc(float %a) {
+; CHECK-LABEL: @fneg_fptrunc(
 ; CHECK-NEXT:    [[TMP1:%.*]] = fptrunc float [[A:%.*]] to half
 ; CHECK-NEXT:    [[C:%.*]] = fsub half 0xH8000, [[TMP1]]
 ; CHECK-NEXT:    ret half [[C]]
@@ -40,6 +40,17 @@ define half @test4(float %a) {
   ret half %c
 }
 
+define <2 x half> @fneg_fptrunc_vec_undef(<2 x float> %a) {
+; CHECK-LABEL: @fneg_fptrunc_vec_undef(
+; CHECK-NEXT:    [[B:%.*]] = fsub <2 x float> <float -0.000000e+00, float undef>, [[A:%.*]]
+; CHECK-NEXT:    [[C:%.*]] = fptrunc <2 x float> [[B]] to <2 x half>
+; CHECK-NEXT:    ret <2 x half> [[C]]
+;
+  %b = fsub <2 x float> <float -0.0, float undef>, %a
+  %c = fptrunc <2 x float> %b to <2 x half>
+  ret <2 x half> %c
+}
+
 define half @test4-fast(float %a) {
 ; CHECK-LABEL: @test4-fast(
 ; CHECK-NEXT:    [[TMP1:%.*]] = fptrunc float [[A:%.*]] to half




More information about the llvm-commits mailing list