From e309d2d0c3d28e79fe61a9c65be2eeb424d328a1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 19 Aug 2016 17:39:00 +0000 Subject: [PATCH] [CostModel][X86] Add fdiv + frem cost tests llvm-svn: 279283 --- llvm/test/Analysis/CostModel/X86/arith.ll | 34 +++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/llvm/test/Analysis/CostModel/X86/arith.ll b/llvm/test/Analysis/CostModel/X86/arith.ll index a35db9c..8d436d2 100644 --- a/llvm/test/Analysis/CostModel/X86/arith.ll +++ b/llvm/test/Analysis/CostModel/X86/arith.ll @@ -15,7 +15,7 @@ define i32 @add(i32 %arg) { %A = add <4 x i32> undef, undef ; SSSE3: cost of 2 {{.*}} %B = add ; SSE42: cost of 2 {{.*}} %B = add - ; AVX: cost of 4 {{.*}} %B = add + ; AVX: cost of 4 {{.*}} %B = add ; AVX2: cost of 1 {{.*}} %B = add %B = add <8 x i32> undef, undef ; SSSE3: cost of 1 {{.*}} %C = add @@ -75,7 +75,7 @@ define void @mul() { ; SSE42: cost of 1 {{.*}} %A1 = mul ; AVX: cost of 1 {{.*}} %A1 = mul ; AVX2: cost of 1 {{.*}} %A1 = mul - %A1 = mul <4 x i32> undef, undef + %A1 = mul <4 x i32> undef, undef ; SSSE3: cost of 9 {{.*}} %A2 = mul ; SSE42: cost of 9 {{.*}} %A2 = mul ; AVX: cost of 9 {{.*}} %A2 = mul @@ -104,6 +104,36 @@ define i32 @fmul(i32 %arg) { ret i32 undef } +; CHECK-LABEL: 'fdiv' +define i32 @fdiv(i32 %arg) { + ; SSSE3: cost of 2 {{.*}} %A = fdiv + ; SSE42: cost of 2 {{.*}} %A = fdiv + ; AVX: cost of 2 {{.*}} %A = fdiv + ; AVX2: cost of 2 {{.*}} %A = fdiv + %A = fdiv <4 x float> undef, undef + ; SSSE3: cost of 4 {{.*}} %B = fdiv + ; SSE42: cost of 4 {{.*}} %B = fdiv + ; AVX: cost of 2 {{.*}} %B = fdiv + ; AVX2: cost of 2 {{.*}} %B = fdiv + %B = fdiv <8 x float> undef, undef + ret i32 undef +} + +; CHECK-LABEL: 'frem' +define i32 @frem(i32 %arg) { + ; SSSE3: cost of 14 {{.*}} %A = frem + ; SSE42: cost of 14 {{.*}} %A = frem + ; AVX: cost of 14 {{.*}} %A = frem + ; AVX2: cost of 14 {{.*}} %A = frem + %A = frem <4 x float> undef, undef + ; SSSE3: cost of 28 {{.*}} %B = frem + ; SSE42: cost of 28 {{.*}} %B = frem + ; AVX: cost of 30 {{.*}} %B = frem + ; AVX2: cost of 30 {{.*}} %B = frem + %B = frem <8 x float> undef, undef + ret i32 undef +} + ; CHECK-LABEL: 'shift' define void @shift() { ; SSSE3: cost of 10 {{.*}} %A0 = shl -- 2.7.4