Commit Graph

379832 Commits

Author SHA1 Message Date
Sam Clegg
ac2be2b6a3 [lld][WebAssembly] Fix for weak undefined functions in -pie mode
This fixes two somewhat related issues.  Firstly we were never
generating imports for weak functions (even with the `import-functions`
policy for undefined symbols).  Adding a direct call to foo in the
`weak-undefined-pic.s` exposed a crash in the linker which this
change fixes.

Secondly we were failing to call `handleWeakUndefines` for the `-pie`
case which is PIC but doesn't set the undefined symbol policy to
`import-functions`.  With this change `-pie` binaries will by default
call `handleWeakUndefines` which generates the undefined stub handlers
for any weakly undefined symbols.

Fixes: https://github.com/emscripten-core/emscripten/issues/13337

Differential Revision: https://reviews.llvm.org/D95914
2021-02-11 17:16:03 -08:00
Philip Reames
72fc5b1b8e [tests] Autogen update test to remove whitespace diffs 2021-02-11 17:06:49 -08:00
Philip Reames
b911a71427 [tests] precommit a tests for D96534 (and other range quality items) 2021-02-11 17:02:59 -08:00
Philip Reames
6538cef317 [tests] Autogen a few tests for ease of update 2021-02-11 16:54:06 -08:00
Vitaly Buka
f2133f2e31 [NFC,memprof] Update test after D96319 2021-02-11 16:36:16 -08:00
Vitaly Buka
686b65f85f [Msan, NewPM] Reduce size of msan binaries
EarlyCSEPass called after msan redices code size by about 10%.
Similar optimization exists for legacy pass manager in
addGeneralOptsForMemorySanitizer.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D96406
2021-02-11 16:07:18 -08:00
Craig Topper
7a7836b4d8 [RISCV] Add a pattern for a scalable vector mask vnot.
We can use a vnand.mm with the same register for both inputs.
This avoids materializing an alls ones constant with vmset.mm.
2021-02-11 15:34:58 -08:00
Vitaly Buka
f2f59d2a06 [NFC] Extract function which registers sanitizer passes
Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D96481
2021-02-11 15:29:48 -08:00
Julian Lettner
9360f1a191 [Sanitizer] Fix sanitizer tests without reducing optimization levels
As discussed, these tests are compiled with optimization to mimic real
sanitizer usage [1].

Let's mark relevant functions with `noinline` so we can continue to
check against the stack traces in the report.

[1] https://reviews.llvm.org/D96198

This reverts commit 04af72c542.

Differential Revision: https://reviews.llvm.org/D96357
2021-02-11 15:22:20 -08:00
Valentin Clement
a48bee2294 [flang][fir][NFC] Move BoxType to TableGen type definition
This patch is a follow up of D96422 and move BoxType to TableGen.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96476
2021-02-11 18:10:22 -05:00
Peter Collingbourne
c314f5ede8 ObjectFileELF: Test whether reloc_header is non-null instead of asserting.
It is possible for the GetSectionHeaderByIndex lookup to fail because
the previous FindSectionContainingFileAddress lookup found a segment
instead of a section. This is possible if the binary does not have
a PLT (which means that lld will in some circumstances set DT_JMPREL
to 0, which is typically an address that is part of the ELF headers
and not in a section) and may also be possible if the section headers
have been stripped. To handle this possibility, replace the assert
with an if.

Differential Revision: https://reviews.llvm.org/D93438
2021-02-11 15:05:18 -08:00
Dave Lee
a5ab1dc4ad [lldb] Add step target to ThreadPlanStepInRange constructor
`QueueThreadPlanForStepInRange` accepts a `step_into_target`, but the constructor for
`ThreadPlanStepInRange` does not. Instead, a caller would optionally call
`SetStepInTarget()` in a separate statement.

This change adds `step_into_target` as a constructor argument. This simplifies
construction of `ThreadPlanSP`, by avoiding a subsequent downcast and conditional
assignment. This constructor is already used in downstream repos.

Differential Revision: https://reviews.llvm.org/D96539
2021-02-11 14:57:20 -08:00
Hongtao Yu
0eed2b1a3c Remove test code that cause MSAN failure.
Summary:
The negative test (with the feature being added disabled) caused MSAN failure and that's the added feature is supposed to fix. Therefore the negative test code is being removed.
2021-02-11 14:51:55 -08:00
Dan Gohman
f9c05fc391 [WebAssembly] Use the new crt1-command.o if present.
If crt1-command.o exists in the sysroot, the libc has new-style command
support, so use it.

Differential Revision: https://reviews.llvm.org/D89274
2021-02-11 14:44:37 -08:00
Nicolas Vasilache
5bc4f8846c s[mlir] Tighten computation of inferred SubView result type.
The AffineMap in the MemRef inferred by SubViewOp may have uncompressed symbols which result in type mismatch on otherwise unused symbols. Make the computation of the AffineMap compress those unused symbols which results in better canonical types.
Additionally, improve the error message to report which inferred type was expected.

Differential Revision: https://reviews.llvm.org/D96551
2021-02-11 22:38:16 +00:00
ShihPo Hung
9e62c9146d [RISCV] Initial support for insert/extract subvector
This patch handles cast-like insert_subvector & extract_subvector
in which case:
1. index starts from 0.
2. inserting a fixed-width vector into a scalable vector,
   or extracting a fixed-width vector from a scalable vector.

Reviewed By: craig.topper, frasercrmck

Differential Revision: https://reviews.llvm.org/D96352
2021-02-11 14:35:49 -08:00
James Y Knight
8043d5a964 NFC: update clang tests to check ordering and alignment for atomicrmw/cmpxchg.
The ability to specify alignment was recently added, and it's an
important property which we should ensure is set as expected by
Clang. (Especially before making further changes to Clang's code in
this area.) But, because it's on the end of the lines, the existing
tests all ignore it.

Therefore, update all the tests to also verify the expected alignment
for atomicrmw and cmpxchg. While I was in there, I also updated uses
of 'load atomic' and 'store atomic', and added the memory ordering,
where that was missing.
2021-02-11 17:35:09 -05:00
Jianzhou Zhao
5ebbc5802f [dfsan] Introduce memory mapping for origin tracking
Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D96545
2021-02-11 22:33:16 +00:00
Hafiz Abid Qadeer
60bed4ab57 Replace deprecated %T in 2 tests.
In D91442, @MaskRay commented about a failure. This commit does the following to
address his comments:

1. Replace %T with %t as former is deprecated.
2. Add an explicit --sysroot argument in a test.

Some tests were failing when gcc-10-riscv64-linux-gnu is installed on test machine.
This was happening because the test was checking a case when --gcc-toolchain is not
provided. But if --sysroot was also not provided then code could pick a toolchain
installed in /usr. So to make the test more robust, I have provided an explicit --sysroot
argument. Its value has been chosen to match the existing patterns.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D93023
2021-02-11 22:21:21 +00:00
Pengxuan Zheng
61cca0f2e5 [AArch64] Adding Neon Sm3 & Sm4 Intrinsics
This adds SM3 and SM4 Intrinsics support for AArch64, specifically:
        vsm3ss1q_u32
        vsm3tt1aq_u32
        vsm3tt1bq_u32
        vsm3tt2aq_u32
        vsm3tt2bq_u32
        vsm3partw1q_u32
        vsm3partw2q_u32
        vsm4eq_u32
        vsm4ekeyq_u32

Reviewed By: labrinea

Differential Revision: https://reviews.llvm.org/D95655
2021-02-11 14:20:20 -08:00
Guillaume Chatelet
74916008a8 Fix errors in distributions 2021-02-11 21:53:50 +00:00
AndreyChurbanov
838dcdb5fc [OpenMP] libomp: minor changes to improve library performance
Three minor changes in this patch:
- added UNLIKELY hint to few rarely executed branches;
- replaced couple of run time checks with debug assertions;
- moved check of presence of ittnotify tool from inside the function call.

Differential Revision: https://reviews.llvm.org/D95816
2021-02-12 00:43:13 +03:00
Hongtao Yu
0f848a24e1 Undo test changs introduced by D96193.
Summary:
The test doesn't work on Windows but there seems no good way to disable the test for Windows only so I'm undoing the test changes.
2021-02-11 13:29:41 -08:00
Douglas Yung
7b4832648a NFCI. With the move to the new pass manager by default, sanitize-coverage.c is now passing on ARM.
This change removes the XFAIL from the original test and duplicates the test into sanitize-coverage-old-pm.c
which uses the old pass manager and has the corresponding XFAIL.

This should fix the XPASS from this and similar runs:
http://lab.llvm.org:8011/#/builders/60/builds/1875
2021-02-11 13:18:18 -08:00
Jonas Devlieghere
876e7714dc [lldb] Disable x86-multithread-write.test with reproducers
This test is failing on GreenDragon. Disabling it until I have bandwidth
to investigate why the register values are different during replay.
2021-02-11 13:17:30 -08:00
Hansang Bae
ffb21e7f05 [OpenMP] Enable omp_get_num_devices() on Windows
This patch enables omp_get_num_devices() and omp_get_initial_device() on
Windows by providing an alternative to dlsym on Windows, and proposes to
add a new libomptarget entry, __tgt_get_num_devices().

Differential Revision: https://reviews.llvm.org/D96182
2021-02-11 14:53:48 -06:00
Guillaume Chatelet
8f3518e69b Fix incorrect indentation in LangRef.rst 2021-02-11 20:47:43 +00:00
Hongtao Yu
de40f6d623 [CSSPGO] Process functions in a top-down order on a dynamic call graph.
Functions are currently processed by the sample profiler loader in a top-down order defined by the static call graph. The order is being adjusted to be a top-down order based on the input context-sensitive profile. One benefit is that the processing order of caller and callee in one SCC would follow the context order in the profile to favor more inlining. Another benefit is that the processing order of caller and callee through an indirect call (which is not on the static call graph) can be honored which in turn allows for more inlining.

The profile top-down order for SCC is also extended to support non-CS profiles.

Two switches `-mllvm -use-profile-indirect-call-edges` and `-mllvm -use-profile-top-down-order` are being introduced.

Reviewed By: wmi

Differential Revision: https://reviews.llvm.org/D95988
2021-02-11 12:36:59 -08:00
Guillaume Chatelet
ca052adf07 Fix incorrect indentation in LangRef.rst 2021-02-11 20:34:19 +00:00
Guillaume Chatelet
17517f3178 Encode alignment attribute for cmpxchg
This is a follow up patch to D83136 adding the align attribute to `cmpxchg`.
See also D83465 for `atomicrmw`.

Differential Revision: https://reviews.llvm.org/D87443
2021-02-11 15:17:50 -05:00
Guillaume Chatelet
d06ab79816 Encode alignment attribute for atomicrmw
This is a follow up patch to D83136 adding the align attribute to `atomicwmw`.

Differential Revision: https://reviews.llvm.org/D83465
2021-02-11 15:17:37 -05:00
Stanislav Mekhanoshin
cb41ee92da [AMDGPU] Fix promote alloca with double use in a same insn
If we have an instruction where more than one pointer operands
are derived from the same promoted alloca, we are fixing it for
one argument and do not fix a second use considering this user
done.

Fix this by deferring processing of memory intrinsics until all
potential operands are replaced.

Fixes: SWDEV-271358

Differential Revision: https://reviews.llvm.org/D96386
2021-02-11 11:42:25 -08:00
Stanislav Mekhanoshin
8151c1b442 Move implementation of isAssumeLikeIntrinsic into IntrinsicInst
This is remove dependency on ValueTracking in the future patch.

Differential Revision: https://reviews.llvm.org/D96079
2021-02-11 11:41:34 -08:00
Eric Schweitz
f47d7c145b [flang][fir][NFC] Rename WhereOp to IfOp. 2021-02-11 11:33:37 -08:00
Haojian Wu
573348ab9b [clangd] Retire the cross-file-rename command-line flag.
This patch only focuses on the flag. Removing actual single-file mode
(and the flag in RenameOption) will come in a follow-up.

Differential Revision: https://reviews.llvm.org/D96495
2021-02-11 20:28:50 +01:00
Pavel Labath
3cad308ce5 Revert "[lldb/test] Automatically find debug servers to test"
The commit 7df4eaaa93 appears to
break the windows bot. Revert while I investigate.
2021-02-11 20:26:05 +01:00
peter klausler
8880a63a15 [flang] Don't perform macro replacement unless *.F, *.F90, &c.
Avoid spurious and confusing macro replacements from things like
-DPIC on Fortran source files whose suffixes indicate that preprocessing
is not expected.

Add gfortran-like "-cpp" and "-nocpp" flags to f18 to force predefinition
of macros independent of the source file suffix.

Differential Revision: https://reviews.llvm.org/D96464
2021-02-11 11:25:41 -08:00
Snehasish Kumar
2c7077e67d [CodeGen] Split out cold exception handling pads.
Support for splitting exception handling pads was added in D73739. This
change updates the code to split out exception handling pads if profile
information indicates that they are cold. For a given function with
multiple landind pads, if one of them is hot they are all retained as
part of the hot code section.

Differential Revision: https://reviews.llvm.org/D96372
2021-02-11 11:23:43 -08:00
Adrian Prantl
97dbab8797 llvm-dwarfdump: fix the counting when printing DW_OP_entry_value
The block size is in bytes, and not number of operands.

Differential Revision: https://reviews.llvm.org/D96472
2021-02-11 11:17:04 -08:00
Snehasish Kumar
d079dbc591 [CodeGen] Basic block sections should take precendence over splitting.
The use of basic block sections should take precedence over the machine
function splitting pass. Since they use the same underlying mechanism
they are kept exclusive. Updated the tests to check that split machine
functions is overridden by all flavours of basic block sections.

Differential Revision: https://reviews.llvm.org/D96392
2021-02-11 11:14:10 -08:00
Eric Schweitz
4dc87d1010 [flang][fir] Update the kind mapping class.
The kind mapper provides a portable mechanism to map Fortran type KIND values
independent of the front-end to their corresponding MLIR and LLVM types.

Differential Revision: https://reviews.llvm.org/D96362
2021-02-11 11:11:52 -08:00
Jianzhou Zhao
2d9c6e10e9 [dfsan] Add origin chain utils
This is a part of https://reviews.llvm.org/D95835.

The design is based on MSan origin chains.

An 4-byte origin is a hash of an origin chain. An origin chain is a
pair of a stack hash id and a hash to its previous origin chain. 0 means
no previous origin chains exist. We limit the length of a chain to be
16. With origin_history_size = 0, the limit is removed.

The change does not have any test cases yet. The following change
will be adding test cases when the APIs are used.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D96160
2021-02-11 19:10:11 +00:00
Matt Arsenault
e3c6fa3611 AMDGPU: Restrict soft clause bundling at half of the available regs
Fixes a testcase that was overcommitting large register tuples to a
bundle, which the register allocator could not possibly satisfy.  This
was producing a bundle which used nearly all of the available SGPRs
with a series of 16-dword loads (not all of which are freely available
to use).

This is a quick hack for some deeper issues with how the clause
bundler tracks register pressure.

Overall the pressure tracking used here doesn't make sense and is too
imprecise for what it needs to avoid the allocator failing. The
pressure estimate does not account for the alignment requirements of
large SGPR tuples, so this was really underestimating the pressure
impact. This also ignores the impact of the extended live range of the
use registers after the bundle is introduced. Additionally, it didn't
account for some wide tuples not being available due to reserved
registers.

This regresses a few cases. These end up introducing more
spilling. This is also a function of the global pressure being used in
the decision to bundle, not the local pressure impact of the bundle
itself.
2021-02-11 14:08:59 -05:00
peter klausler
0bfa4ac6c6 [flang] Improve "Error reading module file" error message
Instead of using a message attachment with further details,
emit the details as part of a single message.

Differential Revision: https://reviews.llvm.org/D96465
2021-02-11 11:08:12 -08:00
Sam Clegg
70f3c6e9e6 [lld][WebAssembly] Delay the merging of data section when dynamic linking
With dynamic linking we have the current limitation that there can be
only a single active data segment (since we use __memory_base as the
load address and we can't do arithmetic in constant expresions).

This change delays the merging of active segments until a little later
in the linking process which means that the grouping of data by section,
and the magic __start/__end symbols work as expected under dynamic
linking.

Differential Revision: https://reviews.llvm.org/D96453
2021-02-11 10:54:15 -08:00
Nick Desaulniers
a680bc3a31 [clang][Arm] Fix handling of -Wa,-implicit-it=
Similiar to D95872, this flag can be set for the assembler directly.
Move validation code into a reusable helper function.

Link: https://bugs.llvm.org/show_bug.cgi?id=49023
Link: https://github.com/ClangBuiltLinux/linux/issues/1270
Reported-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D96285
2021-02-11 10:51:25 -08:00
Philip Reames
81c51891ad [tests] Precommit tests for D96440 2021-02-11 10:48:07 -08:00
Sanjay Patel
6ef8473015 [InstCombine] add tests for disguised mul ops; NFC 2021-02-11 13:39:52 -05:00
Yonghong Song
74975d35b4 BPF: Add LLVMAnalysis in CMakefile LINK_COMPONENTS
buildbot reported a build error like below:
  BPFTargetMachine.cpp:(.text._ZN4llvm19TargetTransformInfo5ModelINS_10BPFTTIImplEED2Ev
    [_ZN4llvm19TargetTransformInfo5ModelINS_10BPFTTIImplEED2Ev]+0x14):
    undefined reference to `llvm::TargetTransformInfo::Concept::~Concept()'
  lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFTargetMachine.cpp.o:
    In function `llvm::TargetTransformInfo::Model<llvm::BPFTTIImpl>::~Model()':

Commit a260ae7160 ("BPF: Implement TTI.IntImmCost() properly")
added TargetTransformInfo to BPF, which requires LLVMAnalysis
dependence. In certain cmake configurations, lacking explicit
LLVMAnalysis dependency may cause compilation error.
Similar to other targets, this patch added LLVMAnalysis
in CMakefile LINK_COMPONENTS explicitly.
2021-02-11 10:24:22 -08:00
Michael Kruse
606aa622b2 Revert "[AssumptionCache] Avoid dangling llvm.assume calls in the cache"
This reverts commit b7d870eae7 and the
subsequent fix "[Polly] Fix build after AssumptionCache change (D96168)"
(commit e6810cab09).

It caused indeterminism in the output, such that e.g. the
polly-x86_64-linux buildbot failed accasionally.
2021-02-11 12:17:38 -06:00