summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/Host.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang][llvm] Obsolete Exynos M1 and M2Evandro Menezes2019-10-301-9/+9
|
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-1/+1
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* Revert "raw_ostream: add operator<< overload for std::error_code"Pavel Labath2019-08-141-1/+10
| | | | | | | | | | | This reverts commit r368849, because it breaks some bots (e.g. llvm-clang-x86_64-win-fast). It turns out this is not as NFC as we had hoped, because operator== will consider two std::error_codes to be distinct even though they both hold "success" values if they have different categories. llvm-svn: 368854
* raw_ostream: add operator<< overload for std::error_codePavel Labath2019-08-141-10/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: The main motivation for this is unit tests, which contain a large macro for pretty-printing std::error_code, and this macro is duplicated in every file that needs to do this. However, the functionality may be useful elsewhere too. In this patch I have reimplemented the existing ASSERT_NO_ERROR macros to reuse the new functionality, but I have kept the macro (as a one-liner) as it is slightly more readable than ASSERT_EQ(..., std::error_code()). Reviewers: sammccall, ilya-biryukov Subscribers: zturner, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65643 llvm-svn: 368849
* Appease MSVC builds by #ifdef wrapping runAndGetCommandOutput tests. NFCI.Simon Pilgrim2019-03-131-0/+2
| | | | llvm-svn: 356042
* Use AIX version detection at LLVM run-timeHubert Tong2019-03-131-23/+91
| | | | | | | | | | | | | | | | | | | | | | | Summary: AIX compilers define macros based on the version of the operating system. This patch implements updating of versionless AIX triples to include the host AIX version. Also, the host triple detection in the build system is adjusted to strip the AIX version information so that the run-time detection is preferred. Reviewers: xingxue, stefanp, nemanjai, jasonliu Reviewed By: xingxue Subscribers: mgorny, kristina, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58798 llvm-svn: 355995
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [AArch64] Support HiSilicon's TSV110 processorBryan Chan2018-11-091-0/+5
| | | | | | | | | | | | Reviewers: t.p.northover, SjoerdMeijer, kristof.beyls Reviewed By: kristof.beyls Subscribers: olista01, javed.absar, kristof.beyls, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D53908 llvm-svn: 346546
* [AArch64] -mcpu=native CPU detection for Cavium processorsJoel Jones2018-10-051-0/+72
| | | | | | | | | | This small patch updates the CPU detection for Cavium processors when -mcpu=native is passed on compile-line. Patch by Stefan Teleman Differential Revision: https://reviews.llvm.org/D51939 llvm-svn: 343897
* 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