summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/Host.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor ExecuteAndWait to take StringRefs.Zachary Turner2018-06-121-2/+2
| | | | | | | | | | | | | | | | | | | This simplifies some code which had StringRefs to begin with, and makes other code more complicated which had const char* to begin with. In the end, I think this makes for a more idiomatic and platform agnostic API. Not all platforms launch process with null terminated c-string arrays for the environment pointer and argv, but the api was designed that way because it allowed easy pass-through for posix-based platforms. There's a little additional overhead now since on posix based platforms we'll be takign StringRefs which were constructed from null terminated strings and then copying them to null terminate them again, but from a readability and usability standpoint of the API user, I think this API signature is strictly better. llvm-svn: 334518
* [AArch64] Add Exynos to host detectionEvandro Menezes2017-12-081-0/+31
| | | | | | Differential revision: https://reviews.llvm.org/D40985 llvm-svn: 320195
* [AArch64] Add basic support for Qualcomm's Saphira CPU.Chad Rosier2017-09-251-0/+3
| | | | llvm-svn: 314105
* [Falkor] Add falkor CPU to host detectionBalaram Makam2017-09-221-0/+3
| | | | | | This returns "falkor" for Falkor CPU. llvm-svn: 313998
* [ARM] Add more CPUs to host detectionEli Friedman2017-09-131-0/+6
| | | | | | | | | This returns "cortex-a73" for second-generation Kryo; not precisely correct, but close enough. Differential Revision: https://reviews.llvm.org/D37724 llvm-svn: 313200
* [unittests] Fix up test after rL313156Vedant Kumar2017-09-131-2/+3
| | | | | Bot: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42421 llvm-svn: 313163
* [Support] sys::getProcessTriple should return a macOS triple usingAlex Lorenz2017-07-071-0/+61
| | | | | | | | | | | | | | | the system's version of macOS sys::getProcessTriple returns LLVM_HOST_TRIPLE, whose system version might not be the actual version of the system on which the compiler running. This commit ensures that, for macOS, sys::getProcessTriple returns a triple with the system's macOS version. rdar://33177551 Differential Revision: https://reviews.llvm.org/D34446 llvm-svn: 307372
* Implement host CPU detection for AArch64Yi Kong2017-04-041-0/+35
| | | | | | | | | | | | | | | | | | This shares detection logic with ARM(32), since AArch64 capable CPUs may also run in 32-bit system mode. We observe weird /proc/cpuinfo output for MSM8992 and MSM8994, where they report all CPU cores as one single model, depending on which CPU core the kernel is running on. As a workaround, we hardcode the known CPU part name for these SoCs. For big.LITTLE systems, this patch would only return the part name of the first core (usually the little core). Proper support will be added in a follow-up change. Differential Revision: D31675 llvm-svn: 299458
* Make naming in Host.h in line with coding standards.Kristof Beyls2017-03-311-13/+10
| | | | | | | Based on post-commit review comments by Chandler Carruth on https://reviews.llvm.org/D31236. Thanks! llvm-svn: 299211
* Revert "Make naming in Host.h in line with coding standards."Kristof Beyls2017-03-301-10/+13
| | | | | | | | | | | | | | | | | | | This reverts r299062, which caused build failures on Windows. It also reverts the attempts to fix the windows builds in r299064 and r299065. The introduction of namespace llvm::sys::detail makes MSVC, and seemingly also mingw, complain about ambiguity with the existing namespace llvm::detail. E.g.: C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/MathExtras.h(184): error C2872: 'detail': ambiguous symbol C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/PointerLikeTypeTraits.h(31): note: could be 'llvm::detail' C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/Host.h(80): note: or 'llvm::sys::detail' In r299064 and r299065 I tried to fix these ambiguities, based on the errors reported in the log files. It seems however that the build stops early when this kind of error is encountered, and many build-then-fix-iterations on Windows may be needed to fix this. Therefore reverting r299062 for now to get the build working again on Windows. llvm-svn: 299066
* Make naming in Host.h in line with coding standards.Kristof Beyls2017-03-301-13/+10
| | | | | | | Based on post-commit review comments by Chandler Carruth on https://reviews.llvm.org/D31236. Thanks! llvm-svn: 299062
* Refactor getHostCPUName to allow testing on non-native hardware.Kristof Beyls2017-03-301-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | This refactors getHostCPUName so that for the architectures that get the host cpu info on linux from /proc/cpuinfo, the /proc/cpuinfo parsing logic is present in the build, even if it wasn't built on a linux system for that architecture. Since the code is present in the build, we can then test that code also on other systems, i.e. we don't need to have buildbots setup for all architectures on linux to be able to test this. Instead, developers will test this as part of the regression test run. As an example, a few unit tests are added to test getHostCPUName for ARM running linux. A unit test is preferred over a lit-based test, since the expectation is that in the future, the functionality here will grow over what can be tested with "llc -mcpu=native". This is a preparation step to enable implementing the range of improvements discussed on PR30516, such as adding AArch64 support, support for big.LITTLE systems, reducing code duplication. Differential Revision: https://reviews.llvm.org/D31236 llvm-svn: 299060
* [Support] Simplify triple check in Host CPU test. NFC.Ahmed Bougacha2017-02-041-13/+4
| | | | | | Cleanup the check added in r293990 using the Triple helpers. llvm-svn: 294073
* [Support] Accept macosx triple as 'darwin' in Host unittest. NFC.Ahmed Bougacha2017-02-031-0/+1
| | | | | | | If LLVM was configured with an x86_64-apple-macosx host triple, this test would fail, as the API works but the triple isn't in the whitelist. llvm-svn: 293990
* Add computeHostNumPhysicalCores() implementation for DarwinMehdi Amini2016-10-191-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D25800 llvm-svn: 284656
* Add interface to compute number of physical cores on host systemTeresa Johnson2016-10-131-0/+47
Summary: For now I have only added support for x86_64 Linux, but other systems can be added incrementally. This is to be used for setting the default parallelism for ThinLTO backends (instead of thread::hardware_concurrency which includes hyperthreading and is too aggressive). I'll send this as a follow-on patch, and it will fall back to hardware_concurrency when the new getHostNumPhysicalCores returns -1 (when not supported for a given host system). I also added an interface to MemoryBuffer to force reading a file as a stream - this is required for /proc/cpuinfo which is a special file that looks like a normal file but appears to have 0 size. The existing readers of this file in Host.cpp are reading the first 1024 or so bytes from it, because the necessary info is near the top. But for the new functionality we need to be able to read the entire file. I can go back and change the other readers to use the new getFileAsStream as a follow-on patch since it seems much more robust. Added a unittest. Reviewers: mehdi_amini Subscribers: beanz, mgorny, llvm-commits, modocache Differential Revision: https://reviews.llvm.org/D25564 llvm-svn: 284138
OpenPOWER on IntegriCloud