diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-02-26 23:23:02 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-02-26 23:23:02 +0000 |
| commit | 66911b16e66f72454d9668db9d627fc588823b78 (patch) | |
| tree | 4ae9d73f050b7f58da95c0b29695c163319740b0 /llvm/test/Transforms/InstSimplify | |
| parent | 717941e132b3e433743f33337d61b4914a1f5a8d (diff) | |
| download | bcm5719-llvm-66911b16e66f72454d9668db9d627fc588823b78.tar.gz bcm5719-llvm-66911b16e66f72454d9668db9d627fc588823b78.zip | |
[InstCombine, InstSimplify] add tests with undef elements in constant FP vectors; NFC
llvm-svn: 326148
Diffstat (limited to 'llvm/test/Transforms/InstSimplify')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll index ba177ead718..d564992e2d8 100644 --- a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll +++ b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll @@ -11,6 +11,26 @@ define float @fsub_-0_-0_x(float %a) { ret float %ret } +define <2 x float> @fsub_-0_-0_x_vec(<2 x float> %a) { +; CHECK-LABEL: @fsub_-0_-0_x_vec( +; CHECK-NEXT: ret <2 x float> [[A:%.*]] +; + %t1 = fsub <2 x float> <float -0.0, float -0.0>, %a + %ret = fsub <2 x float> <float -0.0, float -0.0>, %t1 + ret <2 x float> %ret +} + +define <2 x float> @fsub_-0_-0_x_vec_undef_elts(<2 x float> %a) { +; CHECK-LABEL: @fsub_-0_-0_x_vec_undef_elts( +; CHECK-NEXT: [[T1:%.*]] = fsub <2 x float> <float undef, float -0.000000e+00>, [[A:%.*]] +; CHECK-NEXT: [[RET:%.*]] = fsub <2 x float> <float -0.000000e+00, float undef>, [[T1]] +; CHECK-NEXT: ret <2 x float> [[RET]] +; + %t1 = fsub <2 x float> <float undef, float -0.0>, %a + %ret = fsub <2 x float> <float -0.0, float undef>, %t1 + ret <2 x float> %ret +} + ; fsub 0.0, (fsub -0.0, X) != X define float @fsub_0_-0_x(float %a) { ; CHECK-LABEL: @fsub_0_-0_x( @@ -53,6 +73,15 @@ define float @fadd_x_n0(float %a) { ret float %ret } +define <2 x float> @fadd_x_n0_vec_undef_elt(<2 x float> %a) { +; CHECK-LABEL: @fadd_x_n0_vec_undef_elt( +; CHECK-NEXT: [[RET:%.*]] = fadd <2 x float> [[A:%.*]], <float -0.000000e+00, float undef> +; CHECK-NEXT: ret <2 x float> [[RET]] +; + %ret = fadd <2 x float> %a, <float -0.0, float undef> + ret <2 x float> %ret +} + ; fmul X, 1.0 ==> X define double @fmul_X_1(double %a) { ; CHECK-LABEL: @fmul_X_1( |

