Commit Graph

376516 Commits

Author SHA1 Message Date
Arthur Eubanks 69cf735062 [NewPM] Don't error when there's an unrecognized pass name
This currently blocks --print-before/after with a legacy PM pass, for
example when we use the new PM for the optimization pipeline but the
legacy PM for the codegen pipeline. Also in the future when the codegen
pipeline works with the new PM there will be multiple places to specify
passes, so even when everything is using the new PM, there will still be
multiple places that can accept different pass names.

Reviewed By: hoy, ychen

Differential Revision: https://reviews.llvm.org/D94283
2021-01-07 22:33:32 -08:00
Raul Tambre 0ebc1fb29f [CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath
When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only
for the build tree as the install rpath will be used. This makes it impossible to run a
runtimes build when compiling with Clang and wanting the installed rpath to be
empty (i.e. `-DCMAKE_BUILD_RPATH="<some path>" -DCMAKE_SKIP_INSTALL_RPATH=ON`).

Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to
allow for such build scenarios.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D93177
2021-01-08 08:31:10 +02:00
Christudasan Devadasan ae25a397e9 AMDGPU/GlobalISel: Enable sret demotion 2021-01-08 10:56:35 +05:30
Jonas Devlieghere 57e0cd3562 [lldb] Make DoReadMemory a protected method.
DoReadMemory is LLDB's internal implementation and shouldn't be called
directly.

Differential revision: https://reviews.llvm.org/D94284
2021-01-07 21:06:36 -08:00
Jonas Devlieghere f2e05855de [lldb] Access the ModuleList through iterators where possible (NFC)
Replace uses of GetModuleAtIndexUnlocked and
GetModulePointerAtIndexUnlocked with the ModuleIterable and
ModuleIterableNoLocking where applicable.

Differential revision: https://reviews.llvm.org/D94271
2021-01-07 21:06:36 -08:00
Kazu Hirata b934160aaa [Target] Use llvm::find_if (NFC) 2021-01-07 20:29:36 -08:00
Kazu Hirata 33bf1cad75 [llvm] Use *Set::contains (NFC) 2021-01-07 20:29:34 -08:00
Kazu Hirata 8febb2e0f5 [CodeGen] Remove unused function isCallerPreservedOrConstPhysReg (NFC)
The last use of the function was removed on Oct 20, 2018 in commit
8d6ff4c0af.
2021-01-07 20:29:32 -08:00
LLVM GN Syncbot 495b301de6 [gn build] Port 6b0ee02747 2021-01-08 04:23:02 +00:00
Artem Dergachev 6b0ee02747 Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""""
This reverts commit b12f26733a.

Fix dead include that looked like another missed circular dependency.
2021-01-07 20:22:22 -08:00
David Blaikie 2ff36e7929 lldb subprogram_ranges.test - remove dependence on temp file name 2021-01-07 20:04:22 -08:00
David Blaikie 4a3c2ba890 Fix print-dot-ddg.ll so it doesn't try to write to the source tree (& uses the test temp paths instead) 2021-01-07 19:57:14 -08:00
David Blaikie 696775d96e Fix subprogram_ranges.test by explicitly using lld
Seems consistent with the way other tests in this directory do linking
2021-01-07 19:53:17 -08:00
Alexandre Ganea b14ad90b13 [LLD][COFF] Simplify function. NFC. 2021-01-07 22:37:11 -05:00
Mehdi Amini f02e61a8b9 Fix MLIR DRR matching when attributes are interleaved with operands
The ODSOperand indexing should ignore the attributes.

Differential Revision: https://reviews.llvm.org/D94281
2021-01-08 03:18:26 +00:00
Nico Weber 2759041786 [gn build] (manually) merge a whole bunch of libc++ header files
I noticed __availability was missing, so I manually diffed the
file lists and put all recently(ish) added headers:
* __availability from 2eadbc8614
* concepts from 601f763182
* execution from 0a06eb911b
* numbers from 4f6c4b473c

Also remove libcxx_install_support_headers like the CMake build did in
6706342f48, and unconditionally copy
support/win32/{limits_msvc_win32.h,locale_win32.h} like the CMake
build always did as far as I can tell.
2021-01-07 22:09:35 -05:00
LLVM GN Syncbot ab814896dc [gn build] Port b12f26733a 2021-01-08 02:19:24 +00:00
David Blaikie b12f26733a Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""
This reverts commit d2ddc694ff.

This still contains a circular dependency between Analysis and CrossTU:

$ grep -r include.*Analysis clang/include/clang/CrossTU
clang/include/clang/CrossTU/CrossTranslationUnit.h:
  #include "clang/Analysis/CrossTUAnalysisHelper.h"
$ grep -r include.*CrossTU clang/lib/Analysis
clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp:
  #include "clang/CrossTU/CrossTranslationUnit.h"
clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp:
  #include "clang/Analysis/CrossTUAnalysisHelper.h"
2021-01-07 18:18:23 -08:00
Ryan Prichard 658a1be76b [builtins] Add COMPILER_RT_BUILTINS_HIDE_SYMBOLS
On Android, when the builtins are linked into a binary, they are
typically linked using -Wl,--exclude-libs so that the symbols aren't
reexported. For the NDK, compiler-rt's default behavior (build the
builtins archive with -fvisibility=hidden) is better so that builtins
are hidden even without -Wl,--exclude-libs.

Android needs the builtins with non-hidden symbols only for a special
case: for backwards compatibility with old binaries, the libc.so and
libm.so DSOs in the platform need to export some builtins for arm32 and
32-bit x86. See D56977.

Control the behavior with a new flag,
`COMPILER_RT_BUILTINS_HIDE_SYMBOLS`, that behaves similarly to the
`*_HERMETIC_STATIC_LIBRARY` in libunwind/libcxx/libcxxabi, so that
Android can build a special builtins variant for libc.so/libm.so.

Unlike the hermetic flags for other projects, this new flag is enabled
by default.

Reviewed By: compnerd, MaskRay

Differential Revision: https://reviews.llvm.org/D93431
2021-01-07 17:53:44 -08:00
clementval 48baa7f5b1 [clang] Add powerpc64le-none-linux-gnu to gnu toolchain for PPC64
While trying to compile clang and openmp with a freshly built clang with the gcc/7.4.0
toolchain on the Summit supercomputer I face some error because of the triple under which
the GCC toolchain is installed was not present in for PPC64LE triples.
This patch add the powerpc64le-none-linux-gnu used on system like Summit and Ascent.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D94261
2021-01-07 20:08:20 -05:00
Ruiling Song 8dddcc762d [Cloning] Copy metadata of global declarations
We have modules with metadata on declarations, and out-of-tree passes
use that metadata, and we need to clone those modules. We really expect
such metadata is kept during the clone operation.

Reviewed by: arsenm, aprantl

Differential Revision: https://reviews.llvm.org/D93451
2021-01-08 08:21:18 +08:00
Alexandre Ganea 6acfc3a782 Fix build after eaadb41db6 when the MSVC libs are not in PATH. 2021-01-07 18:52:00 -05:00
Evandro Menezes 946bc50e4c [RISCV] Define the vfsqrt RVV intrinsics
Define the `vfsqrt` IR intrinsics for the respective V instructions.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Evandro Menezes <evandro.menezes@sifive.com>

Differential Revision: https://reviews.llvm.org/D93745
2021-01-07 17:29:29 -06:00
Roman Lebedev f2f81c554b
[SimplifyCFG] markAliveBlocks(): switch to non-permissive DomTree updates
No actual changes needed, invoke can't have the same block as an unwind
destination and a normal destination.
2021-01-08 02:15:27 +03:00
Roman Lebedev d59f97bb3a
[SimplifyCFG] removeUnwindEdge(): switch to non-permissive DomTree updates
No actual changes needed, Catchswitch cannot unwind to one of its catchpads.
2021-01-08 02:15:27 +03:00
Roman Lebedev f0eba8ce2d
[SimplifyCFG] changeToCall(): switch to non-permissive DomTree updates
No actual changes needed, normal and unwind destinations of an invoke
can never be identical.
2021-01-08 02:15:27 +03:00
Roman Lebedev be0a31d13b
[SimplifyCFG] DeleteDeadBlocks(): switch to non-permissive DomTree updates
No actual changes needed, DetatchDeadBlocks() was already doing the right thing.
2021-01-08 02:15:27 +03:00
Roman Lebedev 66189212bb
[SimplifyCFG] MergeBlockIntoPredecessor(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same successor more than once.
2021-01-08 02:15:26 +03:00
Roman Lebedev 05adc73db0
[SimplifyCFG] changeToUnreachable(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same predecessor more than once.
2021-01-08 02:15:26 +03:00
Roman Lebedev 6984781df9
[NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations 2021-01-08 02:15:26 +03:00
Roman Lebedev 7600d7c7be
[SimplifyCFG] removeUnreachableBlocks(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same predecessor more than once.
2021-01-08 02:15:26 +03:00
Roman Lebedev f8875c313c
[NFC][SimplifyCFG] Add test with an unreachable block with two identical successors 2021-01-08 02:15:25 +03:00
Roman Lebedev 1f9b591ee6
[SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same predecessor more than once.
2021-01-08 02:15:25 +03:00
Roman Lebedev b3822728fa
[SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in `indirectbr` handling
... which requires not deleting edges that were just deleted already.
2021-01-08 02:15:25 +03:00
Roman Lebedev 8b9a0e6f7e
[NFC][SimlifyCFG] Add some indirectbr-of-blockaddress tests 2021-01-08 02:15:25 +03:00
Roman Lebedev 36593a30a4
[SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in `SwitchInst` handling
... which requires not deleting edges that will still be present.
2021-01-08 02:15:24 +03:00
Roman Lebedev 16ab8e5f6d
[SimplifyCFG] ConstantFoldTerminator(): handle matching destinations of condbr earlier
We need to handle this case before dealing with the case of constant
branch condition, because if the destinations match, latter fold
would try to remove the DomTree edge that would still be present.

This allows to make that particular DomTree update non-permissive
2021-01-08 02:15:24 +03:00
Roman Lebedev 087be536fe
[NFC][SimplifyCFG] Add a test with cond br on constant w/ identical destinations 2021-01-08 02:15:24 +03:00
Arthur Eubanks 9ccf13c36d [NewPM][NVPTX] Port NVPTX opt passes
There are only two used in the IR optimization pipeline.
Port these and add them to the default pipeline.

Similar to https://reviews.llvm.org/D93863.

I added -mtriple to some tests since under the new PM, the passes are
only available when the TargetMachine is specified.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D93930
2021-01-07 15:12:35 -08:00
Arthur O'Dwyer ff1b6f9ff2 [libc++] Alphabetize generate_feature_test_macro_components.py. NFCI.
For ease of comparing our list with the official SD-6 list, which is alphabetized.
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#library-feature-test-macros
This also alphabetizes the lists of headers in which the macros are
defined, which harmlessly alters many comments in <version>.
Also drive-by-fix some trivial flake8 warnings.
2021-01-07 18:11:46 -05:00
Arthur Eubanks b2dafd44ca [NewPM][Hexagon] Fix HexagonVectorLoopCarriedReusePass position in pipeline
In https://reviews.llvm.org/D88138 this was incorrectly added with
registerOptimizerLastEPCallback(), when it should be
registerLoopOptimizerEndEPCallback(), matching the legacy PM's
EP_LoopOptimizerEnd.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D93929
2021-01-07 15:04:28 -08:00
Luís Marques 15f5971150 [LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detection
Adds the RISC-V ArchSpec bits contributed by @simoncook as part of D62732,
plus logic to distinguish between riscv32 and riscv64 based on ELF class.

The patch follows the implementation approach previously used for MIPS.
It defines RISC-V architecture subtypes and inspects the ELF header,
namely the ELF class, to detect the right subtype.

Differential Revision: https://reviews.llvm.org/D86292
2021-01-07 23:02:55 +00:00
Joseph Huber 2ce16810f2 [OpenMP] Always print error messages in libomptarget CUDA plugin
Summary:
Currently error messages from the CUDA plugins are only printed to the user if they have debugging enabled. Change this behaviour to always print the messages that result in offloading failure. This improves the error messages by indidcating what happened when the error occurs in the plugin library, such as a segmentation fault on the device.

Reviewed by: jdoerfert

Differential Revision: https://reviews.llvm.org/D94263
2021-01-07 17:47:32 -05:00
Michael Liao f78d6af731 [hip] Enable HIP compilation with `<complex`> on MSVC.
- MSVC has different `<complex>` implementation which calls into functions
  declared in `<ymath.h>`. Provide their device-side implementation to enable
  `<complex>` compilation on HIP Windows.

Differential Revision: https://reviews.llvm.org/D93638
2021-01-07 17:41:28 -05:00
Matt Arsenault 2cbbc6e87c GlobalISel: Fail legalization on narrowing extload below memory size 2021-01-07 17:40:34 -05:00
Louis Dionne c01202a7ef [libc++] Fix typo in run-buildbot
The installation directory was never meant to contain a brace.
2021-01-07 17:37:09 -05:00
David Blaikie 274afac9a1 lldb: Add support for DW_AT_ranges on DW_TAG_subprograms
gcc already produces debug info with this form
-freorder-block-and-partition
clang produces this sort of thing with -fbasic-block-sections and with a
coming-soon tweak to use ranges in DWARFv5 where they can allow greater
reuse of debug_addr than the low/high_pc forms.

This fixes the case of breaking on a function name, but leaves broken
printing a variable - a follow-up commit will add that and improve the
test case to match.

Differential Revision: https://reviews.llvm.org/D94063
2021-01-07 14:28:03 -08:00
Alexandre Ganea eaadb41db6 [LLD][COFF] When using PCH.OBJ, ensure func_id records indices are remapped under /DEBUG:GHASH
Before this patch, when using LLD with /DEBUG:GHASH and MSVC precomp.OBJ files, we had a bunch of:

lld-link: warning: S_[GL]PROC32ID record in blabla.obj refers to PDB item index 0x206ED1 which is not a LF[M]FUNC_ID record

This was caused by LF_FUNC_ID and LF_MFUNC_ID which didn't have correct mapping to the corresponding TPI records. The root issue was that the indexMapStorage was improperly re-assembled in UsePrecompSource::remapTpiWithGHashes.

After this patch, /DEBUG and /DEBUG:GHASH produce exactly the same debug infos in the PDB.

Differential Revision: https://reviews.llvm.org/D93732
2021-01-07 17:27:13 -05:00
Craig Topper 973c35d338 [TableGen] Make CodeGenDAGPatterns::getSDNodeNamed take a StringRef instead of const std::string &.
All callers use a string literal and the getDef method the string
is passed to already takes a StringRef.
2021-01-07 14:20:16 -08:00
David Blaikie 3503c85681 Fixup Asserts+!AbiBreakingChecks fallout from db33f85c71 2021-01-07 14:18:19 -08:00