search for: gethostcpuname

Displaying 20 results from an estimated 47 matches for "gethostcpuname".

2013 Sep 12
2
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
...something wrong with SI that is not getting saved anywhere after CPUID and 0x20 bit test before it gets overwritten by LEA. 332: mov eax,0x7 337: mov rsi,rbx 33a: cpuid 33c: xchg rsi,rbx 33f: and esi,0x20 342: shr esi,0x5 345: lea rbp,[rip+0x0] # 34c <llvm::sys::getHostCPUName()+0xbc> 34c: lea r12,[rip+0x0] # 353 <llvm::sys::getHostCPUName()+0xc3> 353: cmove rbp,r12 357: lea rdi,[rsp+0x188] 35f: lea rsi,[rip+0x0] # 366 <llvm::sys::getHostCPUName()+0xd6> In both other cases (2) & (3) SI is saved into stack region. > I pr...
2015 Jun 11
2
[LLVMdev] Self compiling latest clang from SVN
...function "void __cdecl llvm::sys::MemoryFence(void)" (?MemoryFence at sys@llvm@@YAXXZ) [C:\llvm-svn\build\utils\FileCheck\FileCheck.vcxproj] LLVMSupport.lib(Host.obj) : error LNK2019: unresolved external symbol _xgetbv referenced in function "class llvm::StringRef __cdecl llvm::sys::getHostCPUName(void)" (?getHostCPUName at sys@llvm@@YA?AVStringRef at 2@XZ) [C:\llvm-svn\build\utils\FileCheck\FileCheck.vcxproj] LLVMSupport.lib(Host.obj) : error LNK2019: unresolved external symbol __cpuidex referenced in function "class llvm::StringRef __cdecl llvm::sys::getHostCPUName(void)" (?...
2013 Sep 13
0
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
...ter CPUID and 0x20 bit test before it gets > overwritten by LEA. > > 332: mov eax,0x7 > 337: mov rsi,rbx > 33a: cpuid > 33c: xchg rsi,rbx > 33f: and esi,0x20 > 342: shr esi,0x5 > 345: lea rbp,[rip+0x0] # 34c > <llvm::sys::getHostCPUName()+0xbc> > 34c: lea r12,[rip+0x0] # 353 > <llvm::sys::getHostCPUName()+0xc3> > 353: cmove rbp,r12 > 357: lea rdi,[rsp+0x188] > 35f: lea rsi,[rip+0x0] # 366 > <llvm::sys::getHostCPUName()+0xd6> > > In both other cases (2) &amp...
2012 May 11
0
[LLVMdev] Request for Help: Teach ARM target to auto-detect cpu / subtarget features
...>> >> Regards, >> chenwj >> > The backend sounds like the wrong place to implement this feature. > > I'd have thought the Clang driver would be the ideal place? The right place to implement this is in lib/Support/Host.cpp. X86 has an implementation of sys::getHostCPUName(), but everything else just uses the: std::string sys::getHostCPUName() { return "generic"; } implementation. -Chris
2012 May 11
4
[LLVMdev] Request for Help: Teach ARM target to auto-detect cpu / subtarget features
On 11/05/12 04:56, 陳韋任 wrote: >> I've just filed PR12794: Add ARM cpu / subtarget features auto-detection. And I would very much appreciate the community's help to implement this. >> >> What motivated this? Well this: >> http://www.phoronix.com/scan.php?page=news_item&px=MTA5OTM >> >> I believe one of the reason the benchmark numbers are totally
2015 Jun 12
2
[LLVMdev] Self compiling latest clang from SVN
...ys::MemoryFence(void)" (?MemoryFence at sys@llvm@@YAXXZ) >> [C:\llvm-svn\build\utils\FileCheck\FileCheck.vcxproj] >> LLVMSupport.lib(Host.obj) : error LNK2019: unresolved external symbol >> _xgetbv referenced in function "class llvm::StringRef __cdecl >> llvm::sys::getHostCPUName(void)" (?getHostCPUName at sys@llvm@ >> @YA?AVStringRef at 2@XZ) >> [C:\llvm-svn\build\utils\FileCheck\FileCheck.vcxproj] >> LLVMSupport.lib(Host.obj) : error LNK2019: unresolved external symbol >> __cpuidex referenced in function "class llvm::StringRef __cdecl &gt...
2015 May 11
4
[LLVMdev] Set up ExecutionEngine according to actual machine capabilities
...:getProcessTriple() #ifdef _WIN32 + "-elf" #endif ); And my ExecutionEngine with llvm::EngineBuilder(std::move(module)) .setErrorStr(&err) .setMCPU(llvm::sys::getHostCPUName()) .create() This works fine on most machines, however on some virtualized machines this fails because the host CPU name implies AVX, however AVX is in fact disabled, leading to an illegal instruction when running JIT-compiled functions. Is there a b...
2017 May 08
2
LLVM and Xeon Skylake v5
getProcessTriple just determines operation system, and architecture. It doesn't deal with specific instruction set features. The CPU should be controlled by MCPU on the EngineBuilder i think. The CPU autodetection code lives in getHostCPUName in lib/Support/Host.cpp, but I don't think the JIT calls into. I think its expected the user would call it or pass a specific CPU string to the MCPU for the EngineBuilder. But getHostCPUName in LLVM 3.5 doesn't recognize Kabylake or Skylake. The Cannot select: means that an intrinsic was u...
2013 Sep 13
2
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
Actually there is no miscompile there as esi isn't needed. The flags are which the cmove is using. 342: shr esi,0x5 345: lea rbp,[rip+0x0] # 34c <llvm::sys::getHostCPUName()+0xbc> 34c: lea r12,[rip+0x0] # 353 <llvm::sys::getHostCPUName()+0xc3> 353: cmove rbp,r12 <- this is dependent on the flags from the shift. I think your real problem is that garbage went into ECX instead of 0 and caused cpuid to return 0. On Thu, Sep 12, 2013 at 9:...
2013 Sep 12
0
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
Hi Adam, > OK. I know the reason you cannot reproduce it, before posting > the patch I've decided to check for AVX before checking AVX2, > just not to cpuid AVX2 when we don't have AVX1 anyway. I suspect it was also incompetence on my part. Given the differences I'm seeing now I can't believe there'd be *no* difference in my tests if I'd done them properly.
2012 May 13
1
[LLVMdev] Request for Help: Teach ARM target to auto-detect cpu / subtarget features
Hi Chris, > The right place to implement this is in lib/Support/Host.cpp. X86 has an implementation of sys::getHostCPUName(), but everything else just uses the: > > std::string sys::getHostCPUName() { > return "generic"; > } > > implementation. I tried to let it return "armv7l" or "cortex-a9" on pandaboard, but the bitcode output by clang still has target tripl...
2013 Sep 12
3
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
> That's far more worrying to me than not being able to detect Haswell. > I can't reproduce the problem here at the moment: both debug and > release builds give identical assembly for Host.cpp. OK. I know the reason you cannot reproduce it, before posting the patch I've decided to check for AVX before checking AVX2, just not to cpuid AVX2 when we don't have AVX1 anyway.
2017 May 08
2
LLVM and Xeon Skylake v5
...have a definition for a key in it that I would need to patch up? Am I answering your questions? > On 8 May 2017, at 17:32, Craig Topper <craig.topper at gmail.com> wrote: > > I can try to help. > > Are you passing a CPU string or are you letting it autodetect the CPU using getHostCPUName? I don't see support detecting skylake or even avx-512 support in the autodetection code that far back. Are you doing the same thing for the i7 kabylake? How did you disable AVX-512 code gen? > > ~Craig > >> On Mon, May 8, 2017 at 9:21 AM, Andy Schneider via llvm-dev <llvm-...
2016 Jun 23
2
AVX512 instruction generated when JIT compiling for an avx2 architecture
On 06/23/2016 12:56 PM, Craig Topper wrote: > Can you check what value "getHostCPUName" returned? getHostCPUName() = skylake > > On Thu, Jun 23, 2016 at 9:53 AM, Frank Winter via llvm-dev > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > > With LLVM 3.8 the JIT compiler engine generates an AVX512 > instruction alth...
2014 Sep 17
3
[LLVMdev] VEX prefixes for JIT in llvm 3.5
...t On Wed, Sep 17, 2014 at 2:16 PM, Jim Grosbach <grosbach at apple.com> wrote: > Hi Matt, > > I suspect you need to specify the target CPU when you create the JIT. It’s just a method on the builder (e.g., builder.setMCPU(MCPU)). If you want auto-detection based on the host CPU, sys::getHostCPUName() returns a value suitable to be passed directly into the builder. > > -Jim > >> On Sep 17, 2014, at 11:44 AM, Matt Godbolt <matt at godbolt.org> wrote: >> >> Hi guys, >> >> I just upgraded our JIT system to use llvm 3.5 and noticed one big >> chan...
2014 Sep 17
2
[LLVMdev] VEX prefixes for JIT in llvm 3.5
...tated code a little unreadable, unfortunately. Does anyone have any suggestions as to how I might get to disassemble the post-linked code? Thanks once again! -matt On Wed, Sep 17, 2014 at 2:35 PM, Yaron Keren <yaron.keren at gmail.com> wrote: > Hi, > > You need to call llvm::sys::getHostCPUName() and pass the result to > createTargetMachine() passed to the JIT. This patch should be applied: > > http://llvm.org/bugs/show_bug.cgi?id=17422 > > Anyhow, the JIT was removed from current code and will not be in next LLVM > release. > > Yaron > > > 2014-09-17 22:...
2013 Jul 18
2
[LLVMdev] LLVM 3.3 JIT code speed
...s the kind of code we use to allocate the JIT: EngineBuilder builder(fResult->fModule); builder.setOptLevel(CodeGenOpt::Aggressive); builder.setEngineKind(EngineKind::JIT); builder.setUseMCJIT(true); builder.setCodeModel(CodeModel::JITDefault); builder.setMCPU(llvm::sys::getHostCPUName()); TargetOptions targetOptions; targetOptions.NoFramePointerElim = true; targetOptions.LessPreciseFPMADOption = true; targetOptions.UnsafeFPMath = true; targetOptions.NoInfsFPMath = true; targetOptions.NoNaNsFPMath = true; targetOptions.GuaranteedTailCallOpt = true...
2016 Sep 14
4
setDataLayout segfault
...t: int main(int argc, char** argv) { llvm::InitializeNativeTarget(); llvm::LLVMContext TheContext; unique_ptr<Module> Mod(new Module("A",TheContext)); llvm::EngineBuilder engineBuilder(std::move(Mod)); std::string mcjit_error; engineBuilder.setMCPU(llvm::sys::getHostCPUName()); engineBuilder.setEngineKind(llvm::EngineKind::JIT); engineBuilder.setOptLevel(llvm::CodeGenOpt::Aggressive); engineBuilder.setErrorStr(&mcjit_error); llvm::TargetOptions targetOptions; targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; engineBuilder.setTargetOptions...
2016 Jun 23
2
AVX512 instruction generated when JIT compiling for an avx2 architecture
...; preds = %L5 ret void } The following code line show how I call the JIT compiler. ('Mod' is pointing to the module). llvm::EngineBuilder engineBuilder(std::move(std::unique_ptr<llvm::Module>(Mod))); engineBuilder.setMCPU(llvm::sys::getHostCPUName()); engineBuilder.setEngineKind(llvm::EngineKind::JIT); engineBuilder.setOptLevel(llvm::CodeGenOpt::Aggressive); engineBuilder.setErrorStr(&mcjit_error); llvm::TargetOptions targetOptions; targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; engineBuilder.setTargetOptions( targetOptions );...
2013 Nov 23
0
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
...+ mov dword ptr [esi],edx + } + return false; + #else + return true; + #endif +#else + return true; +#endif +} + static bool OSHasAVXSupport() { #if defined(__GNUC__) // Check xgetbv; this uses a .byte sequence instead of the instruction @@ -131,6 +200,14 @@ std::string sys::getHostCPUName() { unsigned Model = 0; DetectX86FamilyModel(EAX, Family, Model); + union { + unsigned u[3]; + char c[12]; + } text; + + GetX86CpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1); + + unsigned MaxLeaf = EAX; bool HasSSE3 = (ECX & 0x1); bool HasSSE41 = (ECX &...