summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixes for builds that require strict X/Open and POSIX compatiblityXing Xue2019-05-163-11/+39
| | | | | | | | | | | | | | | | | | | | | Summary: - Use alternative to MAP_ANONYMOUS for allocating mapped memory if it isn't available - Use strtok_r instead of strsep as part of getting program path - Don't try to find the width of a terminal using "struct winsize" and TIOCGWINSZ on POSIX builds. These aren't defined under POSIX (even though some platforms make them available when they shouldn't), so just check if we are doing a X/Open or POSIX compliant build first. Author: daltenty Reviewers: hubert.reinterpretcast, xingxue, andusy Reviewed By: hubert.reinterpretcast Subscribers: MaskRay, jsji, hiraditya, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61326 llvm-svn: 360898
* [RISCV][NFC] Add nounwind attribute to functions missing it in ↵Alex Bradbury2019-05-169-119/+119
| | | | | | | | test/CodeGen/RISCV This is in preparation for emitting CFI directives. llvm-svn: 360897
* [clang] Handle lround/llround builtinsAdhemerval Zanella2019-05-164-12/+43
| | | | | | | | | | | | As for other floating-point rounding builtins that can be optimized when build with -fno-math-errno, this patch adds support for lround and llround. It currently only optimize for AArch64 backend. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D61392 llvm-svn: 360896
* [tests][go]Add -stdlib=libc++ to build GO test if LLVM is built with libc++Xing Xue2019-05-161-1/+7
| | | | | | | | | | | | | | | | When libc++ is used to build LLVM libraries, these libraries have dependencies on libc++ and C++ STL signatures in these libraries are corresponding to libc++ implementation. Therefore, -stdlib=libc++ is required on the C++ compiler command for building GO tests that link with these LLVM libraries. Reviewers: hubert.reinterpretcast, sfertile, amyk, EricWF Reviewed By: sfertile, hubert.reinterpretcast Subscribers: jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61900 llvm-svn: 360895
* [AArch64] Handle ISD::LROUND and ISD::LLROUNDAdhemerval Zanella2019-05-165-8/+30
| | | | | | | This patch optimizes ISD::LROUND and ISD::LLROUND to fcvtas instruction. It currently only handles the scalar version. llvm-svn: 360894
* [llvm-objdump]Improve testing of some switches #1James Henderson2019-05-164-34/+255
| | | | | | | | | | | | | This is the first in a set of patches I have to improve testing of llvm-objdump. This patch targets --all-headers, --section, and --full-contents. In the --section case, it deletes a pre-canned binary which is only used by the one test and replaces it with yaml. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D61941 llvm-svn: 360893
* Recommit [Object] Change object::SectionRef::getContents() to return ↵Fangrui Song2019-05-1627-144/+166
| | | | | | | | | | | | Expected<StringRef> r360876 didn't fix 2 call sites in clang. Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. Follow-up of D61781. llvm-svn: 360892
* Reland "[analyzer] Add an example plugin for checker dependency handling"Kristof Umann2019-05-1611-27/+101
| | | | | | | | | | | Buildbots complained that they couldn't find the newly added plugins. The solution was to move the check-clang cmake target closer to the bottom of the file, after the new dependencies are added. Differential Revision: https://reviews.llvm.org/D59464 llvm-svn: 360891
* Fix hwloc topology traversal code unable to handle situation where L2 cache ↵Paul Osmialowski2019-05-161-2/+4
| | | | | | | | | | | | | | | | | | | | is common for the packages Currently cores within package that share the same L2 cache are grouped together. The current logic behind this assumes that the L2 cache is always at deeper (or the same) level than the package itself. In case when L2 cache is common for all packages (and the packages are at deeper level than L2 cache) the whole of the further topology discovery fails to find any computational units resulting in following assertion: Assertion failure at kmp_affinity.cpp(715): nActiveThreads == __kmp_avail_proc. OMP: Error #13: Assertion failure at kmp_affinity.cpp(715). This patch adds a bit of a logic that prevents such situation from occurring. Differential Revision: https://reviews.llvm.org/D61796 llvm-svn: 360890
* [CodeGen] Add lround/llround builtinsAdhemerval Zanella2019-05-1624-0/+883
| | | | | | | | | | | | | This patch add the ISD::LROUND and ISD::LLROUND along with new intrinsics. The changes are straightforward as for other floating-point rounding functions, with just some adjustments required to handle the return value being an interger. The idea is to optimize lround/llround generation for AArch64 in a subsequent patch. Current semantic is just route it to libm symbol. llvm-svn: 360889
* GlobalISel: Add buildFMA to MachineIRBuilderMatt Arsenault2019-05-162-0/+9
| | | | llvm-svn: 360888
* RegAllocFast: Improve hinting heuristicMatt Arsenault2019-05-1624-780/+764
| | | | | | | | | | | | | | | Trace through multiple COPYs when looking for a physreg source. Add hinting for vregs that will be copied into physregs (we only hinted for vregs getting copied to a physreg previously). Give hinted a register a bonus when deciding which value to spill. This is part of my rewrite regallocfast series. In fact this one doesn't even have an effect unless you also flip the allocation to happen from back to front of a basic block. Nonetheless it helps to split this up to ease review of D52010 Patch by Matthias Braun llvm-svn: 360887
* [DominatorTree] Print roots unconditionally in `print()`.Clement Courbet2019-05-161-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This came up in a debugging session. I was failing to update the root of the tree, and got during verification: ``` DominatorTree is different than a freshly computed one! Current: =============================-------------------------------- Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries. [1] %"entry+land.rhs.i" {4294967295,4294967295} [0] [2] %opeq1.exit {4294967295,4294967295} [1] Freshly computed tree: =============================-------------------------------- Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries. [1] %"entry+land.rhs.i" {4294967295,4294967295} [0] [2] %opeq1.exit {4294967295,4294967295} [1] ``` We now print: ``` DominatorTree is different than a freshly computed one! Current: =============================-------------------------------- Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries. [1] %"entry+land.rhs.i" {4294967295,4294967295} [0] [2] %opeq1.exit {4294967295,4294967295} [1] Roots: <badref> Freshly computed tree: =============================-------------------------------- Inorder Dominator Tree: DFSNumbers invalid: 0 slow queries. [1] %"entry+land.rhs.i" {4294967295,4294967295} [0] [2] %opeq1.exit {4294967295,4294967295} [1] Roots: %"entry+land.rhs.i" ``` Reviewers: kuhar, asbirlea Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61999 llvm-svn: 360886
* Fix isInSystemMacro in presence of macro and pasted tokenSerge Guelton2019-05-162-3/+13
| | | | | | | | | | | When a warning is raised from the expansion of a system macro that involves pasted token, there was still situations were they were not skipped, as showcased by this issue: https://bugzilla.redhat.com/show_bug.cgi?id=1472437 Differential Revision: https://reviews.llvm.org/D59413 llvm-svn: 360885
* [NFC] Fixup FileCheck option name in tests added in rL360881Roman Lebedev2019-05-162-2/+2
| | | | llvm-svn: 360884
* [clang-tidy] Removed superfluous and slightly annoying newlines in ↵Jonas Toth2019-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | run-clang-tidy's output. Summary: The output of clang-tidy itself already has enough newlines, so the resulting output is more in line with the usual compiler output. Patch by svenpanne. Reviewers: alexfh, JonasToth Reviewed By: JonasToth Subscribers: JonasToth, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61850 llvm-svn: 360883
* [clang-tidy] Handle member variables in readability-simplify-boolean-exprJonas Toth2019-05-162-18/+373
| | | | | | | | | | | | | | | | | - Add readability-simplify-boolean-expr test cases for member variables Fixes PR40179 Patch by LegalizeAdulthood. Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: JonasToth Subscribers: jdoerfert, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56323 llvm-svn: 360882
* [NFC][CodeGen] Add some more tests for pulling binops through shiftsRoman Lebedev2019-05-164-0/+1956
| | | | | | The ashr variant may see relaxation in https://reviews.llvm.org/D61918 llvm-svn: 360881
* GlobalISel: Add buildXor/buildNotMatt Arsenault2019-05-162-0/+42
| | | | llvm-svn: 360880
* GlobalISel: Add DstOp version of buildIntrinsicMatt Arsenault2019-05-163-0/+42
| | | | llvm-svn: 360879
* Revert r360876 "[Object] Change object::SectionRef::getContents() to return ↵Hans Wennborg2019-05-1625-151/+138
| | | | | | | | | | | | Expected<StringRef>" It broke the Clang build, see llvm-commits thread. > Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. > > Follow-up of D61781. llvm-svn: 360878
* AMDGPU/GlobalISel: Correct regbank for 1-bit and/or/xorMatt Arsenault2019-05-164-43/+43
| | | | | | Bool values should use the scc/vcc regbank since r350611. llvm-svn: 360877
* [Object] Change object::SectionRef::getContents() to return Expected<StringRef>Fangrui Song2019-05-1625-138/+151
| | | | | | | | Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. Follow-up of D61781. llvm-svn: 360876
* [lld-link] Add missing "REQUIRES: x86" to COFF/lib-module-asm.ll test.Yvan Roux2019-05-161-0/+1
| | | | | | This should fix ARM bots. llvm-svn: 360875
* DWARFContext: Return empty data extractors instead of null pointersPavel Labath2019-05-165-27/+86
| | | | | | | | | | | | | | | | | | | | | | | Summary: There are several reasons for doing this: - generally, there's no reason to differentiate between a section being absent and it being present, but empty - it matches more closely what llvm DWARF parser is doing (which also doesn't differentiate the two cases) - SymbolFileDWARF also doesn't differentiate the two cases, which makes porting the rest of sections easier - it fixes a bug in how the return-null-if-empty logic was implemented (it returned nullptr only the second time we tried to get the debug_aranges section), which meant that we hit an assert when trying to parse an empty-but-present section Reviewers: JDevlieghere, clayborg, aprantl Subscribers: zturner, lldb-commits Differential Revision: https://reviews.llvm.org/D61942 llvm-svn: 360874
* [crt] Mark dso_handle test as xfailing on ARM.Yvan Roux2019-05-161-0/+2
| | | | | | This is a temporary action to fix the bots. llvm-svn: 360873
* DWARF: Add ability to reference debug info coming from multiple sectionsPavel Labath2019-05-1618-58/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the ability to precisely address debug info in situations when a single file can have more than one debug-info-bearing sections (as is the case with type units in DWARF v4). The changes here can be classified into roughly three categories: - the code which addresses a debug info by offset gets an additional argument, which specifies the section one should look into. - the DIERef class also gets an additional member variable specifying the section. This way, code dealing with DIERefs can know which section is the object referring to. - the user_id_t encoding steals one bit from the dwarf_id field to store the section. This means the total number of separate object files (apple .o, or normal .dwo) is limited to 2 billion, but that is fine as it's not possible to hit that number without switching to DWARF64 anyway. This patch is functionally equivalent to (and inspired by) the two patches (D61503 and D61504) by Jan Kratochvil, but there are differences in the implementation: - it uses an enum instead of a bool flag to differentiate the sections - it increases the size of DIERef struct instead of reducing the amount of addressable debug info - it sets up DWARFDebugInfo to store the units in a single vector instead of two. This sets us up for the future in which type units can also live in the debug_info section, and I believe it's cleaner because there's no need for unit index remapping There are no tests with this patch as this is essentially NFC until we start parsing type units from the debug_types section. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: arphaman, jankratochvil, lldb-commits Differential Revision: https://reviews.llvm.org/D61908 llvm-svn: 360872
* [AArch64][SVE2] Asm: implement CMLA/SQRDCMLAH instructionsCullen Rhodes2019-05-166-0/+557
| | | | | | | | | | | | | | | Summary: This patch adds support for the indexed and unpredicated vectors forms of the CMLA and SQRDCMLAH instructions. The specification can be found here: https://developer.arm.com/docs/ddi0602/latest Reviewed By: SjoerdMeijer Differential Revision: https://reviews.llvm.org/D61906 llvm-svn: 360871
* [AArch64][SVE2] Asm: implement CDOT instructionCullen Rhodes2019-05-164-0/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The complex DOT instructions perform a dot-product on quadtuplets from two source vectors and the resuling wide real or wide imaginary is accumulated into the destination register. The instructions come in two forms: Vector form, e.g. cdot z0.s, z1.b, z2.b, #90 - complex dot product on four 8-bit quad-tuplets, accumulating results in 32-bit elements. The complex numbers in the second source vector are rotated by 90 degrees. cdot z0.d, z1.h, z2.h, #180 - complex dot product on four 16-bit quad-tuplets, accumulating results in 64-bit elements. The complex numbers in the second source vector are rotated by 180 degrees. Indexed form, e.g. cdot z0.s, z1.b, z2.b[3], #0 - complex dot product on four 8-bit quad-tuplets, with specified quadtuplet from second source vector, accumulating results in 32-bit elements. cdot z0.d, z1.h, z2.h[1], #0 - complex dot product on four 16-bit quad-tuplets, with specified quadtuplet from second source vector, accumulating results in 64-bit elements. The specification can be found here: https://developer.arm.com/docs/ddi0602/latest Reviewed By: SjoerdMeijer, rovka Differential Revision: https://reviews.llvm.org/D61903 llvm-svn: 360870
* [clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy.Jonas Toth2019-05-161-1/+6
| | | | | | | | | | | | | | | | | | Summary: When run-clang-tidy is given the -quiet flag, do not output the potentially hundreds of enabled check names at the beginning. Patch by svenpanne. Reviewers: alexfh, JonasToth Reviewed By: JonasToth Subscribers: JonasToth, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61849 llvm-svn: 360869
* Simplify Triple::ppc64{,le} checks with Triple::isPPC64()Fangrui Song2019-05-165-25/+14
| | | | | | | | | | While here, update some ppc64le specific check to isPPC64(), if it applies to big-endian as well, in the hope that it will ease the support of big-endian if people are interested in this area. The big-endian variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and Void Linux. llvm-svn: 360868
* [AArch64][SVE2] Asm: add unpredicated integer multiply instructionsCullen Rhodes2019-05-1614-0/+822
| | | | | | | | | | | | | | | | | | | | | Summary: Add support for the following instructions: * MUL (indexed and unpredicated vectors forms) * SQDMULH (indexed and unpredicated vectors forms) * SQRDMULH (indexed and unpredicated vectors forms) * SMULH (unpredicated, predicated form added in SVE) * UMULH (unpredicated, predicated form added in SVE) * PMUL (unpredicated) The specification can be found here: https://developer.arm.com/docs/ddi0602/latest Reviewed By: SjoerdMeijer, rovka Differential Revision: https://reviews.llvm.org/D61902 llvm-svn: 360867
* Add missing "REQUIRES: x86" to the lto/irmover-warning.ll test.Igor Kudrin2019-05-161-0/+1
| | | | llvm-svn: 360866
* Simplify ArchSpec::IsMIPS()Fangrui Song2019-05-1610-66/+15
| | | | llvm-svn: 360865
* Add Triple::isPPC64()Fangrui Song2019-05-164-5/+9
| | | | llvm-svn: 360864
* [builtin] Fixed definitions of builtins that rely on the int/long long type ↵Karl-Johan Karlsson2019-05-164-17/+195
| | | | | | | | | | | | | | | | | | | | | | is 32/64 bits Summary: The definition of the builtins __builtin_bswap32, __builtin_bitreverse32, __builtin_rotateleft32 and __builtin_rotateright32 rely on that the int type is 32 bits wide on the target. The defintions of the builtins __builtin_bswap64, __builtin_bitreverse64, __builtin_rotateleft64, and __builtin_rotateright64 rely on that the long long type is 64 bits wide. On targets where this is not the case (e.g. AVR) clang will generate faulty code (wrong llvm assembler intrinsics). This patch add support for using 'Z' (the int32_t type) in Bultins.def. The builtins above are changed to be based on the int32_t type instead of the int type, and the int64_t type instead of the long long type. The AVR backend (experimental) have a native int type that is only 16 bits wide. The supplied testcase will therefore fail if running the testcase on trunk as clang will convert e.g. __builtin_bitreverse32 into llvm.bitreverse.i16 on AVR. Reviewers: dylanmckay, spatel, rsmith, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D61845 llvm-svn: 360863
* [PPC] Fix 32-bit build of libunwindMartin Storsjo2019-05-163-256/+254
| | | | | | | | | | | | | | | Clang integrated assembler was unable to build libunwind PPC32 assembly code, present in functions used to save/restore register context. This change consists in replacing the assembly style used in libunwind source, to one that is compatible with both Clang integrated assembler as well as GNU assembler. Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D61792 llvm-svn: 360862
* [PPC64][libunwind] Fix r2 not properly restoredMartin Storsjo2019-05-163-1/+45
| | | | | | | | | | | | | | | | This change makes each unwind step inspect the instruction at the return address and, if needed, read r2 from its saved location and modify the context appropriately. The unwind logic is able to handle both ELFv1 and ELFv2 stacks. Reported by Bug 41050 Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D59694 llvm-svn: 360861
* [llvm-readobj] - Revert r360676 partially. NFC.George Rimar2019-05-161-472/+489
| | | | | | | | | | | In the r360676 "Apply clang format. NFC" I applied clang-format for whole ELFDumper.cpp. It caused a little discussion, one of the points mentioned was that previously nicely lined up tables are not so nice now. This patch reverts them. llvm-svn: 360860
* Reland r360771 "[MergeICmps] Simplify the code."Clement Courbet2019-05-168-215/+215
| | | | | | This revision does not seem to be the culprit. llvm-svn: 360859
* [LTO] Improve readability of module IDsIgor Kudrin2019-05-163-4/+37
| | | | | | | | | Module IDs can appear in diagnostic messages. This patch adds some auxiliary symbols to improve their readability. Differential Revision: https://reviews.llvm.org/D61857 llvm-svn: 360858
* [IRMover] Improve diagnostic messages for conflicting metadataIgor Kudrin2019-05-164-6/+12
| | | | | | | | | | | | This does the similar for error messages as rL344011 has done for warnings. With llvm::lto::LTO, the error might appear when LTO::run() is executed. In that case, the calling code cannot know which module causes the error and, subsequently, cannot hint the user. Differential Revision: https://reviews.llvm.org/D61880 llvm-svn: 360857
* GlobalISel: Add buildFConstant for APFloatMatt Arsenault2019-05-163-0/+13
| | | | llvm-svn: 360853
* GlobalISel: Add some FP instructions to MachineIRBuilderMatt Arsenault2019-05-162-0/+56
| | | | | | This makes FP legalization code more convenient. llvm-svn: 360852
* GlobalISel: Fix indentationMatt Arsenault2019-05-161-1/+1
| | | | llvm-svn: 360851
* GlobalISel: Add G_FCOPYSIGNMatt Arsenault2019-05-165-0/+29
| | | | llvm-svn: 360850
* Fix missing constMatt Arsenault2019-05-161-1/+1
| | | | llvm-svn: 360849
* [libFuzzer] Increase merge-sigusr sleep after sending signal.Matt Morehouse2019-05-161-1/+1
| | | | | | | Test is flaky on buildbot at least partially due to the fuzz target not exiting before we read its output. llvm-svn: 360848
* Pemove SymbolTable::addBitcode as it is redundant.Rui Ueyama2019-05-163-19/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61897 llvm-svn: 360846
* Consistently return `Symbol *` from SymbolTable's add-family functions.Rui Ueyama2019-05-162-12/+18
| | | | llvm-svn: 360845
OpenPOWER on IntegriCloud