diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-06-25 19:14:09 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-06-25 19:14:09 +0000 |
commit | 34eb2406b41854fc8df688fca7c0129f77d768f7 (patch) | |
tree | 6cac23e46340a75e8ffe45956e293323f63c8db0 /test/Analysis/CostModel | |
parent | a1fe2948ed4039e68d1784494c3b23a4ce4126b4 (diff) | |
download | external_llvm-34eb2406b41854fc8df688fca7c0129f77d768f7.zip external_llvm-34eb2406b41854fc8df688fca7c0129f77d768f7.tar.gz external_llvm-34eb2406b41854fc8df688fca7c0129f77d768f7.tar.bz2 |
X86 cost model: Vectorizing integer division is a bad idea
radar://14057959
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/CostModel')
-rw-r--r-- | test/Analysis/CostModel/X86/div.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Analysis/CostModel/X86/div.ll b/test/Analysis/CostModel/X86/div.ll new file mode 100644 index 0000000..c7d6517 --- /dev/null +++ b/test/Analysis/CostModel/X86/div.ll @@ -0,0 +1,32 @@ +; RUN: opt -mtriple=x86_64-apple-darwin -mcpu=core2 -cost-model -analyze < %s | FileCheck --check-prefix=SSE2 %s +; RUN: opt -mtriple=x86_64-apple-darwin -mcpu=core-avx2 -cost-model -analyze < %s | FileCheck --check-prefix=AVX2 %s + + +define void @div_sse() { + ; SSE2: div_sse + ; SSE2: cost of 320 {{.*}} sdiv + %a0 = sdiv <16 x i8> undef, undef + ; SSE2: cost of 160 {{.*}} sdiv + %a1 = sdiv <8 x i16> undef, undef + ; SSE2: cost of 80 {{.*}} sdiv + %a2 = sdiv <4 x i32> undef, undef + ; SSE2: cost of 40 {{.*}} sdiv + %a3 = sdiv <2 x i32> undef, undef + ret void +} +; SSE2: div_avx + +define void @div_avx() { + ; AVX2: div_avx + ; AVX2: cost of 640 {{.*}} sdiv + %a0 = sdiv <32 x i8> undef, undef + ; AVX2: cost of 320 {{.*}} sdiv + %a1 = sdiv <16 x i16> undef, undef + ; AVX2: cost of 160 {{.*}} sdiv + %a2 = sdiv <8 x i32> undef, undef + ; AVX2: cost of 80 {{.*}} sdiv + %a3 = sdiv <4 x i32> undef, undef + ret void +} + + |