diff options
-rw-r--r-- | llvm/test/Transforms/InstCombine/fpcast.ll | 36 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/fpextend.ll | 16 |
2 files changed, 52 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fpcast.ll b/llvm/test/Transforms/InstCombine/fpcast.ll index bfc1de4ff6d..f0f5848ad00 100644 --- a/llvm/test/Transforms/InstCombine/fpcast.ll +++ b/llvm/test/Transforms/InstCombine/fpcast.ll @@ -40,6 +40,18 @@ define half @fneg_fptrunc(float %a) { ret half %c } +; FIXME: This combine isn't working. +define half @unary_fneg_fptrunc(float %a) { +; CHECK-LABEL: @unary_fneg_fptrunc( +; CHECK-NEXT: [[B:%.*]] = fneg float [[A:%.*]] +; CHECK-NEXT: [[C:%.*]] = fptrunc float [[B]] to half +; CHECK-NEXT: ret half [[C]] +; + %b = fneg float %a + %c = fptrunc float %b to half + ret half %c +} + define <2 x half> @fneg_fptrunc_vec_undef(<2 x float> %a) { ; CHECK-LABEL: @fneg_fptrunc_vec_undef( ; CHECK-NEXT: [[TMP1:%.*]] = fptrunc <2 x float> [[A:%.*]] to <2 x half> @@ -51,6 +63,18 @@ define <2 x half> @fneg_fptrunc_vec_undef(<2 x float> %a) { ret <2 x half> %c } +; FIXME: This combine isn't working. +define <2 x half> @unary_fneg_fptrunc_vec(<2 x float> %a) { +; CHECK-LABEL: @unary_fneg_fptrunc_vec( +; CHECK-NEXT: [[B:%.*]] = fneg <2 x float> [[A:%.*]] +; CHECK-NEXT: [[C:%.*]] = fptrunc <2 x float> [[B]] to <2 x half> +; CHECK-NEXT: ret <2 x half> [[C]] +; + %b = fneg <2 x float> %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 @@ -62,6 +86,18 @@ define half @test4-fast(float %a) { ret half %c } +; FIXME: This combine isn't working. +define half @test4_unary_fneg-fast(float %a) { +; CHECK-LABEL: @test4_unary_fneg-fast( +; CHECK-NEXT: [[B:%.*]] = fneg fast float [[A:%.*]] +; CHECK-NEXT: [[C:%.*]] = fptrunc float [[B]] to half +; CHECK-NEXT: ret half [[C]] +; + %b = fneg fast float %a + %c = fptrunc float %b to half + ret half %c +} + define half @test5(float %a, float %b, float %c) { ; CHECK-LABEL: @test5( ; CHECK-NEXT: [[D:%.*]] = fcmp ogt float [[A:%.*]], [[B:%.*]] diff --git a/llvm/test/Transforms/InstCombine/fpextend.ll b/llvm/test/Transforms/InstCombine/fpextend.ll index 88401504f57..f1e7076f3af 100644 --- a/llvm/test/Transforms/InstCombine/fpextend.ll +++ b/llvm/test/Transforms/InstCombine/fpextend.ll @@ -55,6 +55,22 @@ entry: ret float %tmp34 } +; FIXME: This combine isn't working. +define float @test4_unary_fneg(float %x) nounwind { +; CHECK-LABEL: @test4_unary_fneg( +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TMP1:%.*]] = fpext float [[X:%.*]] to double +; CHECK-NEXT: [[TMP2:%.*]] = fneg double [[TMP1]] +; CHECK-NEXT: [[TMP34:%.*]] = fptrunc double [[TMP2]] to float +; CHECK-NEXT: ret float [[TMP34]] +; +entry: + %tmp1 = fpext float %x to double + %tmp2 = fneg double %tmp1 + %tmp34 = fptrunc double %tmp2 to float + ret float %tmp34 +} + ; Test with vector splat constant define <2 x float> @test5(<2 x float> %x) nounwind { ; CHECK-LABEL: @test5( |