Commit Graph

397095 Commits

Author SHA1 Message Date
Joe Loser 9807626bc7 [libc++] Include <__iterator/distance.h> instead of <iterator> in a few algorithm headers
A few headers in algorithm include `<iterator>` when
`<__iterator/distance.h>` would suffice. Change them
to just include `<__iterator.distance.h>`.

Differential Revision: https://reviews.llvm.org/D108393
2021-08-20 15:02:33 -04:00
Christian Fetzer 9116211d18 [Coverage][llvm-cov] Correctly export branch coverage in LCOV format
Commit 9f2967bcfe introduced support for
branch coverage including export to the LCOV format.

This commit corrects the LCOV field name for branches from BFH to BRH.
The mistake seems to have slipped in as typo because the correct field
name BRH is used in the comment section at the beginning of the file.

Differential Revision: https://reviews.llvm.org/D108358
2021-08-20 13:44:25 -05:00
Aditya Kumar b8e345b266 PR46874: Reset stack after visiting a node
When the stack is not reset it keeps previously visited Basic Block
which results in bugs where an instruction is hoisted to a
predecessor where the instruction was not fully anticipable.

Differential Revision: https://reviews.llvm.org/D108425
2021-08-20 11:25:05 -07:00
Aart Bik 758ccf8506 [mlir][sparse] add test for DimOp folding
Folding in the MLIR uses the order of the type directly
but folding in the underlying implementation must take
the dim ordering into account. These tests clarify that
behavior and verify it is done right.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D108474
2021-08-20 11:24:09 -07:00
Muiez Ahmed 3f05377d57 [SystemZ][z/OS] Avoid assumption for character value in futures tests
The aim of this patch is to remove the assumption that the character 'a' is always 97. In turn, this patch explicitly uses the character values to account for the EBCDIC 'a' that is not 97.

Differential Revision: https://reviews.llvm.org/D108321
2021-08-20 14:03:03 -04:00
Michael Jones 6ce6fa4ad4 [libc] make the scudo integration test run
adds a custom command for libc-scudo-integration-test that makes it run
when it is built.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D108409
2021-08-20 17:51:11 +00:00
Arthur Eubanks d7df812740 [NFC] Cleanup/remove some AttributeList setter methods 2021-08-20 10:38:35 -07:00
Arthur Eubanks 25599c3ff9 [NFC] Remove unused CallBase::addDereferenceableOrNullAttr() 2021-08-20 10:38:35 -07:00
Patrick Holland 3b3c01348b [MCA] Fixing bug that was causing LSUnit not to realize an instruction finished executing when the instruction has 0 latency.
Differential Revision: https://reviews.llvm.org/D108443
2021-08-20 10:32:37 -07:00
Ivan Zhechev 0d1a0f7e8d Make test_symbols.py compare files line-by-line
We currently feed full files to Python's unified_diff.
It's not quite what we want though -
line-by-line comparison makes more sense
(we want to be able to identify missing/unnecessary lines)
and is also easier to parse for humans.
This patch makes sure that we compare one line at a time.

This change pretties up the output formatting in the script.
Output before:

```
!DEF:/m/s/xINTENT(IN)(Implicit)ObjectEntityREAL(4)
!DEF:/m/s/yINTENT(INOUT)(Implicit)ObjectEntityREAL(4)
-!-D-E-F-:-f-o-o-b-a-r-
puresubroutines(x,y)bind(c)
!REF:/m/s/x
intent(in)::x
```
Proposed output after:

```
!DEF:/m/s/xINTENT(IN)(Implicit)ObjectEntityREAL(4)
!DEF:/m/s/yINTENT(INOUT)(Implicit)ObjectEntityREAL(4)
-!DEF:foobar
puresubroutines(x,y)bind(c)
!REF:/m/s/x
intent(in)::x
```

Reviewed By: Meinersbur, awarzynski

Differential Revision: https://reviews.llvm.org/D107954
2021-08-20 18:28:35 +01:00
Louis Dionne 3a244fcf29 [libc++] Remove more test-suite workarounds for unsupported GCC versions
Differential Revision: https://reviews.llvm.org/D108466
2021-08-20 13:26:43 -04:00
Albion Fung 4bef7a8ff1 [libc++][PowerPC] Fix a test case failure when compiled with libcxx
The test case is not ran unless libcxx is used, and a macro
may be undefined. This patch checks for the definition of the
macro before using it.

Fixes http://llvm.org/PR51430

Differential Revision: https://reviews.llvm.org/D108352
2021-08-20 13:24:13 -04:00
Jon Chesterfield b1efeface7 Revert "[openmp][nfc] Refactor GridValues"
Failed a nvptx codegen test
This reverts commit 2a47a84b40.
2021-08-20 18:17:27 +01:00
Shoaib Meenai cd1b950141 [cmake] Fix native tooling when cross-compiling on Linux
At least as of CMake 3.20.3, the CMake platform file for Linux doesn't
define the file type prefix and suffix variables, relying on them being
implicitly empty when they're unset. If we're cross-compiling targeting
Windows on a Linux machine, the values of these prefixes and suffixes
populated by the Windows platform file will still be set after including
the Linux platform file, so we'll incorrectly assume the ".exe" suffix
for the host machine. Explicitly unset the variables before including
the platform file, to prevent any previous values from leaking. Thanks
@beanz for suggesting the fix.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D108473
2021-08-20 10:05:13 -07:00
Arthur Eubanks 331cfc53fe [NFC] Simplify some CallBase attribute methods 2021-08-20 09:46:31 -07:00
Arthur Eubanks 0f45c16f2c [NFC] Remove some unused functions 2021-08-20 09:46:30 -07:00
Andrea Di Biagio 35d4292a73 [X86][SchedModels] Fix missing ReadAdvance for MULX and ADCX/ADOX (PR51494)
Before this patch, instructions MULX32rm and MULX64rm were missing a ReadAdvance
for the implicit read of register EDX/RDX.  This patch fixes the issue, and it
also introduces a new SchedWrite for the two variants of MULX. The general idea
behind this last change is to eventually decrease the number of InstRW in the
scheduling models.

This patch also adds a ReadAdvance for the implicit read of EFLAGS in ADCX/ADOX.

Differential Revision: https://reviews.llvm.org/D108372
2021-08-20 17:39:51 +01:00
Craig Topper 5cf5df8014 [X86] Add missing __inline__ to functions in amxintrin.h 2021-08-20 09:35:02 -07:00
Sanjay Patel dd19f342fa [AggressiveInstCombine] guard against applying instruction flags with constant folding
This is a minimized version of a crash reported in:
D108201
2021-08-20 12:22:18 -04:00
Thomas Lively 88962cea46 [WebAssembly] Restore builtins and intrinsics for pmin/pmax
Partially reverts 85157c0079, which had removed these builtins and intrinsics
in favor of normal codegen patterns. It turns out that it is possible for the
patterns to be split over multiple basic blocks, however, which means that DAG
ISel is not able to select them to the pmin/pmax instructions. To make sure the
SIMD intrinsics generate the correct instructions in these cases, reintroduce
the clang builtins and corresponding LLVM intrinsics, but also keep the normal
pattern matching as well.

Differential Revision: https://reviews.llvm.org/D108387
2021-08-20 09:21:31 -07:00
Aart Bik 24ea94ad0c [mlir][sparse][python] migrate more code from boilerplate into proper numpy land
The boilerplate was setting up some arrays for testing. To fully illustrate
python - MLIR potential, however, this data should also come from numpy land.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D108336
2021-08-20 09:18:17 -07:00
Louis Dionne 02d11757c1 [libc++][NFC] Fix minor errors and inconsistencies in the test suite 2021-08-20 12:14:24 -04:00
Thomas Lively 64a9957bf7 [WebAssembly] Make shift values unsigned in wasm_simd128.h
On some platforms, negative shift values mean to shift in the opposite
direction, but this is not true with WebAssembly. To avoid confusion, make the
shift values in the shift intrinsics unsigned.

Differential Revision: https://reviews.llvm.org/D108415
2021-08-20 09:10:37 -07:00
Aaron Ballman 65bcdeaa15 Replace an unnecessary null check with an assert; NFC 2021-08-20 12:04:46 -04:00
Thomas Lively 2456e11614 [WebAssembly] Add SIMD intrinsics using unsigned integers
For each SIMD intrinsic function that takes or returns a scalar signed integer
value, ensure there is a corresponding intrinsic that returns or an
unsigned value. This is a convenience for users who use -Wsign-conversion so
they don't have to insert explicit casts, especially when the intrinsic
arguments are integer literals that fit into the unsigned integer type but not
the signed type.

Differential Revision: https://reviews.llvm.org/D108412
2021-08-20 08:56:51 -07:00
Jon Chesterfield 2a47a84b40 [openmp][nfc] Refactor GridValues
Remove redundant fields and replace pointer with virtual function

Of fourteen fields, three are dead and four can be computed from the
remainder. This leaves a couple of currently dead fields in place as
they are expected to be used from the deviceRTL shortly. Two of the
fields that can be computed are only used from codegen and require a
log2() implementation so are inlined into codegen instead.

This change leaves the new methods in the same location in the struct
as the previous fields for convenience at review.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D108380
2021-08-20 16:41:26 +01:00
Corentin Jabot bdeda959ab Make wide multi-character character literals ill-formed
This implements P2362, which has not yet been approved by the
C++ committee, but because wide-multi character literals are
implementation defined, clang might not have to wait for WG21.

This change is also being applied in C mode as the behavior is
implementation-defined in C as well and there's no benefit to
having different rules between the languages.

The other part of P2362, making non-representable character
literals ill-formed, is already implemented by clang
2021-08-20 11:10:53 -04:00
Aaron Ballman c7aacce304 Use DeclContext::getNonTransparentContext(); NFC 2021-08-20 11:08:58 -04:00
Ben Shi 5b6c9a5ab0 [RISCV] Optimize add in the zba extension with SH*ADD
Optimize (add x, c) to (SH*ADD (c>>b), x) if c is not simm12
while (c>>b) is simm12 and c has b trailing zeros.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D108193
2021-08-20 22:41:49 +08:00
Louis Dionne e8118e6c8d [libc++] Fix XFAIL annotation
The triple can sometimes be arm64-apple-macos, where the previous XFAIL
annotation wouldn't match (and hence the test would fail unexpectedly).
2021-08-20 10:18:40 -04:00
Kirill Stoimenov 05a8c0b5f8 [asan] Implemented getAddressSanitizerParams used by the ASan callback optimization code.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D108397
2021-08-20 14:17:07 +00:00
Jacques Pienaar a232a48dca [mlir][ods] Skip adding TOC in doc gen when present
Enables adding a TOC in the description to be able to interleave
documentation before and after the TOC.
2021-08-20 07:01:54 -07:00
Alexander Potapenko 417a49e78e [msan] Hotfix clang/test/CodeGen/sanitize-memory-disable.c
Because KMSAN is not supported on many architectures, explicitly build
the test with -target x86_64-linux-gnu.

Fixes the 'unsupported architecture' and 'unsupported operating system'
errors reported by the clang-armv7-quick (https://lab.llvm.org/buildbot#builders/171/builds/2595)
and llvm-clang-x86_64-sie-ubuntu-fast (https://lab.llvm.org/buildbot#builders/139/builds/9079)
builders.

Differential Revision: https://reviews.llvm.org/D108465
2021-08-20 16:00:25 +02:00
Sanjay Patel 00a50f2617 [CVP] add tests for unreachable switch default; NFC
Goes with the proposal at D106056.
2021-08-20 09:55:59 -04:00
Jeremy Morse ce8254d096 [DebugInfo][InstrRef] Correctly ignore DBG_VALUE_LIST in InstrRef mode
This patch makes InstrRefBasedLDV "safe" to work with DBG_VALUE_LISTs. It
doesn't actually interpret them, but it recognises that they specify
variable locations and avoids propagating false locations, which is better
than the current state. Observe the attached tes

 * We avoid propagating DBG_VALUE_LISTs into successor blocks, as they're
   not "currently" supported,
 * We don't propagate other variable locations across DBG_VALUE_LISTs,
   because we know that the variable location is terminated by the
   DBG_VALUE_LIST.

Differential Revision: https://reviews.llvm.org/D108143
2021-08-20 14:51:02 +01:00
Aaron Ballman 48f73ee666 Fix assertion when generating diagnostic for inline namespaces
When calculating the name to display for inline namespaces, we have
custom logic to try to hide redundant inline namespaces from the
diagnostic. Calculating these redundancies requires performing a lookup
in the parent declaration context, but that lookup should not try to
look through transparent declaration contexts, like linkage
specifications. Instead, loop up the declaration context chain until we
find a non-transparent context and use that instead.

This fixes PR49954.
2021-08-20 09:50:24 -04:00
Simon Pilgrim 9efda541bf [CostModel][X86] Add costs for f32/f64 scalar and vector types.
The f16 half types are still pretty useless as we don't have it as a legal type (we treat them as i16 most of the time)
2021-08-20 14:31:12 +01:00
Simon Pilgrim c1f3bab23b MainSwitch::isValidSelectInst - don't dereference dyn_cast<> results.
We've already checked that the pointer isa<PHINode>, so we can use cast<Instruction> safely.

Fixes static analyser warning.
2021-08-20 14:31:11 +01:00
Simon Pilgrim c94f4a9c5d ClangOffloadBundler - getCompatibleOffloadTargets - Fix unknown parameter Wdocumentation warnings. NFC. 2021-08-20 14:31:11 +01:00
Jeremy Morse c76c24e40b [DebugInfo][InstrRef] Remove a faulty assertion
This patch removes an assertion, and adds a regression test showing why the
assertion is broken.

For context, LocIdx is a key/index number for machine locations, so that we
can describe locations as a single integer and ignore whether they're on
the stack, in registers or otherwise. Back when InstrRefBasedLDV was added,
I happened to bake in a "special" zero number for various reasons, which
Vedant identified as undesirable in this review comment:
https://reviews.llvm.org/D83047#inline-765495 . I subsequently removed that
special zero number, but it looks like I didn't delete this assertion at
the time, which assumes that a zero LocIdx is invalid.

The attached test shows that this assertion is reachable on valid code --
on x86 $rsp always gets the LocIdx number zero, and if you transfer a
variable value into it, InstrRefBasedLDV crashes on that assertion. The
code might be a bit wild to be storing variables to $rsp like that, however
we shouldn't crash on it.

Differential Revision: https://reviews.llvm.org/D108134
2021-08-20 14:23:32 +01:00
Alexander Potapenko 8dc7dcdca1 [msan] Add support for disable_sanitizer_instrumentation attribute
Unlike __attribute__((no_sanitize("memory"))), this one will cause MSan
to skip the entire function during instrumentation.

Depends on https://reviews.llvm.org/D108029

Differential Revision: https://reviews.llvm.org/D108199
2021-08-20 15:11:26 +02:00
Guillaume Chatelet 791d88f35f [libc] Align to 32B instead of 16B for optimized memcmp 2021-08-20 13:09:35 +00:00
Bjorn Pettersson d52f506192 [NewPM] Use parameterized syntax for a couple of more passes
A couple of passes that are parameterized in new-PM used different
pass names (in cmd line interface) while using the same pass class
name. This patch updates the PassRegistry to model pass parameters
more properly using PASS_WITH_PARAMS.

Reason for the change is to ensure that we have a 1-1 mapping
between class name and pass name (when disregarding the params).
With a 1-1 mapping it is more obvious which pass name to use in
options such as -debug-only, -print-after etc.

The opt -passes syntax is changed for the following passes:
  early-cse-memssa => early-cse<memssa>
  post-inline-ee-instrument => ee-instrument<post-inline>
  loop-extract-single => loop-extract<single>
  lower-matrix-intrinsics-minimal => lower-matrix-intrinsics<minimal>

This patch is not updating pass names in docs/Passes.rst. Not quite
sure what the status is for that document (e.g. when it comes to
listing pass paramters). It is only loop-extract-single that is
mentioned in Passes.rst today, out of the passes mentioned above.

Differential Revision: https://reviews.llvm.org/D108362
2021-08-20 14:59:21 +02:00
Louis Dionne 65d677435e [libc++] Update credits.txt per coment on D108263 2021-08-20 08:42:36 -04:00
Louis Dionne f3bc0e51ab [libc++] Bypass calling exception-throwing functions in the dylib with -fno-exceptions
basic_string and vector currently have a hard dependency on the compiled
library because they need to call __vector_base_common::__throw_xxx(),
which are externally instantiated in the compiled library. That makes
sense when exceptions are enabled (because we're trying to localize the
exception-throwing code to the compiled library), but it doesn't really
make sense when exceptions are disabled, and the __throw_xxx functions
are just calling abort() anyways.

This patch simply overrides the __throw_xxx() functions so that they
don't rely on the compiled library when exceptions are disabled.

Differential Revision: https://reviews.llvm.org/D108389
2021-08-20 08:38:58 -04:00
Alexander Potapenko b0391dfc73 [clang][Codegen] Introduce the disable_sanitizer_instrumentation attribute
The purpose of __attribute__((disable_sanitizer_instrumentation)) is to
prevent all kinds of sanitizer instrumentation applied to a certain
function, Objective-C method, or global variable.

The no_sanitize(...) attribute drops instrumentation checks, but may
still insert code preventing false positive reports. In some cases
though (e.g. when building Linux kernel with -fsanitize=kernel-memory
or -fsanitize=thread) the users may want to avoid any kind of
instrumentation.

Differential Revision: https://reviews.llvm.org/D108029
2021-08-20 14:01:06 +02:00
Simon Pilgrim b2aa470fae [clangd] detectClangPath() - remove (dead) return. NFC. 2021-08-20 12:41:38 +01:00
Simon Pilgrim 5d21ee4224 MemProfilerPass::run - remove (dead) duplicate return. NFC. 2021-08-20 12:36:28 +01:00
Simon Pilgrim 5b72fb866c [AST] getDeclLocForCommentSearch - remove dead return. NFC.
Don't use an else-block as the previous if-block always returns, and remove the (now more obvious) dead return {}.
2021-08-20 12:32:29 +01:00
Florian Mayer de916a7b12 Revert "[hwasan] do not check if freed pointer belonged to allocator."
This reverts commit 119146f8ae.
2021-08-20 12:21:00 +01:00