[llvm] r212178 - AVX-512: dec/inc instructions are slow on KNL

Elena Demikhovsky elena.demikhovsky at intel.com
Wed Jul 2 07:11:06 PDT 2014


Author: delena
Date: Wed Jul  2 09:11:05 2014
New Revision: 212178

URL: http://llvm.org/viewvc/llvm-project?rev=212178&view=rev
Log:
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.

Added:
    llvm/trunk/test/CodeGen/X86/avx512-inc-dec.ll
Modified:
    llvm/trunk/lib/Target/X86/X86.td

Modified: llvm/trunk/lib/Target/X86/X86.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86.td?rev=212178&r1=212177&r2=212178&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86.td (original)
+++ llvm/trunk/lib/Target/X86/X86.td Wed Jul  2 09:11:05 2014
@@ -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]>;

Added: llvm/trunk/test/CodeGen/X86/avx512-inc-dec.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx512-inc-dec.ll?rev=212178&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx512-inc-dec.ll (added)
+++ llvm/trunk/test/CodeGen/X86/avx512-inc-dec.ll Wed Jul  2 09:11:05 2014
@@ -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
+}
+





More information about the llvm-commits mailing list