From 1c3e2ffe85fb58e02a0162873cfd9b37ddebacac Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 18 Jul 2017 11:18:38 +0000 Subject: [PATCH] [X86][AVX512] Add ISD::ROTL/ISD::ROTR constant folding tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308295 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/avx512-rotate.ll | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/CodeGen/X86/avx512-rotate.ll b/test/CodeGen/X86/avx512-rotate.ll index 5ad562cc022..98fa67ad793 100644 --- a/test/CodeGen/X86/avx512-rotate.ll +++ b/test/CodeGen/X86/avx512-rotate.ll @@ -234,3 +234,23 @@ define <8 x i64>@test_splat_bounds_ror_v8i64(<8 x i64> %x0, <8 x i64> %x1, i8 %x %res4 = add <8 x i64> %res3, %res2 ret <8 x i64> %res4 } + +; Constant folding + +define <8 x i64> @test_fold_rol_v8i64() { +; CHECK-LABEL: test_fold_rol_v8i64: +; CHECK: # BB#0: +; CHECK-NEXT: vmovaps {{.*#+}} zmm0 = [1,2,4,9223372036854775808,2,4611686018427387904,9223372036854775808,9223372036854775808] +; CHECK-NEXT: retq + %res = call <8 x i64> @llvm.x86.avx512.mask.prolv.q.512(<8 x i64> , <8 x i64> , <8 x i64> zeroinitializer, i8 -1) + ret <8 x i64> %res +} + +define <8 x i64> @test_fold_ror_v8i64() { +; CHECK-LABEL: test_fold_ror_v8i64: +; CHECK: # BB#0: +; CHECK-NEXT: vmovaps {{.*#+}} zmm0 = [1,9223372036854775808,4611686018427387904,2,9223372036854775808,4,2,2] +; CHECK-NEXT: retq + %res = call <8 x i64> @llvm.x86.avx512.mask.prorv.q.512(<8 x i64> , <8 x i64> , <8 x i64> zeroinitializer, i8 -1) + ret <8 x i64> %res +} -- 2.11.0