]> granicus.if.org Git - llvm/commitdiff
[X86] Apply SlowIncDec feature to Sandybridge/Ivybridge CPUs as well
authorCraig Topper <craig.topper@intel.com>
Wed, 30 Aug 2017 05:00:35 +0000 (05:00 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 30 Aug 2017 05:00:35 +0000 (05:00 +0000)
Currently we start applying this on Haswell and newer. I don't believe anything changed in the Haswell architecture to make this the right cutoff point. The partial flag handling around this has been roughly the same since Sandybridge.

Differential Revision: https://reviews.llvm.org/D37250

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312099 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86.td
test/CodeGen/X86/misched-fusion.ll
test/CodeGen/X86/rdrand.ll

index 888af176a86de1c5305133b6e05712b24c8d944c..6856bd21670e50ba410bb0d036e6b8226c2c75a1 100644 (file)
@@ -528,6 +528,7 @@ def SNBFeatures : ProcessorFeatures<[], [
   FeatureSlow3OpsLEA,
   FeatureFastScalarFSQRT,
   FeatureFastSHLDRotate,
+  FeatureSlowIncDec,
   FeatureMacroFusion
 ]>;
 
@@ -560,8 +561,7 @@ def HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [
   FeatureERMSB,
   FeatureFMA,
   FeatureLZCNT,
-  FeatureMOVBE,
-  FeatureSlowIncDec
+  FeatureMOVBE
 ]>;
 
 class HaswellProc<string Name> : ProcModel<Name, HaswellModel,
index 1559a37343a11bc6ef109b64db53fbe12513c238..ec739093c9c9a054537ba1df3fd6ab187a4df63c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-- -mcpu=corei7-avx -disable-lsr -pre-RA-sched=source -enable-misched -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-- -mcpu=corei7-avx -mattr=-slow-incdec -disable-lsr -pre-RA-sched=source -enable-misched -verify-machineinstrs | FileCheck %s
 
 ; Verify that TEST+JE are scheduled together.
 ; CHECK: test_je
index 0638e00952822d0e4da5cb92249f03feebe7055d..1e0c4f114dd54afb832695e1bbe90b259a0f32c3 100644 (file)
@@ -93,7 +93,7 @@ define void @loop(i32* %p, i32 %n) nounwind {
 ; X86-NEXT:    rdrandl %edx
 ; X86-NEXT:    movl %edx, (%ecx)
 ; X86-NEXT:    leal 4(%ecx), %ecx
-; X86-NEXT:    decl %eax
+; X86-NEXT:    addl $-1, %eax
 ; X86-NEXT:    jne .LBB3_2
 ; X86-NEXT:  .LBB3_3: # %while.end
 ; X86-NEXT:    retl
@@ -108,7 +108,7 @@ define void @loop(i32* %p, i32 %n) nounwind {
 ; X64-NEXT:    rdrandl %eax
 ; X64-NEXT:    movl %eax, (%rdi)
 ; X64-NEXT:    leaq 4(%rdi), %rdi
-; X64-NEXT:    decl %esi
+; X64-NEXT:    addl $-1, %esi
 ; X64-NEXT:    jne .LBB3_1
 ; X64-NEXT:  .LBB3_2: # %while.end
 ; X64-NEXT:    retq