diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index 2a7733996c4..13062ca8cfe 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/lib/Target/X86/X86Subtarget.cpp @@ -283,6 +283,17 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() || isTargetKFreeBSD() || In64BitMode) stackAlignment = 16; + + // Gather is available since Haswell (AVX2 set). So technically, we can generate Gathers + // on all AVX2 processors. But the overhead on HSW is high. Skylake Client processor has + // faster Gathers than HSW and performance is similar to Skylake Server (AVX-512). + // The specified overhead is relative to the Load operation."2" is the number provided + // by Intel architects, This parameter is used for cost estimation of Gather Op and + // comparison with other alternatives. + if (X86ProcFamily == IntelSkylake || hasAVX512()) + GatherOverhead = 2; + if (hasAVX512()) + ScatterOverhead = 2; } void X86Subtarget::initializeEnvironment() { @@ -361,6 +372,9 @@ void X86Subtarget::initializeEnvironment() { // FIXME: this is a known good value for Yonah. How about others? MaxInlineSizeThreshold = 128; UseSoftFloat = false; + X86ProcFamily = Others; + GatherOverhead = 1024; + ScatterOverhead = 1024; } X86Subtarget &X86Subtarget::initializeSubtargetDependencies(StringRef CPU, |

