Commit Graph

416847 Commits

Author SHA1 Message Date
River Riddle 81f2f4dfb2 [PDLL] Add support for tablegen includes and importing ODS information
This commit adds support for processing tablegen include files, and importing
various information from ODS. This includes operations, attribute+type constraints,
attribute/operation/type interfaces, etc. This will allow for much more robust tooling,
and also allows for referencing ODS constructs directly within PDLL (imported interfaces
can be used as constraints, operation result names can be used for member access, etc).

Differential Revision: https://reviews.llvm.org/D119900
2022-03-03 16:14:03 -08:00
River Riddle e865fa7530 [TableGen] Add a library-based entry point for parsing td files
This commit adds a new `TableGenParseFile` entry point for tablegen
that parses an input buffer and invokes a callback function with
a record keeper (notably without an output buffer). This kind of entry
point is very useful for tablegen consuming tools that don't create
output, and want invoke tablegen multiple times. The current way
that we interact with tablegen is via relative includes to
TGParser(not great).

Differential Revision: https://reviews.llvm.org/D119899
2022-03-03 16:14:03 -08:00
Jez Ng dd29597e10 [LTO] Initialize canAutoHide() using canBeOmittedFromSymbolTable()
Per discussion on
https://reviews.llvm.org/D59709#inline-1148734, this seems like the
right course of action. `canBeOmittedFromSymbolTable()` subsumes and
generalizes the previous logic. In addition to handling `linkonce_odr`
`unnamed_addr` globals, we now also internalize `linkonce_odr` +
`local_unnamed_addr` constants.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D120173
2022-03-03 19:04:11 -05:00
Jez Ng 5c268743da [lld-macho][nfc] Use %lld-watchos substitution in bind-opcodes.s
Previously, we were using a syslibroot that pointed to macos while
linking against arch arm64_32, which didn't really make sense. It isn't
currently an issue, but will be if we add the `-lSystem` as part of
dealing with https://github.com/llvm/llvm-project/issues/54184.
2022-03-03 19:00:28 -05:00
Jez Ng f7547558c9 [lld-macho][nfc] Avoid using absolute addresses in cgprofile-icf.s
If we fix https://github.com/llvm/llvm-project/issues/54184, the
`dyld_stub_binder` symbol will get included in every output dylib. This
would cause the addresses of the other symbols to shift, breaking the
test as it currently stands. Let's make the test more flexible.

Reviewed By: lgrey

Differential Revision: https://reviews.llvm.org/D120940
2022-03-03 19:00:28 -05:00
Craig Topper 3d4e83f17d [RISCV] With Zbb, fold (sext_inreg (abs X)) -> (max X, (negw X))
With Zbb, abs is expanded to (max X, neg) by default. If X has 33 or
more sign bits, we can expand it a little early using negw instead of
neg to save a sext_inreg. If X started as a 32 bit value, type
legalization would have inserted a sext before the abs so X having
33 sign bits should always be true.

Note: I've used ISD::FREEZE here since we increase the number of uses.
Our default expansion for ABS doesn't do that, but I think that's a bug.

We can't do this with custom type legalization because ISD::FREEZE
doesn't propagate sign bits so later DAG combine won't expand be
able to see optmize it.

Alives2 https://alive2.llvm.org/ce/z/Gx3RNe

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D120597
2022-03-03 15:42:29 -08:00
Shoaib Meenai b4c1cbff79 [hmaptool] Fix string decoding for Python 3
Our "strings" were actually bytes, which made verbose dumping fail.
Decode them so they actually become strings.

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D118005
2022-03-03 15:18:21 -08:00
Shoaib Meenai 0c1d330431 [hmaptool] Fix dumping
It was complaining about too many values to unpack, since our struct
unpack format string specified six members, but we only had five
variables to unpack to. The sixth value is the max value length, but
it's not used in dumping, so we can ignore it.

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D118004
2022-03-03 15:18:09 -08:00
Arthur Eubanks bc1574b495 Revert "[MergeICmps] Don't require GEP"
This reverts commit e7fb1c15cb.

Causes crashes, see https://reviews.llvm.org/rGe7fb1c15cb85d748c1c4fdd5a2eb5613ec7bef1d.
2022-03-03 15:01:39 -08:00
Vladimir Vereschaka 19c1b084a7 [CMake] Update cache file for Win to ARM cross tooolchain. NFC.
Removed passing CMAKE_AR from the library configurations.
2022-03-03 14:32:16 -08:00
Jonas Devlieghere bf414cfbf7
[lldb] Fix the build after 8b3b66ea63
Remove remaining calls to FileSystem::Collect.
2022-03-03 13:57:33 -08:00
Nick Desaulniers e0adc3be13 [Mips] support "sp" named register
After Linux kernel commit
commit 200ed341b864 ("mips: Implement "current_stack_pointer"")
We observe the following build error when compiling the Linux kernel
targeting Mips:
fatal error: error in backend: Invalid register name global variable

Fixes: https://github.com/llvm/llvm-project/issues/54174
Link: https://github.com/ClangBuiltLinux/linux/issues/1608

Reviewed By: atanasyan

Differential Revision: https://reviews.llvm.org/D120926
2022-03-03 13:53:36 -08:00
Krzysztof Drewniak d7f9220bb6 [MLIR] [AMDGPU] Use correct flags when building SerializeToHsaco
The SerializeToHsaco pass does not depend on ROCm being available on
the build system - it only requires ROCm to be present at runtime.
However, the CMake file that built it tested for
MLIR_ENABLE_ROCM_RUNNER , which implies that ROCm is currently
available and is used to control building ROCm integration tests.

Referencing MLIR_ENABLE_ROCM_RUNNER instead of
MLIR_ENABLE_ROCM_CONVERSIONS in the SerializeToHsaco build therefore
causes problems for clients who wish to build projects that depend on
this pass on a system without an AMD GPU present.

Reviewed By: whchung

Differential Revision: https://reviews.llvm.org/D120663
2022-03-03 21:44:26 +00:00
Maksim Panchenko 7e570308f2 [NFC] Fix typos
Reviewed By: yota9, Amir

Differential Revision: https://reviews.llvm.org/D120859
2022-03-03 13:26:39 -08:00
Maksim Panchenko fada230920 [BOLT][NFC] Return MCRegister::NoRegister from MCPlusBuilder::getNoRegister()
Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D120863
2022-03-03 13:25:13 -08:00
Jonas Devlieghere 4212a57a54
[lldb] Remove reproducer_handler from the driver 2022-03-03 13:22:39 -08:00
Jonas Devlieghere 8b3b66ea63
[lldb] Remove FileSystem::Initialize from FileCollector
This patch removes the ability to instantiate the LLDB FileSystem class
with a FileCollector. It keeps the ability to collect files, but uses
the FileCollectorFileSystem to do that transparently.

Because the two are intertwined, this patch also removes the
finalization logic which copied the files over out of process.
2022-03-03 13:22:38 -08:00
Benjamin Kramer 29fe819ed3 Revert "Update bazel build rules to match 169ebf03ab2a6f16bfa32a36305929c7bc8e4784."
This reverts commit f2af453263. The
corresponding LLVM change was reverted in 27712243ab.
2022-03-03 22:15:36 +01:00
Aaron Ballman d74a3a514c Fixed sphinx build due to indentation 2022-03-03 16:03:05 -05:00
Mark de Wever 5f26d8636f [libc++] Removes base member from tests.
Change the tests to use the base friend function instead of members.
Also changed some types to have a base friends instead of members.

Reviewed By: #libc, ldionne, Quuxplusone

Differential Revision: https://reviews.llvm.org/D120742
2022-03-03 21:46:04 +01:00
Matt Arsenault 27712243ab Revert "Inliner: Correctly merge amdgpu-unsafe-fp-atomics attribute"
This reverts commit 169ebf03ab.

This was effectively rendering the attribute useless in the real
world, although this is still broken.
2022-03-03 15:25:32 -05:00
Sanjay Patel 5f944aacc8 [x86] add tests for vector rotate; NFC 2022-03-03 15:22:35 -05:00
Sanjay Patel 74a65e3834 [AArch64][x86] add tests for rotate/funnel combines; NFC 2022-03-03 15:22:35 -05:00
Jim Ingham c697a1f06b Fix the order of modules-loaded event and the resultant breakpoint-changed event.
The order used to be breakpoint-changed first, which didn't make much sense.

Differential Revision: https://reviews.llvm.org/D120919
2022-03-03 12:10:54 -08:00
Jim Ingham 3f438185a6 Fix up the "lldb log break" channel output.
1) Make the BreakpointEventData::Dump actually do something useful.
2) Make the Breakpoint events print when the break log channel is on
without having to turn on the events channel.

Differential Revision: https://reviews.llvm.org/D120917
2022-03-03 12:10:39 -08:00
Erich Keane 94623fb1c9 [NFC] move CheckInstantiatedFunctionTemplateConstraints to SemaConcepts.cpp
This is a Sema function that now no longer depends on any of the
functionality in SemaTemplateInstantiateDecl.cpp (as the static function
was moved to Sema in a previous NFC).  Moving it to SemaConcept means
that it and CheckFunctionConstraints can be changed to share more.
2022-03-03 11:47:20 -08:00
Philip Reames 00a877f96a [DSE] Cache liveOnEntry as clobbering access
This builds on @fhahn's D112313, and caches the liveOnEntry node as a optimized access. D112313 tied to only cache a known clobber. This change adds caching the fact that no clobber exists. It still does not cache may-clobber results.

Differential Revision: https://reviews.llvm.org/D120842
2022-03-03 11:36:21 -08:00
Philip Reames deae979a2c Revert "Reapply "[SLP] Schedule only sub-graph of vectorizable instructions"""
This reverts commit 738042711b. A second, apparently separate, issue has been reported on the original review.
2022-03-03 11:35:34 -08:00
Vasileios Porpodas 6f9640d6a3 [RegAlloc] Add a complexity limit in growRegion() to cap compilation time.
growRegion() does not scale in code with BBs with a very large number of edges.
In such code growRegion() becomes a compile-time bottleneck, consuming 60% of
the total compilation time.
This patch adds a limit to the complexity of growRegion() by incrementing a counter
in each iteration. We bail out once the limit is reached.

Differential Revision: https://reviews.llvm.org/D120752
2022-03-03 11:31:07 -08:00
Jonas Devlieghere 34eb15b5c3
[lldb] Remove reproducer verifier and corresponding command
This removes the reproducer verifier and the corresponding `reproducer
verify` subcommand.
2022-03-03 11:21:00 -08:00
Stanislav Mekhanoshin 13256caf02 [AMDGPU] Added hsa-gfx90a-v3.s test. NFC. 2022-03-03 11:17:50 -08:00
Arthur Eubanks f0b61f7957 Revert "[GlobalOpt] Don't replace alias with aliasee if either alias/aliasee may be preemptible"
This reverts commit 30e8f83c84.

Causes huge compile time regressions on certain large files. Will followup offline with author.
2022-03-03 11:04:14 -08:00
Jonas Devlieghere 59eb705277
[lldb] Remove FileSystem::Initialize from VFS mapping
This patch removes the ability to instantiate the LLDB FileSystem class
based on a VFS overlay. This also removes the "hack" where we cast the
VFS to a RedirectingFileSystem to obtain the external path. You can
still instantiate a FileSystem with a VFS, but with the caveat that
operations that rely on the external path won't work.

Differential revision: https://reviews.llvm.org/D120923
2022-03-03 11:02:11 -08:00
Stanislav Mekhanoshin f769899115 [AMDGPU] Add test for instructions unsupported on gfx940. NFC. 2022-03-03 11:01:29 -08:00
Snehasish Kumar dda7b74967 [memprof] Symbolize and cache stack frames.
Currently, symbolization of stack frames occurs on demand when the instrprof writer
iterates over all the records in the raw memprof reader. With this
change we symbolize and cache the frames immediately after reading the
raw profiles. For a large internal binary this results in a runtime
reduction of ~50% (2m -> 48s) when merging a memprof raw profile with a
raw instr profile to generate an indexed profile. This change also makes
it simpler in the future to generate additional calling context
metadata to attach to each memprof record.

Differential Revision: https://reviews.llvm.org/D120430
2022-03-03 11:00:37 -08:00
Nikolas Klauser 569d0cc46d [libc++] Remove _LIBCXX_MODULES_BUILD and ext/ headers from header tests
Reviewed By: ldionne, Quuxplusone, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D120896
2022-03-03 19:53:23 +01:00
Shivam 56eaf869be [analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions
Few weeks back I was experimenting with reading the uninitialized values from src , which is actually a bug but the CSA seems to give up at that point . I was curious about that and I pinged @steakhal on the discord and according to him this seems to be a genuine issue and needs to be fix. So I goes with fixing this bug and thanks to @steakhal who help me creating this patch. This feature seems to break some tests but this was the genuine problem and the broken tests also needs to fix in certain manner. I add a test but yeah we need more tests,I'll try to add more tests.Thanks

Reviewed By: steakhal, NoQ

Differential Revision: https://reviews.llvm.org/D120489
2022-03-04 00:21:06 +05:30
Shafik Yaghmour ae869d4484 [LLDB] Remove cases of using namespace llvm:: from header file
We have using namespace llvm::dwarf in dwarf.h header globally. Replacing that
with a using namespace within lldb_private::dwarf and moving to a
using namespace lldb_private::dwarf in .cpp files and fully qualified names
in the few header files.

Differential Revision: https://reviews.llvm.org/D120836
2022-03-03 10:39:06 -08:00
Louis Dionne 61f2b3ed21 [libc++] Move several defines to ADDITIONAL_COMPILE_FLAGS in the test suite
This avoids -Wmacro-redefined when turning warnings on with GCC.
2022-03-03 13:17:35 -05:00
Louis Dionne 863802ecf3 [libc++] Move .fail.cpp test to .verify.cpp 2022-03-03 13:17:35 -05:00
Arthur Eubanks 41e792d725 [CostModel] Change printer pass wording to work with update_analyze_test_checks.py
update_analyze_test_checks.py looks for very specific wording, update
the printer pass to match the legacy `-analyze -cost-model` wording.
2022-03-03 10:10:48 -08:00
Shivam bd1917c88a [analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions
Few weeks back I was experimenting with reading the uninitialized values from src , which is actually a bug but the CSA seems to give up at that point . I was curious about that and I pinged @steakhal on the discord and according to him this seems to be a genuine issue and needs to be fix. So I goes with fixing this bug and thanks to @steakhal who help me creating this patch. This feature seems to break some tests but this was the genuine problem and the broken tests also needs to fix in certain manner. I add a test but yeah we need more tests,I'll try to add more tests.Thanks

Reviewed By: steakhal, NoQ

Differential Revision: https://reviews.llvm.org/D120489
2022-03-03 23:21:26 +05:30
Craig Topper 608161225e [InstCombine][Analysis] Move getFCmpCode and getPredForFCmpCode to CmpInstAnalysis. NFC
The similar getICmpCode and getPredForICmpCode are already there.
This moves FP for consistency.

I think InstCombine is currently the only user of both.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D120754
2022-03-03 09:33:24 -08:00
David Spickett 742fb13475 Revert "[lldb] Correct case in description of breakpoint --on-catch/throw"
This reverts commit 6b3b3ef344.

Jim Ingham informed me that the upper case is a hint to the option
name, like you might see in a menu to show you what the shortcut is.
2022-03-03 17:20:31 +00:00
Erich Keane de5785ad9d [NFC] Change TemplateInstantiator to refer to the base using a typedef
A few places were inconsistent here, which makes a refactor to support
delayed concepts significantly more difficult.
2022-03-03 09:12:05 -08:00
Andrzej Warzynski 06be148843 [flang][nfc] Fix GCC 11 build
After merging https://reviews.llvm.org/D120801, Flang no longer builds
with GCC 11:
```
../llvm-project/flang/lib/Semantics/runtime-type-info.cpp:385:22: error: variable ‘lenParam’ set but not used [-Werror=unused-but-set-variable]
  385 |       for (SymbolRef lenParam : *lenParameters) {
      |                      ^~~~~~~~
```

I'm sending this without a review as a quick fix.
2022-03-03 17:06:54 +00:00
Akira Hatanaka 3717b9661f [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in
CGBlocks.cpp

Differential Revision: https://reviews.llvm.org/D120856
2022-03-03 08:54:46 -08:00
Emre Kultursay 71e278805a
[lldb] Fix DataExtractor symbol conflict
There are two DataExtractors in scope: one from the llvm namespace and
one from the lldb_private namespace. Some Microsoft Visual C++ compilers
(I tested with MSVC 14.23 specifically) cannot handle this situation,
and generate ambiguous symbol errors. This change fixes this compile
error.

Differential revision: https://reviews.llvm.org/D120718
2022-03-03 08:48:16 -08:00
Florian Hahn 139215af8e
[IVDescriptor] Find original 'Previous' for first-order recurrences.
This patch extends first-order recurrence handling to support cases
where we already sunk an instruction for a different recurrence, but
LastPrev comes before Previous.

To handle those cases correctly, we need to find the earliest entry for
the sink-after chain, because this is references the Previous from the
original recurrence. This is needed to ensure we use the correct
instruction as sink point.

Depends on D118558.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D118642
2022-03-03 16:41:26 +00:00
Andrzej Warzynski dd875dd88b [flang][nfc] Add missing build dependency
Two buildbots have started failing recently:
* https://lab.llvm.org/buildbot/#/builders/181/builds/3894
* https://lab.llvm.org/buildbot/#/builders/191/builds/3908

Build error:
```
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/examples/FlangOmpReport/FlangOmpReport.cpp:21:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/include/flang/Frontend/FrontendActions.h:15:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/BuiltinOps.h:16:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/FunctionInterfaces.h:17:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/BuiltinTypes.h:12:
/home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/BuiltinAttributeInterfaces.h:279:10: fatal error: 'mlir/IR/BuiltinAttributeInterfaces.h.inc' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

I have not been able to reproduce locally, but from this log it is clear
that the rule for `flangFrontend` is missing the
`MLIRBuiltinAttributeInterfacesIncGen` dependency from MLIR.  I couldn't
identify a breaking commit. I suspect that until now we have simply been
"lucky" and that dependency just happened to be built before
`flangFrontend`.

I am sending this without a review - the change is rather
straightforward and the only way to verify it is to make the buildbots
test it.
2022-03-03 16:39:58 +00:00