Commit Graph

9194 Commits

Author SHA1 Message Date
LLVM GN Syncbot c0809f8d79 [gn build] Port cd4edf94cd 2020-09-15 13:32:48 +00:00
LLVM GN Syncbot 46dc41e1ef [gn build] Port a8058c6f8d 2020-09-15 13:32:47 +00:00
Nico Weber 57752b1449 [gn build] (semi-manually) port 380e746bcc 2020-09-15 09:25:30 -04:00
Florian Hahn cd4edf94cd Recommit "[ConstraintSystem] Add helpers to deal with linear constraints."
This patch recommits "[ConstraintSystem] Add helpers to deal with linear constraints."
(it reverts the revert commit 8da6ae4ce1).

The reason for the revert was using __builtin_multiply_overflow, which
is not available for all compilers. The patch has been updated to use
MulOverflow from MathExtras.h
2020-09-15 12:07:26 +01:00
Arthur Eubanks 10b12d4035 Reland [docs][NewPM] Add docs for writing NPM passes
As to not conflict with the legacy PM example passes under
llvm/lib/Transforms/Hello, this is under HelloNew. This makes the
CMakeLists.txt and general directory structure less confusing for people
following the example.

Much of the doc structure was taken from WritinAnLLVMPass.rst.

This adds a HelloWorld pass which simply prints out each function name.

More will follow after this, e.g. passes over different units of IR, analyses.
https://llvm.org/docs/WritingAnLLVMPass.html contains a lot more.

Relanded with missing "Support" dependency in LLVMBuild.txt.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D86979
2020-09-14 16:06:19 -07:00
Arthur Eubanks 39ec36415d Revert "[docs][NewPM] Add docs for writing NPM passes"
This reverts commit c2590de30d.

Breaks shared libs build
2020-09-14 15:55:17 -07:00
Arthur Eubanks c2590de30d [docs][NewPM] Add docs for writing NPM passes
As to not conflict with the legacy PM example passes under
llvm/lib/Transforms/Hello, this is under HelloNew. This makes the
CMakeLists.txt and general directory structure less confusing for people
following the example.

Much of the doc structure was taken from WritinAnLLVMPass.rst.

This adds a HelloWorld pass which simply prints out each function name.

More will follow after this, e.g. passes over different units of IR, analyses.
https://llvm.org/docs/WritingAnLLVMPass.html contains a lot more.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D86979
2020-09-14 13:26:03 -07:00
LLVM GN Syncbot 2ad38f7a46 [gn build] Port 226d80ebe2 2020-09-14 20:16:21 +00:00
Petar Avramovic 416346d1ca AMDGPU/GlobalISel/Emitter Recognize additional 'same operand checks'
The "name" of a non-leaf complex pattern (MY_PAT $op1, $op2) is
"MY_PAT:op1:op2" and the ones with same "name" represent same operand.
Add 'same operand check' for this case.

Differential Revision: https://reviews.llvm.org/D87351
2020-09-14 12:10:59 +02:00
LLVM GN Syncbot 119e57be76 [gn build] Port 30667c967d 2020-09-14 08:53:33 +00:00
Petar Avramovic 09b8871f8d AMDGPU/GlobalISel/Emitter Support for predicate code that uses operands
Predicates with 'let PredicateCodeUsesOperands = 1' want to examine
matched operands. When we encounter predicate code that uses operands,
analyze its named operand arguments and create a map between argument
index and name. Later, when leaf node with name is encountered, emit
GIM_RecordNamedOperand that will store that operand at its argument
index in operand list. This operand list will be an argument to c++
code of the predicate.

Differential Revision: https://reviews.llvm.org/D87285
2020-09-14 10:39:56 +02:00
LLVM GN Syncbot 70daa353e2 [gn build] Port cc2da5554b 2020-09-12 23:13:20 +00:00
LLVM GN Syncbot 4ede83c068 [gn build] Port 19531a81f1 2020-09-12 10:08:18 +00:00
LLVM GN Syncbot 0e0d93e2f0 [gn build] Port ad99e34c59 2020-09-12 01:54:23 +00:00
Reid Kleckner 12a281d368 [gn] Remove unneeded MC dep from llvm-tblgen
Tablegen does not have link time dependencies on MC. Having llvm-tblgen
depend on it causes it to be rebuilt in the gn build every time somebody
touches any cpp file in llvm/lib/MC* or llvm/lib/DebugInfo/Codeview*.
Touching tablegen invalidates most of the rest of the build, and
re-running it takes a while. This is is annoying for me when swapping
between branches that touch CodeView logic.

This dep was added to LLVMBuild.txt back in 2018, and presumably it was
carried over into the gn build.

Differential Revision: https://reviews.llvm.org/D87553
2020-09-11 18:28:49 -07:00
LLVM GN Syncbot c931dc0bf5 [gn build] Port 31ecf8d29d 2020-09-11 23:54:25 +00:00
Nico Weber 87494def48 [gn build] slightly improve libcxx_needs_site_config
The write_cmake_config() here still looks busted, but at least
the value that's explicitly set is now set correctly.
2020-09-11 11:32:20 -04:00
LLVM GN Syncbot de2adfaf25 [gn build] Port 8da6ae4ce1 2020-09-11 13:49:35 +00:00
Florian Hahn 8da6ae4ce1 Revert "[ConstraintSystem] Add helpers to deal with linear constraints."
This reverts commit 3eb141e507.

This uses __builtin_mul_overflow which is not available everywhere.
2020-09-11 14:49:04 +01:00
LLVM GN Syncbot bbb6392c14 [gn build] Port 3eb141e507 2020-09-11 13:43:45 +00:00
Florian Hahn 3eb141e507 [ConstraintSystem] Add helpers to deal with linear constraints.
This patch introduces a new ConstraintSystem class, that maintains a set
of linear constraints and uses Fourier–Motzkin elimination to eliminate
constraints to check if there are solutions for the system.

It also adds a convert-constraint-log-to-z3.py script, which can parse
the debug output of the constraint system and convert it to a python
script that feeds the constraints into Z3 and checks if it produces the
same result as the LLVM implementation. This is for verification
purposes.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D84544
2020-09-11 14:43:22 +01:00
Nico Weber 5692497aef [gn build] (semi-manually) port 009cd4e491 2020-09-10 15:15:59 -04:00
LLVM GN Syncbot be7cef789e [gn build] Port c01d28dc51 2020-09-10 16:54:11 +00:00
Nico Weber 29cecbc5d6 Fix clangd build after 33c9dbbd38 2020-09-10 11:05:53 -04:00
Nico Weber 33c9dbbd38 Add an explicit toggle for the static analyzer in clang-tidy
Instead of using CLANG_ENABLE_STATIC_ANALYZER for use of the
static analyzer in both clang and clang-tidy, add a second
toggle CLANG_TIDY_ENABLE_STATIC_ANALYZER.

This allows enabling the static analyzer in clang-tidy while
disabling it in clang.

Differential Revison: https://reviews.llvm.org/D87118
2020-09-10 10:48:17 -04:00
Yuriy Chernyshov 0841916e87 [TableGen] Do not construct string from nullptr
While I am trying to forbid such usages systematically in
https://reviews.llvm.org/D79427 / P2166R0 to C++ standard,
this PR fixes this (definitelly incorrect) usage in llvm.

Differential Revision: https://reviews.llvm.org/D87185
2020-09-10 16:42:11 +02:00
LLVM GN Syncbot 64104db59d [gn build] Port ebf496d805 2020-09-10 13:33:11 +00:00
Petr Hosek c4d7536136 [CMake] Simplify CMake handling for libxml2
This matches the changes made to handling of zlib done in 10b1b4a
where we rely on find_package and the imported target rather than
manually appending the library and include paths. The use of
LLVM_LIBXML2_ENABLED has been replaced by LLVM_ENABLE_LIBXML2
thus reducing the number of variables.

Differential Revision: https://reviews.llvm.org/D84563
2020-09-09 21:44:44 -07:00
LLVM GN Syncbot fdc8a1aac2 [gn build] Port c0e5e3fbfa 2020-09-09 07:32:57 +00:00
Nico Weber e09e1d97c1 [gn build] (manually) port 156b127945 2020-09-08 10:00:41 -04:00
Daniel Muñoz 6b954f1b79 [KillTheDoctor/CMake] Add missing keyword PRIVATE in target_link_libraries
Add PRIVATE keyword in target_link_libraries to prevent CMake Error on Windows.

While trying to compile llvm/clang on Windows, the following CMake error occurred. The reason is a missing PUBLIC/PRIVATE/INTERFACE keyword in target_link_libraries.

`
CMake Error at utils/KillTheDoctor/CMakeLists.txt:5 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "KillTheDoctor".  All uses of target_link_libraries with a
  target must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * cmake/modules/AddLLVM.cmake:771 (target_link_libraries)
`

Reviewed By: tambre

Differential Revision: https://reviews.llvm.org/D87203
2020-09-07 16:08:55 +03:00
LLVM GN Syncbot bb73fcfd07 [gn build] Port 23f700c785 2020-09-07 12:51:23 +00:00
LLVM GN Syncbot 9764eb9212 [gn build] Port 0478720157 2020-09-07 10:32:22 +00:00
LLVM GN Syncbot 56d1f3138b [gn build] Port 81aa66f65f 2020-09-07 10:25:26 +00:00
LLVM GN Syncbot b07cbccf28 [gn build] Port 69e5abb57b 2020-09-04 21:18:33 +00:00
Nico Weber c88a776204 [gn build] fix llvm-lit after d23b15cc16 2020-09-04 10:23:16 -04:00
LLVM GN Syncbot 952dc7f288 [gn build] Port 7fff1fbd3c 2020-09-03 20:13:38 +00:00
Arthur Eubanks e440b4933a Revert "[NewPM][Lint] Port -lint to NewPM"
This reverts commit 883399c840.
2020-09-02 21:34:29 -07:00
Arthur Eubanks 883399c840 [NewPM][Lint] Port -lint to NewPM
This also changes -lint from an analysis to a pass. It's similar to
-verify, and that is a normal pass, and lives in llvm/IR.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D87057
2020-09-02 21:13:01 -07:00
Nico Weber 1426ac0482 [gn build] Fix COMPILER_RT_HAS_* defines for libclang_rt.profile
The cmake build uses COMPILER_RT_TARGET_HAS_* in the CMakeLists.txt
but then translates it to -DCOMPILER_RT_HAS_* flags which the
c++ code checks for. So we need to define the latter, not the former.
2020-09-02 14:29:59 -04:00
LLVM GN Syncbot 293fc6c2f3 [gn build] Port 3e1e5f5449 2020-09-01 18:30:13 +00:00
LLVM GN Syncbot 1914fc9eca [gn build] Port 3d90a61cf2 2020-09-01 18:30:13 +00:00
Nico Weber ab919eed21 [gn build] port 5ffd940ac0 a bit more 2020-09-01 14:30:01 -04:00
Raphael Isemann 5ffd940ac0 Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library
This relands e9a3d1a401 which was originally
missing linking LLVMSupport into LLMVFileCheck which broke the SHARED_LIBS build.

Original summary:

The actual FileCheck logic seems to be implemented in LLVMSupport. I don't see a
good reason for having FileCheck implemented there as it has a very specific use
while LLVMSupport is a dependency of pretty much every LLVM tool there is. In
fact, the only use of FileCheck I could find (outside the FileCheck tool and the
FileCheck unit test) is a single call in GISelMITest.h.

This moves the FileCheck logic to its own LLVMFileCheck library. This way only
FileCheck and the GlobalISelTests now have a dependency on this code.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D86344
2020-09-01 14:59:28 +02:00
Petr Hosek 3c7bfbd683 [CMake] Use find_library for ncurses
Currently it is hard to avoid having LLVM link to the system install of
ncurses, since it uses check_library_exists to find e.g. libtinfo and
not find_library or find_package.

With this change the ncurses lib is found with find_library, which also
considers CMAKE_PREFIX_PATH. This solves an issue for the spack package
manager, where we want to use the zlib installed by spack, and spack
provides the CMAKE_PREFIX_PATH for it.

This is a similar change as https://reviews.llvm.org/D79219, which just
landed in master.

Patch By: haampie

Differential Revision: https://reviews.llvm.org/D85820
2020-08-31 20:06:21 -07:00
LLVM GN Syncbot 077238f1e1 [gn build] Port f5fd7486d6 2020-08-31 14:02:39 +00:00
LLVM GN Syncbot 04b30afed0 [gn build] Port 14dd073782 2020-08-31 14:02:39 +00:00
Raphael Isemann ed89eb3571 Revert "[FileCheck] Move FileCheck implementation out of LLVMSupport into its own library"
This reverts commit e9a3d1a401. Seems the new
FileCheck library doesn't link on some bots. Reverting for now.
2020-08-31 11:38:40 +02:00
Raphael Isemann e9a3d1a401 [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library
The actual FileCheck logic seems to be implemented in LLVMSupport. I don't see a
good reason for having FileCheck implemented there as it has a very specific use
while LLVMSupport is a dependency of pretty much every LLVM tool there is. In
fact, the only use of FileCheck I could find (outside the FileCheck tool and the
FileCheck unit test) is a single call in GISelMITest.h.

This moves the FileCheck logic to its own LLVMFileCheck library. This way only
FileCheck and the GlobalISelTests now have a dependency on this code.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D86344
2020-08-31 11:24:41 +02:00
sstefan1 b5dd2cd27f [UpdateTestChecks] Don't skip attributes when comparing functions 2020-08-29 15:37:36 +02:00