Commit Graph

386803 Commits

Author SHA1 Message Date
Alexander Shaposhnikov 4dfddf715b [llvm-objcopy][MachO] Add support for LC_THREAD/LC_UNIXTHREAD
Add support for LC_THREAD/LC_UNIXTHREAD
(these load commands can be copied over without any modifications).

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D101384
2021-04-27 15:54:51 -07:00
Joseph Huber b19136e352 [OpenMP] Remove legacy pass manager run lines
Summary:
Two tests in OpenMPOpt currently fail using the legacy pass manager. Remove
these run lines to prevent tests from failing.
2021-04-27 18:03:28 -04:00
Jez Ng 700402b00e [lld-macho] Don't put an antivirus test file in reproduce.s
It appears that some antivirii do not recognize that "this is a
test": https://reviews.llvm.org/D101218#2720676

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D101402
2021-04-27 18:02:59 -04:00
Jez Ng 7ca133c360 [lld-macho] std::sort -> llvm::sort 2021-04-27 18:02:59 -04:00
Craig Topper 3067520bf4 [SelectionDAG] Use a VTSDNode to store the saturation width for FP_TO_SINT_SAT/FP_TO_UINT_SAT
Previously we used an i32 constant to store the saturation width, but i32 isn't
legal on RISCV64. This wasn't a big deal to fix, but it is extra work for the
type legalizer.

This patch uses a VTSDNode to store the type similar to SEXT_INREG. This makes
it opaque to the type legalizer.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101262
2021-04-27 14:38:42 -07:00
Craig Topper ce09dd54e6 [RISCV] Select 5 bit immediate for VSETIVLI during isel rather than peepholing in the custom inserter.
This adds a special operand type that is allowed to be either
an immediate or register. By giving it a unique operand type the
machine verifier will ignore it.

This perturbs a lot of tests but mostly it is just slightly different
instruction orders. Something bad did happen to some min/max reduction
tests. We're spilling vector registers when we weren't before.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D101246
2021-04-27 14:38:16 -07:00
Reid Kleckner a495b672b7
[NFC][SimplifyCFG] Precommit SimplifyCFG tests from D29428 2021-04-28 00:35:44 +03:00
Roman Lebedev 134f3ba3ae
[NFC][SimplifyCFG] Autogenerate check lines in few more tests 2021-04-28 00:35:44 +03:00
River Riddle 82bcd98586 [mlir] Fix bug in ForwardDataFlowAnalysis solver
Explicitly check for uninitialized to prevent crashes in edge cases where the derived analysis creates a lattice element for a value that hasn't been visited yet.
2021-04-27 14:31:27 -07:00
Arthur Eubanks cbce28f07e [ConstFold] Use const-folded operands in more places
Previously we were const folding operands but not passing them.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101394
2021-04-27 14:30:19 -07:00
Michael Kruse 3244a8b536 [OpenMP][CMake] Pass --cuda-path to regression tests.
The OpenMP runtime can be compiled using a CUDA installed at non-default
location with the -DCUDA_TOOLKIT_ROOT_DIR setting. However, check-openmp
will fail afterwards because Clang needs to know where to find the CUDA
headers.

Fix by passing -cuda-path to Clang using the value of
CUDA_TOOLKIT_ROOT_DIR which has been determined by CMake. Also set
LD_LIBRARY_PATH such that it can find the cuda runtime when executing.
This will ensure that the regression test do not depend on the current
environment, but use the environment it was configured for.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D101266
2021-04-27 16:27:40 -05:00
Dávid Bolvanský 87fc97169e [DSE] Added testcases for 11896, NFC 2021-04-27 22:56:10 +02:00
Han Zhu cd13f19031 [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function
Differential Revision: https://reviews.llvm.org/D100979
2021-04-27 13:42:30 -07:00
Nikita Popov e45168c4fa [SCEV] Handle uge/ugt predicates in applyLoopGuards()
These can be handled the same way as ule/ult, just using umax
instead of umin. This is useful in cases where the umax prevents
the upper bound from overflowing.

Differential Revision: https://reviews.llvm.org/D101196
2021-04-27 22:41:05 +02:00
Alexey Bataev 1c0ab3411a [SLP]Add a test for possibly vectorized tiny tree, NFC. 2021-04-27 13:39:02 -07:00
Dmitry Vyukov f69853ac40 tsan: fix build with COMPILER_RT_TSAN_DEBUG_OUTPUT
COMPILER_RT_TSAN_DEBUG_OUTPUT enables TSAN_COLLECT_STATS,
which changes layout of runtime structs (some structs contain
stats when the option is enabled).
It's not OK to build runtime with the define, but tests without it.
The error is detected by build_consistency_stats/nostats.
Fix this by defining TSAN_COLLECT_STATS for tests to match the runtime.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D101386
2021-04-27 22:38:56 +02:00
Dmitry Vyukov e1021dd1fd tsan: refactor fork handling
Commit efd254b636 ("tsan: fix deadlock in pthread_atfork callbacks")
fixed another deadlock related to atfork handling.
But builders with DCHECKs enabled reported failures of
pthread_atfork_deadlock2.c and pthread_atfork_deadlock3.c tests
related to the fact that we hold runtime locks on interceptor exit:
https://lab.llvm.org/buildbot/#/builders/70/builds/6727
This issue is somewhat inherent to the current approach,
we indeed execute user code (atfork callbacks) with runtime lock held.

Refactor fork handling to not run user code (atfork callbacks)
with runtime locks held. This change does this by installing
own atfork callbacks during runtime initialization.
Atfork callbacks run in LIFO order, so the expectation is that
our callbacks run last, right before the actual fork.
This way we lock runtime mutexes around fork, but not around
user callbacks.

Extend tests to also install after fork callbacks just to cover
more scenarios. Some tests also started reporting real races
that we previously suppressed.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D101385
2021-04-27 22:37:27 +02:00
Samuel Thibault e37c8fd364 Hurd: Clean up Debian multiarch /usr/include/<triplet>
This is a follow-up of 35dd6470de for the Hurd case, to avoid the
duplication of the i386-gnu path, already provided by
Hurd::getMultiarchTriple.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101324
2021-04-27 13:36:12 -07:00
Nikita Popov 0304fbcd6c [SCEV] Improve loop guard tests (NFC)
Invert the branch order to make the predicate more obvious.
Add tests with two predicates, to show that rewrites are
combined.
2021-04-27 22:34:56 +02:00
Fangrui Song bf9eef92b6 Gnu: Replace with a GCCInstallation.isValid() check with assert 2021-04-27 13:31:37 -07:00
Adrian Prantl 711a473cd9 Update testcase for D101333. 2021-04-27 13:24:24 -07:00
Samuel Thibault b13e913b31 hurd: Clean up test
- Unsupported Windows to drop backslashes code
- Upgrade to current gcc 10 version

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101347
2021-04-27 13:19:17 -07:00
Arthur Eubanks 9433bacc73 [test] Fix some func-attrs tests under the legacy PM
The new PM doesn't visit declarations in CGSCC passes. These tests
aren't testing that detail, so just run them against the new PM.
2021-04-27 13:07:56 -07:00
Samuel Thibault 932e8c3241 hurd: Detect libstdc++ include paths on Debian Hurd i386
This is a follow-up of e92d2b80c6 ("[Driver] Detect libstdc++ include
paths for native gcc (-m32 and -m64) on Debian i386") for the Debian Hurd
case, which has the same multiarch name reduction from i686 to i386.
i386-linux-gnu is actually Linux-only, so this moves the code of that commit
to Linux.cpp, and adds the same to Hurd.cpp

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101331
2021-04-27 13:04:41 -07:00
Peter Steinfeld 8b550af7a9 [flang] Handle structure constructors with forward references to PDTs
We were not correctly handling structure constructors that had forward
references to parameterized derived types.  I harvested the code that checks
for forward references that was used during analysis of function call
expressions and called it from there and also called it during the
analysis of structure constructors.

I also added a test that will produce an internal error without this change.

Differential Revision: https://reviews.llvm.org/D101330
2021-04-27 12:46:05 -07:00
Samuel Thibault 9c552d27ee hurd: Fix i386 research path
f263418402 ("[Driver] Gnu.cpp: remove obsoleted i386 triple detection
from end-of-life distribution versions") dropped the i686-gnu gcc path, but
GNU/Hurd's gcc is actually using it, and not i386.

This fixes the gcc path and update the tests to reflect it.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101317
2021-04-27 12:41:18 -07:00
Evgenii Stepanov 5275d772da Revert "tsan: fix deadlock in pthread_atfork callbacks"
Tests fail on debug builders. See the forward fix in
https://reviews.llvm.org/D101385.

This reverts commit efd254b636.
2021-04-27 12:36:31 -07:00
Sanjay Patel 025bb52903 [InstCombine] fold clamp to 2 values from min/max intrinsics
The "select" versions of these folds is also missing and can
cause infinite loops as shown in:
https://llvm.org/PR48900
...but it seems easier to match these as max/min as a first fix.

https://alive2.llvm.org/ce/z/wv-_dT
2021-04-27 15:35:49 -04:00
Sanjay Patel 4fc068eb82 [InstCombine] add tests for clamp patterns using min/max intrinsics; NFC 2021-04-27 15:35:49 -04:00
Andy Kaylor 0a82d885a4 [Dependence Analysis] Fix ExactSIV producing wrong analysis
Patch by Artem Radzikhovskyy!

Symptom: ExactSIV test produced incorrect analysis of dependencies see LIT tests
Bug: At the end of the algorithm when determining dependence direction original author forgot to divide intermediate results by gcd and round result toward zero

Although this bug can be fixed with significantly fewer changes I opted to write the code in such a way that reflects the original algorithm that Banerjee proposed, for easier reference in the future. This surprisingly results in shorter code, and fewer quotient and max/min calculations.

Changes Summary:

- fixed findGCD to return valid x and y so that they match the function description where: ax - by = gcd(a,b)
- Fixed ExactSIV test, to produce proper results
- Documented the extension of Banerjee's algorithm that the original code author introduced. Banerjee's original algorithm only tested whether Dst depends on Src, the extension also allows us to test whether Src depends on Dst, in one pass.
- ExactRDIV test worked fine. Since it uses findGCD(), it needed to be updated.Since ExactRDIV test has very few changes from the core algorithm of ExactSIV I modified the test to have consistent format as ExactSIV.
- Updated the LIT tests to be testing for correct values.

Differential Revision: https://reviews.llvm.org/D100331
2021-04-27 12:24:00 -07:00
Jay Foad 12011b5217 [AMDGPU] GCNHazardRecognizer: ignore all meta instructions
This is hopefully NFC, but should be more robust in ignoring all
instructions that should be ignored, instead of just some of them.

Differential Revision: https://reviews.llvm.org/D101372
2021-04-27 20:17:15 +01:00
Evgenii Stepanov 561f4b9087 Fix -Wunused-but-set-variable warning in msan_test.cpp 2021-04-27 12:07:13 -07:00
Roman Lebedev e4c61d5f83
[NFC][SimplifyCFG] Autogenerate check lines in many test files
These are potentially being affected by an upcoming patch.
2021-04-27 22:05:42 +03:00
David Green 8de7d8b2c2 [ARM] Recognize VIDUP from BUILDVECTORs of additions
This adds a pattern to recognize VIDUP from BUILD_VECTOR of incrementing
adds. This can come up from either geps or adds, and came up recently in
D100550. We are just looking for a BUILD_VECTOR where each lane is an
add of the first lane with N*i, where i is the lane and N is one of 1,
2, 4, or 8, supported by the VIDUP instruction.

Differential Revision: https://reviews.llvm.org/D101263
2021-04-27 19:33:24 +01:00
David Green 268f1963af [ARM] Additional VIDUP tests. NFC 2021-04-27 19:33:24 +01:00
Alexey Bataev f19e8f424f [COST][X86]Improve cost model for reverse shuffle v32i16/v64i8 in AVX512F.
Improved cost model for reverse shuffle on AVX512F for types
v32i16/v64i8.

Differential Revision: https://reviews.llvm.org/D100974
2021-04-27 11:14:21 -07:00
Roman Lebedev be935f2888
[NFC][Verifier] Fixup token PHINode test cases
It would still pass in non-assert build,
but with asserts it would now crash.

I haven't checked, but hopefully `not`'s `--crash` argument
should be enough to support both paths.
2021-04-27 21:09:43 +03:00
Jessica Clarke 7fefd032cb [ELF][MIPS] Emit dynamic relocations for PIC non-preemptible static TLS
This is the same problem as 127176e59e, but for static TLS rather than
dynamic TLS. Although we know the symbol will be the one in our own TLS
segment, and thus the offset of it within that, we don't know where in
the static TLS block our data will be allocated and thus we must emit a
dynamic relocation for this case.

Reviewed By: MaskRay, atanasyan

Differential Revision: https://reviews.llvm.org/D101381
2021-04-27 19:04:50 +01:00
Jessica Clarke 1d505016ef [ELF][MIPS] Don't emit dynamic relocations for PIE non-preemptible TLS
Whilst not wrong (unless using static PIE where the relocations are
likely not implemented by the runtime), this is inefficient, as the TLS
module indices and offsets are independent of the executable's load
address.

Reviewed By: MaskRay, atanasyan

Differential Revision: https://reviews.llvm.org/D101382
2021-04-27 19:04:50 +01:00
Ahmed Bougacha 6a2e298517 [docs] Replace Apple representative to security group.
Differential Revision: https://reviews.llvm.org/D100864
2021-04-27 11:00:49 -07:00
Roman Lebedev 15f631cc78
[NFC][IR] PHINode: ... and assert in another ctor too 2021-04-27 20:52:44 +03:00
Roman Lebedev 1ebbf84ba4
[NFC][IR] PHINode: assert we aren't trying to create token-typed PHI
Verifier will complain, but by then it may be too late,
because we might have never reached it because
we already crashed with some bogus bug.
It is best to catch this the moment it happens.
2021-04-27 20:49:42 +03:00
Anirudh Prasad 21db4cc2ea [SystemZ][z/OS] Remove register prefixes when printing out the register.
- This patch is the first part in enforcing prefix-less registers for the HLASM dialect in z/OS
- This patch removes the "%[r|f|v]" prefix while printing registers
- To achieve this, the `AssemblerDialect` field of MAI was used
- There is also a bit of refactoring done to ensure code repetition is reduced.
- Currently the LLVM assembler for SystemZ/z/OS accepts both prefixed registers and prefix-less registers. A subsequent follow-up patch will restrict the SystemZAsmParser to only accept prefix-less registers.

Crediting @kianm as an author as well.

Reviewed By: uweigand, abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D101308
2021-04-27 13:47:32 -04:00
Craig Topper e05fdab125 [TableGen] Add predicate checks to isel patterns for default HwMode.
As discussed in D100691 and based on D100889.

I removed the ModeChecks cache which provides little value. Reduced
from three loops to two. Used ArrayRef to pass the Predicate to
AppendPattern to avoid needing to construct a vector for single
mode. Used SmallVector to avoid heap allocation constructing
DefaultCheck for the in tree targets the use it.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D101240
2021-04-27 10:46:51 -07:00
Vitaly Buka 0e6f934cc3 [NFC][lsan] Another attempt to fix arm bot 2021-04-27 10:46:36 -07:00
Adrian Prantl 25bf137b1e Also display the underlying error message when displaying a fixit
When the user running LLDB with default settings sees the fixit
notification it means that the auto-applied fixit didn't work. This
patch shows the underlying error message instead of just the fixit to
make it easier to understand what the error in the expression was.

Differential Revision: https://reviews.llvm.org/D101333
2021-04-27 10:40:42 -07:00
Michał Górny ca7824c2a8 [lldb] [gdb-remote] Report QPassSignals and qXfer via extensions API
Remove hardcoded platform list for QPassSignals, qXfer:auxv:read
and qXfer:libraries-svr4:read and instead query the process plugin
via the GetSupportedExtensions() API.

Differential Revision: https://reviews.llvm.org/D101241
2021-04-27 19:34:00 +02:00
Petr Hosek 887bdff8ba [Driver] Fix tests failing in per-target multiarch layout
These failures were revealed by b4537c3f51.

Differential Revision: https://reviews.llvm.org/D101348
2021-04-27 10:19:00 -07:00
Nick Desaulniers ea8416bf4d [CodeGenOptions] make StackProtectorGuardOffset signed
GCC supports negative values for -mstack-protector-guard-offset=, this
should be a signed value. Pre-req to D100919.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101325
2021-04-27 10:12:58 -07:00
LLVM GN Syncbot 4cf942adab [gn build] Port 241c2da406 2021-04-27 16:56:33 +00:00