Commit Graph

396304 Commits

Author SHA1 Message Date
Mitch Phillips 32adf108c8 [scudo] Add GWP-ASan state/metadata pointer proxies.
Provide accessor proxies for the gwp-asan regions that are useful in
symbolizing dumps offline. Should be useful for Fuchsia to be able to
locate these internal pointers to stash the data in a minidump.

Reviewed By: cryptoad

Differential Revision: https://reviews.llvm.org/D107909
2021-08-11 09:21:48 -07:00
Med Ismail Bennani be556d5131 [lldb/Commands] Fix heap-use-after-free error in CommandObjectProcess
This patch should fix the use-after-free error that was brought up by
the LLDB ASAN Green Dragon bot.

This is caused because the `StringRef` object was acquired too early
before being use and by the underlying memory was modified which caused
it to point to null memory.

Fetching back the string reference close to its usage location should
fix the issue.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2021-08-11 17:03:20 +01:00
Fraser Cormack 885be620f9 [LegalizeTypes][NFC] Remove else-after-return
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D107890
2021-08-11 16:48:28 +01:00
Mark de Wever d2bc4fa3c7 [libc++][doc] Improve contributor documentation.
Addresses the post-commit review comments of D107596.
2021-08-11 17:33:54 +02:00
AndreyChurbanov f94da67f49 [OpenMP][NFC] libomp: reduced timeouts in the test from 50 to 2 sec. 2021-08-11 17:58:52 +03:00
Arnold Schwaighofer 9eb99d2e73 CodeGen: No need to check for isExternC if HasStrictReturn is already false
NFC intended.

Differential Revision: https://reviews.llvm.org/D107841
2021-08-11 07:42:48 -07:00
Benjamin Kramer c1ebefdf77 [mlir] Make polynomial approximation emit std instead of LLVM ops
This is a bit cleaner and removes issues with 2d vectors. It also has a
big impact on constant folding, hence the test changes.

Differential Revision: https://reviews.llvm.org/D107896
2021-08-11 16:37:21 +02:00
Alex Zinenko a0d8a08e3e [mlir] Add std.bitcast -> llvm.bitcast conversion
The conversion is a straightforward one-to-one mapping with optional unrolling
for nD vectors, similarly to other cast operations.

Depends On D107889

Reviewed By: cota, akuegel

Differential Revision: https://reviews.llvm.org/D107891
2021-08-11 16:30:21 +02:00
Alex Zinenko 79b0576dd4 [mlir] Tighten LLVM_AnyNonAggregate ODS type constraint
The constraint was checking that the type is not an LLVM structure or array
type, but was not checking that it is an LLVM-compatible type, making it accept
incorrect types. As a result, some LLVM dialect ops could process values that
are not compatible with the LLVM dialect leading to further issues with
conversions and translations that assume all values are LLVM-compatible. Make
LLVM_AnyNonAggregate only accept LLVM-compatible types.

Reviewed By: cota, akuegel

Differential Revision: https://reviews.llvm.org/D107889
2021-08-11 16:30:19 +02:00
LLVM GN Syncbot 62c08c021d [gn build] Port 89a7bdb1f3 2021-08-11 14:16:15 +00:00
Victor Huang a0977c3f69 [PowerPC][NFC] Update llvm/test/CodeGen/PowerPC/2010-05-03-retaddr1.ll with utils/update_llc_test_checks.py 2021-08-11 09:12:10 -05:00
Louis Dionne 15071d2945 [libc++] Remove _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
All supported compilers have implemented __has_unique_object_representations
for a while, so it's reasonable to remove the workaround.

Differential Revision: https://reviews.llvm.org/D107834
2021-08-11 10:11:40 -04:00
Louis Dionne 7be03cc782 [libc++] Remove _LIBCPP_HAS_NO_IS_AGGREGATE
All supported compilers have been supporting __is_aggregate for a long
time now, so it's reasonable to remove this workaround.

Differential Revision: https://reviews.llvm.org/D107833
2021-08-11 10:10:53 -04:00
Louis Dionne 89a7bdb1f3 [libc++] Add the __bind_back and __compose helpers
Those are going to be used to implement range adaptors,
see D107098 for details.

Differential Revision: https://reviews.llvm.org/D107785
2021-08-11 10:08:20 -04:00
David Spickett 683147ff11 [compiler-rt][fuzzer] Xfail flags test on AArch64 Linux
This fails with:
/tmp/FlagsTest-5761bc.o: In function `sancov.module_ctor_8bit_counters':
FlagsTest.cpp:(.text.sancov.module_ctor_8bit_counters[sancov.module_ctor_8bit_counters]+0x14): undefined reference to `__start___sancov_cntrs'
FlagsTest.cpp:(.text.sancov.module_ctor_8bit_counters[sancov.module_ctor_8bit_counters]+0x18): undefined reference to `__stop___sancov_cntrs'
<...>

Since https://reviews.llvm.org/D107374. However the changes
there don't seem to be the real fault so xfail while I look into it.
2021-08-11 13:53:18 +00:00
Joseph Huber 01d59c0de8 [OpenMP]Fix PR50336: Remove temporary files in the offload bundler tool
Temporary files created by the offloading device toolchain are not removed
after compilation when using a two-step compilation. The offload-bundler uses a
different filename for the device binary than the `.o` file present in the
Job's input list. This is not listed as a temporary file so it is never
removed. This patch explicitly adds the device binary as a temporary file to
consume it. This fixes PR50336.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D107668
2021-08-11 08:50:47 -04:00
Raphael Isemann b136290bc4 [lldb][docs] Remove index entry to removed StructuredDataPlugins
This page was removed in b2e25572d2
2021-08-11 13:47:04 +02:00
Dmitry Vyukov 9af6156c52 tsan: fix active mapping selection
Fix bug introduced by commit 5d106f16b9.
SANITIZER_IOSSIM is always defined,
it's the value 0/1 that's meaningful.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D107888
2021-08-11 13:03:16 +02:00
Balázs Kéri 9f517fd11e [clang][analyzer] Improve bug report in alpha.security.ReturnPtrRange
Add some notes and track of bad return value.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D107051
2021-08-11 13:04:55 +02:00
Raphael Isemann f6748b24d4 [lldb][NFC] Fix small format error in TestCppVirtualFunctions 2021-08-11 12:26:56 +02:00
Raphael Isemann 7377997134 [lldb] Rework 'lldb' substitution workaround in dwarf5-lazy-dwo.c
This test is specifying the lldb log channel via `ll""db` which only really works
because the command parser ends up parsing that as `lldb`. Just putting the
channel name in quotes is enough to avoid the lldb command substitution and
doesn't rely on this weird parser behaviour.
2021-08-11 12:12:25 +02:00
Stefan Gränitz c5ab55f533 [Orc] Enable debug object tests only on x86_64 hosts
These tests rely on running IR code with an explicit x86_64 target triple. They won't work on other architectures. (They won't work for 32-bit processes on x86_64 hosts either. We will take care of this later.)

Differential Revision: https://reviews.llvm.org/D107640
2021-08-11 12:07:46 +02:00
David Green 8c50b5fbfe [ARM] Add extra debug messages for validating live outs. NFC
We are running into more and more cases where the liveouts of low
overhead loops do not validate. Add some extra debug messages to make it
clearer why.
2021-08-11 10:35:53 +01:00
Florian Mayer ab41f37ef6 [hwasan] Fix test with TCO eliminating free frame.
This broke https://lab.llvm.org/buildbot/#/builders/37/builds/6016/steps/10/logs/stdio

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D107864
2021-08-11 09:51:14 +01:00
Wang, Pengfei 6c4809825d Revert "[lld] Add lto-pgo-warn-mismatch option"
This reverts commit 0cfb00a1c9.
2021-08-11 16:25:42 +08:00
Dmitry Vyukov 8af4725576 tsan: fix Printf format string
Reported on D107745

Reported-by: Wolfgang Pieb (wolfgangp)

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107881
2021-08-11 10:22:02 +02:00
LLVM GN Syncbot f6425dfcbe [gn build] Port 2021-08-11 08:16:37 +00:00
Daniel Kiss 6b6d344731 [libunwind] Compile with -Wunused-but-set-variable
-Wunused-but-set-variable triggers a warning even the block of code is effectively dead.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D107835
2021-08-11 10:15:54 +02:00
Daniel Kiss db126ae243 [Arm][Unwind][libc++abi] Add _Unwind_ForcedUnwind to EHABI.
_Unwind_ForcedUnwind is not mandated by the EHABI but for compatibilty
reasons adding so the interface to higher layers would be the same.
Dropping EHABI specific _Unwind_Stop_Fn definition since it is not defined by EHABI.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D89570
2021-08-11 10:15:53 +02:00
Daniel Kiss 9ed1c7e496 [Unwind] Split unwind.h
Moving Itanium and ArmEHABI specific implementations to dedicated files.
This is a NFC patch.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D106461
2021-08-11 10:15:51 +02:00
Alexander Belyaev 1e733a8c04 Revert "Bufferization for tiled loop."
This reverts commit edaffebcb2.
2021-08-11 10:04:12 +02:00
Alexander Belyaev 967578f0b8 Revert "[mlir] Change the pattern for TiledLoopOp bufferization."
This reverts commit 2f946eaa9d.
2021-08-11 10:01:36 +02:00
Cullen Rhodes 1fe0e6a380 [AArch64][SME] Support ptrue(s) in streaming mode
The ptrue and ptrues instructions are legal in streaming mode, missed in
D106272.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06/SVE-Instructions

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D107807
2021-08-11 07:49:36 +00:00
Rainer Orth 7bbbf29561 [ELF] Don't emit SHF_GNU_RETAIN on Solaris
The introduction of `SHF_GNU_RETAIN` has caused massive problems on Solaris.

Initially, as reported in Bug 49437, it caused dozens of testsuite failures
on both sparc and x86.  The objects were marked as `ELFOSABI_NONE`, but
`SHF_GNU_RETAIN` is a GNU extension. In the native Solaris ABI, that flag
(in the range for OS-specific values) is `SHF_SUNW_ABSENT` with a
completely different semantics, which confuses Solaris `ld` very much.

Later, the objects became (correctly) marked `ELFOSABI_GNU`, which Solaris
`ld` doesn't support, causing it to SEGV and break the build.  The linker
is currently being hardened to not accept non-native OS ABIs to avoid this.

The need for linker support is already documented in
`clang/include/clang/Basic/AttrDocs.td`, but not currently checked.

This patch avoids all this by not emitting `SHF_GNU_RETAIN` on Solaris at all.

Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D107747
2021-08-11 09:27:51 +02:00
Matthias Springer 4b56e2ee1d [mlir][Analysis][NFC] Remove code duplication around getFlattenedAffineExprs
Remove code duplication in `addLowerOrUpperBound` and `composeMatchingMap`.

Differential Revision: https://reviews.llvm.org/D107814
2021-08-11 16:02:10 +09:00
Matthias Springer 9e6e08149c [mlir][Analysis][NFC] Reimplement FlatAffineConstraints::composeMap
Reimplement this function in terms of `composeMatchingMap`.

Also fix a bug in `composeMatchingMap` where local dims of `this` could be missing in `localCst`.

Differential Revision: https://reviews.llvm.org/D107813
2021-08-11 15:49:50 +09:00
madhur13490 61526b1262 [DAG] Reword comment for EnforceNodeIdInvariant and InvalidateNodeId. NFC.
Reviewed By: niravd

Differential Revision: https://reviews.llvm.org/D107845
2021-08-11 12:14:28 +05:30
Yolanda Chen 0cfb00a1c9 [lld] Add lto-pgo-warn-mismatch option
When enable CSPGO for ThinLTO, there are profile cfg mismatch warnings that will cause lld-link errors (with /WX).
To disable it we have to use an internal "/mllvm:-no-pgo-warn-mismatch" option.
In contrast clang uses option ”-Wno-backend-plugin“ to avoid such warnings and gcc has an explicit "-Wno-coverage-mismatch" option.

Add this "lto-pgo-warn-mismatch" option to lld to help turn on/off the profile mismatch warnings explicitly when build with ThinLTO and CSPGO.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D104431
2021-08-11 14:43:26 +08:00
Matthias Springer 98e30a9b47 [mlir][Analysis][NFC] Reimplement FlatAffineConstraints::addLowerOrUpperBound
Reimplement this function in terms of the function variant without Value semantics.

Differential Revision: https://reviews.llvm.org/D107729
2021-08-11 15:26:36 +09:00
Petr Hosek 389dc94d4b [InstrProfiling] Generate runtime hook for Fuchsia
When none of the translation units in the binary have been instrumented
we shouldn't need to link the profile runtime. However, because we pass
-u__llvm_profile_runtime on Linux and Fuchsia, the runtime would still
be pulled in and incur some overhead. On Fuchsia which uses runtime
counter relocation, it also means that we cannot reference the bias
variable unconditionally.

This change modifies the InstrProfiling pass to pull in the profile
runtime only when needed by declaring the __llvm_profile_runtime symbol
in the translation unit only when needed. For now we restrict this only
for Fuchsia, but this can be later expanded to other platforms. This
approach was already used prior to 9a041a7522, but we changed it
to always generate the __llvm_profile_runtime due to a TAPI limitation,
but that limitation may no longer apply, and it certainly doesn't apply
on platforms like Fuchsia.

Differential Revision: https://reviews.llvm.org/D98061
2021-08-10 23:21:15 -07:00
Petr Hosek c0c1c3cf93 Revert "[InstrProfiling] Emit bias variable eagerly"
This reverts commit 6660cec568 since
it was superseded by https://reviews.llvm.org/D98061.
2021-08-10 23:21:15 -07:00
Matthias Springer 97e41c004c [mlir][Analysis] Add FlatAffineConstraints::addLowerOrUpperBound
This function overload is similar to the existing `FlatAffineConstraints::addLowerOrUpperBound`. It constrains a dimension based on an affine map. However, in contrast to the other overloading, it does not attempt to align dimensions/symbols of the affine map with the dimensions/symbols of the constraint set. Instead, dimensions/symbols are expected to already be aligned.

Differential Revision: https://reviews.llvm.org/D107727
2021-08-11 15:13:48 +09:00
Johannes Doerfert fc32a5c87d [Attributor][NFC] Try to make the windows build bots happy
Failed for some reason, potentially because of the inner type
declaration in combination with the `using`. This might help.

Failure:
https://lab.llvm.org/buildbot/#/builders/127/builds/15432
2021-08-11 01:11:37 -05:00
Matthias Springer 9832e1a079 [mlir][Analysis] Add alignAffineMapWithValues
This function aligns an affine map (and operands) with given dims and syms SSA values.

This is useful in conjunction with `FlatAffineConstraints::addLowerOrUpperBound`, which requires the `boundMap` to be aligned with the constraint set's dims and syms.

Differential Revision: https://reviews.llvm.org/D107728
2021-08-11 14:59:03 +09:00
Johannes Doerfert e7e3585cde [Attributor][FIX] Handle recurrences (PHIs) in AAPointerInfo explicitly
PHI nodes are not pass through but change their value, we have to
account for that to avoid missing stores.

Follow up for D107798 to fix PR51249 for good.

Differential Revision: https://reviews.llvm.org/D107808
2021-08-11 00:49:54 -05:00
Johannes Doerfert 96da6dd6ba [Attributor][FIX] Only avoid visiting PHI uses multiple times (PR51249)
AAPointerInfoFloating needs to visit all uses and some multiple times if
we go through PHI nodes. Attributor::checkForAllUses keeps a visited set
so we don't recurs endlessly. We now allow recursion for non-phi uses so
we track all pointer offsets via PHI nodes properly without endless
recursion.

This replaces the first attempt D107579.

Differential Revision: https://reviews.llvm.org/D107798
2021-08-11 00:49:54 -05:00
Johannes Doerfert f358727ce0 [Attributor][NFC] Precommit reproducer for PR51249
The bulk of the changes come from attributes but only the @phi_store
function is effectively added.
2021-08-11 00:49:54 -05:00
Johannes Doerfert e0c5d83a92 [OpenMP][FIX] Disabled optimizations have to be made known
To avoid simplification with wrong constants we need to make sure we
know that we won't perform specific optimizations based on the users
request. The non-SPMDzation and non-CustomStateMachine flags did only
prevent the final transformation but allowed to value simplification
to go ahead.

Differential Revision: https://reviews.llvm.org/D107862
2021-08-11 00:49:53 -05:00
Craig Topper a8ae41fb51 [SelectionDAGBuilder] Save iterator to avoid second DenseMap lookup. NFC
We were calling find and then using operator[]. Instead keep the
iterator from find and use it to get the value.

Just happened to notice while investigating how we decide what extends
to use between basic blocks.
2021-08-10 22:37:48 -07:00
Mircea Trofin 510402c2c8 [NFC][MLGO] 'Use' variable used for asserts 2021-08-10 19:55:17 -07:00