Commit Graph

408192 Commits

Author SHA1 Message Date
Florian Hahn ede7c2438f
[VPlan] Create header & latch blocks for skeleton up front (NFC).
By creating the header and latch blocks up front and adding blocks and
recipes in between those 2 blocks we ensure that the entry and exits of
the plan remain valid throughout construction.

In order to avoid test changes and keep printing of the plans the same,
we use the new header block instead of creating a new block on the first
iteration of the loop traversing the original loop.

We also fold the latch into its predecessor.

This is a follow up to a post-commit suggestion in D114586.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D115793
2021-12-22 12:44:25 +00:00
Florian Hahn c83ef407df
[LV] Adjust comment to say the induction is created in header.
Follow-up suggested post-commit for 1a54889f48.
2021-12-22 11:56:40 +00:00
Igor Kudrin f5907ea1c0 [unittest][DebugInfo/DWARF] Do not report skipped tests as passed
This is similar to what we have already done to some other tests.
See D102643, D102710, D102754.

Differential Revision: https://reviews.llvm.org/D116108
2021-12-22 18:52:49 +07:00
Igor Kudrin 2e11e8885c [unittest][DebugInfo/DWARF] Do not create dwarfgen::Generator if MCAsmBackend is missing
dwarfgen::Generator cannot be created if there is no asm backend for a
target. For example, if the default target triple is nvptx-nvidia-cuda,
some tests fail even after D98400, which added checks for most cases.
This patch extends the approach to the remaining cases.

Differential Revision: https://reviews.llvm.org/D116107
2021-12-22 18:52:43 +07:00
Igor Kudrin 5fc05a0a81 [unittest][DebugInfo/DWARF] Check that dwarfgen::Generator is created
If Generator::create() returns an error, tests should fail gracefully
and report the cause, for example:

[ RUN      ] DebugLineBasicFixture.ParserSkipsCorrectly
.../llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp:47: Failure
Value of: llvm::detail::TakeExpected(ExpectedGenerator)
Expected: succeeded
  Actual: failed  (no asm backend for target nvptx64-nvidia-cuda)

Differential Revision: https://reviews.llvm.org/D116106
2021-12-22 18:52:36 +07:00
Adrian Kuegel 6e9be9f7c1 [mlir][NFC] Use .empty() instead of .size() 2021-12-22 12:30:54 +01:00
Nikita Popov 0af628152a [CodeGen] Make lifetime marker test more robust (NFC)
Mark the first function optnone as well, to make sure that the
test is independent of optimization.
2021-12-22 12:28:10 +01:00
Adrian Kuegel 35c0080333 [mlir][NFC] Fix typo in VectorOps.cpp 2021-12-22 12:24:43 +01:00
Nikita Popov 8a0e35f3a7 [MemoryLocation] Don't require nocapture in getForDest()
As reames mentioned on related reviews, we don't need the nocapture
requirement here. First of all, from an API perspective, this is
not something that MemoryLocation::getForDest() should be checking
in the first place, because it does not affect which memory this
particular call can access; it's an orthogonal concern that should
be handled by the caller if necessary.

However, for both of the motivating users in DSE and InstCombine,
we don't need the nocapture requirement, because the capture can
either be purely local to the call (a pointer identity check that
is irrelevant to us), be part of the return value (which we check
is unused), or be written in the dest location, which we have
determined to be dead.

This allows us to remove the special handling for libcalls as well.

Differential Revision: https://reviews.llvm.org/D116148
2021-12-22 12:20:13 +01:00
Serge Pavlov 185c80b89a [ConstantFolding] Tests for constrained compare intrinsics
This are tests extracted from https://reviews.llvm.org/D110322, committed
prior to that patch to show the change in behavior.
2021-12-22 18:08:30 +07:00
Jun Zhan b55ea2fbc0
[Clang] Add __builtin_reduce_xor
This patch implements __builtin_reduce_xor as specified in D111529.

Reviewed By: fhahn, aaron.ballman

Differential Revision: https://reviews.llvm.org/D115231
2021-12-22 10:00:27 +00:00
Diana Picus e07736fe3c [flang] Add missing include. NFCI.
descriptor.h is using std::max, so it should include <algorithm>.

This should fix a build issue on Windows on Arm.
2021-12-22 09:17:50 +00:00
Krasimir Georgiev 37c8d5915f fix build bots after f5ac23b5ae
The old member was `= 0`:
f5ac23b5ae (diff-7781d63141d53242da0520361a554df579ecb079b33bdcfbe7a0db95d44cca49L1740)

It looks like this caused some bots to fail:
https://lab.llvm.org/buildbot/#/builders/127/builds/21684
2021-12-22 10:00:35 +01:00
Nikita Popov 9f24f010ab [RS4GC] Clean up attribute removal (NFC)
It is not necessary to explicitly check which attributes are
present, and only add those to the builder. We can simply list
all attributes that need to be stripped and remove them
unconditionally. This also allows us to use some nicer APIs that
don't require mucking about with attribute list indices.
2021-12-22 09:55:54 +01:00
Nikita Popov e8e8bfeeb7 [DataFlowSanitizer] Simplify attribute removal (NFC)
We're only removing a single attribute, so there is no need to
go through AttrBuilder.
2021-12-22 09:42:55 +01:00
Nikita Popov 3b0f5a4856 [Mips16HardFloat] Simplify attribute change (NFC)
As we're only removing and adding a single attribute, there is no
need to go through AttrBuilder.
2021-12-22 09:41:11 +01:00
Nikita Popov f5ac23b5ae [ArgPromotion][TTI] Pass types to ABI compatibility hook
The areFunctionArgsABICompatible() hook currently accepts a list of
pointer arguments, though what we're actually interested in is the
ABI compatibility after these pointer arguments have been converted
into value arguments.

This means that a) the current API is incompatible with opaque
pointers (because it requires inspection of pointee types) and
b) it can only be used in the specific context of ArgPromotion.
I would like to reuse the API when inspecting calls during inlining.

This patch converts it into an areTypesABICompatible() hook, which
accepts a list of types. This makes the method more generally usable,
and compatible with opaque pointers from an API perspective (the
actual usage in ArgPromotion/Attributor is still incompatible,
I'll follow up on that in separate patches).

Differential Revision: https://reviews.llvm.org/D116031
2021-12-22 09:37:51 +01:00
Max Kazantsev 958e7a284d [Test] Add test showing missing opportunity in IndVar's handling of lshr 2021-12-22 15:08:22 +07:00
Jason Molenda 682532ca57 Support v2 of 'main bin spec' Mach-O LC_NOTE in corefiles
Version 2 of 'main bin spec' LC_NOTE allows for the specification
of a slide of where the binary is loaded in the corefile virtual
address space.  It also adds a (currently unused) platform field
for the main binary.

Some corefile creators will only have a UUID and an offset to be
applied to the binary.

Changed TestFirmwareCorefiles.py to test this new form of
'main bin spec' with a slide, and also to run on both x86_64
and arm64 macOS systems.

Differential Revision: https://reviews.llvm.org/D116094
rdar://85938455
2021-12-22 00:02:27 -08:00
Serge Pavlov 77b923d0db [ConstantFolding] Do not remove side effect from constrained functions
According to the discussion in https://reviews.llvm.org/D110322 the code
that removes side effect from replaced function call is deleted.

Differential Revision: https://reviews.llvm.org/D115870
2021-12-22 13:45:49 +07:00
Kazu Hirata 9db0e21660 [llvm] Use depth_first (NFC) 2021-12-21 22:28:48 -08:00
Fangrui Song eb37330ac7 [ELF] Change mipsGotIndex to uint32_t
This does not decrease sizeof(InputSection) (important for memory usage) on
ELF64 by itself but allows we to add another uint32_t.
2021-12-21 20:19:51 -08:00
Chuanqi Xu 9effb6f816 [NFC] Use %clang_cc instead of %clang in c++20 module tests 2021-12-22 11:50:47 +08:00
Chuanqi Xu 759f3e297c [NFC] [C++20] [Modules] Add tests for template instantiation in transitively imported module
This commit adds two test about template class instantiation in
transitively imported module. They are used as pre-commit tests for
successive patches.

Differential Revision: https://reviews.llvm.org/D116097
2021-12-22 11:09:41 +08:00
LLVM GN Syncbot 19030717e3 [gn build] Port 7056250f51 2021-12-22 01:35:25 +00:00
Nikolas Klauser 7056250f51 [libc++][NFC] Granularize <filesystem>
Granularize the `<filesystem>` header

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D115578
2021-12-22 02:31:17 +01:00
Arthur O'Dwyer 1fe897dffd [libc++] [test] Simplify some ranges tests.
Eliminate a bogus operator== overload.
Also, check more intermediate steps in the logic we're checking here.
Some of this simplification is possible only now that we've implemented
more of <ranges>.

Differential Revision: https://reviews.llvm.org/D116002
2021-12-21 20:16:35 -05:00
Julian Lettner 63ddf0baf3 [TSan] Don't instrument code that is executed from __tsan_on_report()
See also: https://reviews.llvm.org/D111157
2021-12-21 17:02:51 -08:00
Owen Pan b9f6e09b85 [clang-format][NFC] Handle wrapping after => in mustBreakBefore()
Move the handling of brace wrapping after => from unwrapped line
parser to token annotator and clean up the parser.

Differential Revision: https://reviews.llvm.org/D115967
2021-12-21 16:42:52 -08:00
John Ericson 9531146899 [lldb] Use `GNUInstallDirs` to support custom installation dirs.
Extracted from D99484. My new plan is to start from the outside and work
inward.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D115570
2021-12-22 00:28:53 +00:00
Alexandre Ganea a282ea4898 Reland - [CodeView] Emit S_OBJNAME record
Reland integrates build fixes & further review suggestions.

Thanks to @zturner for the initial S_OBJNAME patch!

Differential Revision: https://reviews.llvm.org/D43002
2021-12-21 19:02:14 -05:00
Alexandre Ganea 5bb5142e80 Revert [CodeView] Emit S_OBJNAME record
Also revert all subsequent fixes:
- abd1cbf5e5 [Clang] Disable debug-info-objname.cpp test on Unix until I sort out the issue.
- 00ec441253 [Clang] debug-info-objname.cpp test: explictly encode a x86 target when using %clang_cl to avoid falling back to a native CPU triple.
- cd407f6e52 [Clang] Fix build by restricting debug-info-objname.cpp test to x86.
2021-12-21 19:02:14 -05:00
Nico Weber 0e9393f522 [gn build] (manually) port f68e89044a 2021-12-21 18:59:37 -05:00
Martin Storsjö d67b25e7f6 [libcxx] [test] Extend test for bash for executor-has-no-bash
If %{exec} sets "--env PATH=single-dir", the directory containing
bash and related shell utils is omitted from the path, which means
that most shell scripts would fail.

(Setting PATH is needed for DLL builds on Windows; PATH fills the same
role as e.g. LD_LIBRARY_PATH on Linux.)

This condition is missed in the current test, because the executor
run.py first resolves the executable to run using the original path,
then invokes that executable with an environment with a restricted
path. Thus the executor is able to run bash, but that bash is then
unable to run further shell commands (other than bash builtins).

Extend the test from "bash --version" to "bash -c 'bash --version'".
This correctly identifies the executor-has-no-bash condition in the
current Windows CI configs, allowing removing 6 cases of
LIBCXX-WINDOWS-FIXME.

Another longterm fix would be to extend run.py with an option like
"--env-prepend PATH=dir", to allow keeping the current path while
adding a directory to it.

Differential Revision: https://reviews.llvm.org/D116117
2021-12-22 00:43:29 +02:00
Martin Storsjö f68e89044a [libcxx] Add LIBCXX_EXTRA_SITE_DEFINES for adding extra defines in __config_site
This is similar to the existing setting LIBCXX_ABI_DEFINES, with
the difference that this also allows setting other defines than
ones that start with "_LIBCPP_ABI_", and allows setting defines
to a specific value.

This allows avoiding using LIBCXX_TEST_COMPILER_FLAGS in two
CI configurations.

Differential Revision: https://reviews.llvm.org/D116109
2021-12-22 00:43:29 +02:00
Martin Storsjö c1a14a5c3e [libcxx] Use LIBCXX_EXECUTOR in new test configs
This allows cross-testing (by setting LIBCXX_EXECUTOR to point
to ssh.py) without making an entirely new test config file.

Implicitly, this also fixes quoting of the python executable name
(which is quoted in test/CMakeLists.txt).

Differential Revision: https://reviews.llvm.org/D115398
2021-12-22 00:43:28 +02:00
Alexandre Ganea d26520f6f7 [Clang] Own the CommandLineArgs in CodeGenOptions
Fixes PR52704 : https://github.com/llvm/llvm-project/issues/52704

Differential Revision: https://reviews.llvm.org/D116011
2021-12-21 17:41:35 -05:00
Louis Dionne beff71520b [libc++] Partially revert 346ef5e587
This moves the macro definitions back to __config, but keeps the
improved documentation. 346ef5e587 had broken the MinGW build.
2021-12-21 23:58:17 +02:00
Kirill Stoimenov 2477e69c6d [ASan] Change optimized callbacks visibility to hidden.
Making callbacks hidden will remove PLT calls.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116121
2021-12-21 21:32:30 +00:00
Nemanja Ivanovic de4e0195ae [PowerPC] Add missed test case updates
In commit 1674d9b6b2,
I missed adding the updates to existing test cases.
This should bring the bots back to green.
2021-12-21 14:55:19 -06:00
Louis Dionne 346ef5e587 [libc++][NFC] Improve documentation of the various random_device implementations
Also, move the setting of the macro closer to its point of use, which
also has the benefit of uncluttering `__config`.
2021-12-21 15:32:09 -05:00
Nemanja Ivanovic 1674d9b6b2 [PowerPC] Fix vector equality comparison for v2i64 pre-Power8
The current code makes the assumption that equality
comparison can be performed with a word comparison
instruction. While this is true if the entire 64-bit
results are used, it does not generally work. It is
possible that the low order words and high order
words produce different results and a user of only
one will get the wrong result.

This patch adds an and of the result words so that
each word has the result of the comparison of the
entire doubleword that contains it.

Differential revision: https://reviews.llvm.org/D115678
2021-12-21 14:28:41 -06:00
Nemanja Ivanovic a3ea9052d6 [PowerPC] Do not increase cost for getUserCost with MMA types
Commit 150681f increases
cost of producing MMA types (vector pair and quad).
However, it increases the cost for getUserCost() which is
used in unrolling. As a result, loops that contain these
types already (from the user code) cannot be unrolled
(even with the user's unroll pragma). This was an unintended
sideeffect. Reverting that portion of the commit to allow
unrolling such loops.

Differential revision: https://reviews.llvm.org/D115424
2021-12-21 13:36:08 -06:00
Tue Ly db8716a2ec [libc] Show average runtime for math single-input-single-output performance tests.
Run performance tests in denormal and normal ranges separately and show more detailed results.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D116112
2021-12-21 14:22:20 -05:00
LLVM GN Syncbot 3ce4b6a599 [gn build] Port f78d49e068 2021-12-21 18:57:55 +00:00
Dmitry Vyukov f78d49e068 tsan: remove old vector clocks
They are unused in the new tsan runtime.

Depends on D112604.

Reviewed By: vitalybuka, melver

Differential Revision: https://reviews.llvm.org/D112605
2021-12-21 19:54:27 +01:00
Dmitry Vyukov 22a251c3d0 tsan: remove hacky call
It's unused in the new tsan runtime.

Depends on D112603.

Reviewed By: vitalybuka, melver

Differential Revision: https://reviews.llvm.org/D112604
2021-12-21 19:53:49 +01:00
Dmitry Vyukov 9789e74a90 tsan: reduce shadow ranges
The new tsan runtime has 2x more compact shadow.
Adjust shadow ranges accordingly.

Depends on D112603.

Reviewed By: vitalybuka, melver

Differential Revision: https://reviews.llvm.org/D113751
2021-12-21 19:53:19 +01:00
Dmitry Vyukov 53fc462513 tsan: remove unused variable
Depends on D113983.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113984
2021-12-21 19:52:34 +01:00
Dmitry Vyukov c82bd4c5ba tsan: use VReport instead of VPrintf in background thread
If there are multiple processes, it's hard to understand
what output comes from what process.
VReport prepends pid to the output. Use it.

Depends on D113982.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113983
2021-12-21 19:51:48 +01:00