From: Elena Demikhovsky Date: Wed, 2 Jul 2014 14:11:05 +0000 (+0000) Subject: AVX-512: dec/inc instructions are slow on KNL X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0780b6db5d6cdc25bea8ce16e391835d98ac21ad;p=oota-llvm.git AVX-512: dec/inc instructions are slow on KNL After Alexey Volkov, I'm adding the same property for KNL, that prefers ADD/SUB instead of INC/DEC. Added a test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212178 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86.td b/lib/Target/X86/X86.td index 0ac801a9b0a..93f516a151a 100644 --- a/lib/Target/X86/X86.td +++ b/lib/Target/X86/X86.td @@ -273,7 +273,8 @@ def : ProcessorModel<"knl", HaswellModel, FeatureCMPXCHG16B, FeatureFastUAMem, FeaturePOPCNT, FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C, FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI, - FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE]>; + FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE, + FeatureSlowIncDec]>; def : Proc<"k6", [FeatureMMX]>; def : Proc<"k6-2", [Feature3DNow]>; diff --git a/test/CodeGen/X86/avx512-inc-dec.ll b/test/CodeGen/X86/avx512-inc-dec.ll new file mode 100644 index 00000000000..f04ca878f43 --- /dev/null +++ b/test/CodeGen/X86/avx512-inc-dec.ll @@ -0,0 +1,13 @@ +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s + +;CHECK-LABEL: test +;CHECK-NOT: dec +;CHECK_NOT: enc +;CHECK: ret +define i32 @test(i32 %a, i32 %b) { + %a1 = add i32 %a, -1 + %b1 = add i32 %b, 1 + %res = mul i32 %a1, %b1 + ret i32 %res +} +