Commit Graph

422106 Commits

Author SHA1 Message Date
Erich Keane a037eace91 Fix test from 5ff992 to work with win 32 bit, fix a typo.
See the discussion on D123319.  Default calling convention on Windows32
bit is to have 'this-call' for member functions, so add a wildcard to
take care of that.

Also, one of the FileCheck 'match' flags was incorrect, so fix that too.
2022-04-26 06:37:19 -07:00
Florian Hahn c59d95f6a4
[ConstraintElimination] Check if const. is small enough before using it
Check if the value of a ConstantInt is small enough to be used for
solving before calling getSExtValue.

Fixes #55085
2022-04-26 13:56:32 +01:00
Liqiang Tao b9fc18f89a [llvm][Inline] Remove PriorityInlineOrder in SCC inliner
Since the size of most of SCC's is 1, the PriorityInlineOrder would not change the inline
order in SCC inliner.

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D123608
2022-04-26 20:20:10 +08:00
Alex Zinenko b84f95fe53 [mlir] Fix -Wunused-private-field in the Transform dialect
Classes derived from TransformState::Extension may need access to the
parent state.
2022-04-26 14:05:24 +02:00
Florian Hahn 857c612d89
[IPSCCP] Support unfeasible default dests for switch.
At the moment, unfeasible default destinations are not handled properly
in removeNonFeasibleEdges. So far, only unfeasible cases are removed,
but later code expects unreachable blocks to have no predecessors.

This is causing the crash reported in PR49573.

If the default destination is unfeasible it won't be executed. Create
a new unreachable block on demand and use that as default
destination.

Note that at the moment this only is relevant for cases where
resolvedUndefsIn marks the first case as executable. Regular switch
handling has a FIXME/TODO to support determining whether the default
case is feasible or not.

Fixes #48917.

Differential Revision: https://reviews.llvm.org/D113497
2022-04-26 12:41:41 +01:00
Nathan Sidwell 5b3ca24a35 [demangler] Simplify OutputBuffer initialization
Every non-testcase use of OutputBuffer contains code to allocate an
initial buffer (using either 128 or 1024 as initial guesses). There's
now no need to do that, given recent changes to the buffer extension
heuristics -- it allocates a 1k(ish) buffer on first need.

Just pass in a buffer (if any) to the constructor.  Thus the
OutputBuffer's ownership of the buffer starts at its own lifetime
start. We can reduce the lifetime of this object in several cases.

That new constructor takes a 'size_t *' for the size argument, as all
uses with a non-null buffer are passing through a malloc'd buffer from
their own caller in this manner.

The buffer reset member function is never used, and is deleted.

The original buffer initialization code would return a failure code if
that first malloc failed.  Existing code either ignored that, called
std::terminate with a FIXME, or returned an error code.

But that's not foolproof anyway, as a subsequent buffer extension
failure ends up calling std::terminate. I am working on addressing
that unfortunate failure mode in a manner more consistent with the C++
ABI design.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D122604
2022-04-26 04:23:12 -07:00
Alex Zinenko 2b985a7ae8 [mlir] Add a title to the Transform Dialect doc 2022-04-26 13:04:41 +02:00
Alexey Lapshin 34e2df21fd [llvm-objcopy][NFC] rename variable. 2022-04-26 12:47:23 +03:00
Martin Storsjö 2f251925db [compiler-rt] Use C_STANDARD instead of custom logic for adding -std=c11
Apply this in add_compiler_rt_runtime instead of manually adding it
to the individual projects. This applies the option on more
parts of compiler-rt than before, but should ideally not make any
difference assuming the other runtimes that lacked the option
also were C11 compatible.

Not marking this as required, to match the existing behaviour (where
`-std=c11` was added only if supported by the compiler).

This was suggested during the review of D110005.

Differential Revision: https://reviews.llvm.org/D124343
2022-04-26 12:36:20 +03:00
LLVM GN Syncbot 86312461b8 [gn build] Port 854c33946f 2022-04-26 09:06:40 +00:00
Dmitry Makogon d03d2d8aea [RS4GC] Prune inputs of BDV if they are BDV themselves
Don't check whether an input of BDV can be pruned if the input
is the BDV itself. BDV is present in the states map, so in case
the input is the BDV itself, we'd return false. So explicitly check this case.

Differential Revision: https://reviews.llvm.org/D123846
2022-04-26 16:05:00 +07:00
Alexey Lapshin 854c33946f [llvm-gsymutil][NFC] refactor AddressRange&AddresRanges structures.
llvm-gsymutil has an implementation of AddressRange and AddressRanges
classes. That implementation might be reused in other parts of llvm.
This patch moves AddressRange and AddressRanges classes into llvm/ADT.

Differential Revision: https://reviews.llvm.org/D124350
2022-04-26 12:00:43 +03:00
Haojian Wu 910fb5d7e0 [pseudo] NFC, fix some code-style naming violations. 2022-04-26 10:50:50 +02:00
Jun Zhang 218dcdad8a
[Clang] Use std::move in GlobalModuleIndex::readIndex. NFC
BitstreamCursors are heavy-weight objects that should not be passed by value.

Differential Revision: https://reviews.llvm.org/D123436
2022-04-26 16:45:01 +08:00
Xiang1 Zhang c430f0f532 [X86] Add use condition for combineSetCCMOVMSK
Reviewed by RKSimon, LuoYuanke

Differential Revision: https://reviews.llvm.org/D123652
2022-04-26 16:42:50 +08:00
Haojian Wu d6f9000eca [clang] Fix a constant evaluator crash on a NULL-type expr.
Differential Revision: https://reviews.llvm.org/D124384
2022-04-26 10:08:30 +02:00
Christudasan Devadasan 8f9dd5e608 [AMDGPU] Vector register spill test cleanup (NFC)
The vector register spills have no dependency with
SILowerSGPRSpills pass anymore. The entire handling
has been moved to PrologEpilogInserter with D55301.
2022-04-26 13:17:16 +05:30
Siva Chandra 3f5287125a [libc] Add stdio entrypoints to aarch64 fullbuild. 2022-04-26 00:25:12 -07:00
Siva Chandra e161d36cea [libc][Obvious] Add deps of fopencookie_test only if it is enabled. 2022-04-26 00:10:29 -07:00
Luo, Yuanke f3ad7ea03a [X86][AMX] Report error when shapes are not pre-defined.
Instead of report fatal error, this patch emit error message and exit
when shapes are not pre-defined. This would cause the compiling fail but
not crash.

Differential Revision: https://reviews.llvm.org/D124342
2022-04-26 14:57:25 +08:00
Nikolas Klauser a83f4b9cda [libc++] Remove <functional> includes
Reviewed By: var-const, #libc, ldionne

Spies: #libc_vendors, ldionne, libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D124123
2022-04-26 08:54:37 +02:00
Balazs Benics be744da01f [analyzer] Fix ValistChecker false-positive involving symbolic pointers
In the following example:

  int va_list_get_int(va_list *va) {
    return va_arg(*va, int); // FP
  }

The `*va` expression will be something like `Element{SymRegion{va}, 0, va_list}`.
We use `ElementRegions` for representing the result of the dereference.
In this case, the `IsSymbolic` was set to `false` in the
`getVAListAsRegion()`.

Hence, before checking if the memregion is a SymRegion, we should take
the base of that region.

Analogously to the previous example, one can craft other cases:

  struct MyVaList {
    va_list l;
  };
  int va_list_get_int(struct MyVaList va) {
    return va_arg(va.l, int); // FP
  }

But it would also work if the `va_list` would be in the base or derived
part of a class. `ObjCIvarRegions` are likely also susceptible.
I'm not explicitly demonstrating these cases.

PS: Check the `MemRegion::getBaseRegion()` definition.

Fixes #55009

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D124239
2022-04-26 08:49:05 +02:00
Serge Pavlov 170a903144 Intrinsic for checking floating point class
This change introduces a new intrinsic, `llvm.is.fpclass`, which checks
if the provided floating-point number belongs to any of the the specified
value classes. The intrinsic implements the checks made by C standard
library functions `isnan`, `isinf`, `isfinite`, `isnormal`, `issubnormal`,
`issignaling` and corresponding IEEE-754 operations.

The primary motivation for this intrinsic is the support of strict FP
mode. In this mode using compare instructions or other FP operations is
not possible, because if the value is a signaling NaN, floating-point
exception `Invalid` is raised, but the aforementioned functions must
never raise exceptions.

Currently there are two solutions for this problem, both are
implemented partially. One of them is using integer operations to
implement the check. It was implemented in https://reviews.llvm.org/D95948
for `isnan`. It solves the problem of exceptions, but offers one
solution for all targets, although some can do the check in more
efficient way.

The other, implemented in https://reviews.llvm.org/D96568, introduced a
hook 'clang::TargetCodeGenInfo::testFPKind', which injects a target
specific code into IR to implement `isnan` and some other functions. It is
convenient for targets that have dedicated instruction to determine FP data
class. However using target-specific intrinsic complicates analysis and can
prevent some optimizations.

A special intrinsic for value class checks allows representing data class
tests with enough flexibility. During IR transformations it represents the
check in target-independent way and saves it from undesired transformations.
In the instruction selector it allows efficient lowering depending on the
used target and mode.

This implementation is an extended variant of `llvm.isnan` introduced
in https://reviews.llvm.org/D104854. It is limited to minimal intrinsic
support. Target-specific treatment will be implemented in separate
patches.

Differential Revision: https://reviews.llvm.org/D112025
2022-04-26 13:09:16 +07:00
Tanya Lattner eb2c30b8b3 Provide the complete response and reporting Code of Conduct documentation. Remove the word draft from all documents, add information about the CoC committee expectations and add a place for transparency reports.
This patch provides the response and reporting guides for Code of Conduct reports. It also removes the word draft from all the documents,
adds information about the CoC committee, and a place to put transparency reports. A post will also be made on Discourse to provide more details about the history of the code of conduct, this patch, and next steps. Please see that post for full details. I will put a link below once I have it.

Reviewed By: aaron.ballman, hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D122937
2022-04-25 23:03:44 -07:00
Walter Erquinigo 35e60f5de1 [NFC][trace] simplify the instruction dumper
TraceInstructionDumper::DumpInstructions was becoming too big, so I'm
refactoring it into smaller functions. I also made some static methods proper
instance methods to simplify calls. Other minor improvements are also done.

Differential Revision: https://reviews.llvm.org/D124064
2022-04-25 20:02:48 -07:00
Lian Wang 9980148305 [RISCV][SelectionDAG] Support VP_ADD/VP_MUL/VP_SUB mask operations
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D124144
2022-04-26 02:30:22 +00:00
Walter Erquinigo 059f39d2f4 [trace][intel pt] Support events
A trace might contain events traced during the target's execution. For
example, a thread might be paused for some period of time due to context
switches or breakpoints, which actually force a context switch. Not only
that, a trace might be paused because the CPU decides to trace only a
specific part of the target, like the address filtering provided by
intel pt, which will cause pause events. Besides this case, other kinds
of events might exist.

This patch adds the method `TraceCursor::GetEvents()`` that returns the
list of events that happened right before the instruction being pointed
at by the cursor. Some refactors were done to make this change simpler.

Besides this new API, the instruction dumper now supports the -e flag
which shows pause events, like in the following example, where pauses
happened due to breakpoints.

```
thread #1: tid = 2717361
  a.out`main + 20 at main.cpp:27:20
    0: 0x00000000004023d9    leaq   -0x1200(%rbp), %rax
  [paused]
    1: 0x00000000004023e0    movq   %rax, %rdi
  [paused]
    2: 0x00000000004023e3    callq  0x403a62                  ; std::vector<int, std::allocator<int> >::vector at stl_vector.h:391:7
  a.out`std::vector<int, std::allocator<int> >::vector() at stl_vector.h:391:7
    3: 0x0000000000403a62    pushq  %rbp
    4: 0x0000000000403a63    movq   %rsp, %rbp
```

The `dump info` command has also been updated and now it shows the
number of instructions that have associated events.

Differential Revision: https://reviews.llvm.org/D123982
2022-04-25 19:01:23 -07:00
LLVM GN Syncbot b0d119b583 [gn build] Port b1fa5ac3ba 2022-04-26 01:46:12 +00:00
Mircea Trofin b1fa5ac3ba [mlgo] Factor out TensorSpec
This is a simple datatype with a few JSON utilities, and is independent
of the underlying executor. The main motivation is to allow taking a
dependency on it on the AOT side, and allow us build a correctly-sized
buffer in the cases when the requested feature isn't supported by the
model. This, in turn, allows us to grow the feature set supported by the
compiler in a backward-compatible way; and also collect traces exposing
the new features, but starting off the older model, and continue
training from those new traces.

Differential Revision: https://reviews.llvm.org/D124417
2022-04-25 18:35:46 -07:00
Jeffrey Tan 5cbf516cb7 Refactor protected virtual functions from SymbolFile into new SymbolFileCommon class.
This is a preparatory patch for https://reviews.llvm.org/D121631.
It refactors protected virtual members of SymbolFile
into a new SymbolFileCommon class per suggestion in:
https://reviews.llvm.org/D121631

This will avoid the friendship declaration in that patch.

Differential Revision: https://reviews.llvm.org/D124110
2022-04-25 18:33:47 -07:00
Chris Bieneman 3143840f21 NFC. Add missing DXILPointerTyID case
This resolves -Werror hexigon build failures.
2022-04-25 20:08:33 -05:00
YASHASVI KHATAVKAR e83543f8c2 Don't replace Undef with null value for Constants Differential Revision:https://reviews.llvm.org/D124098 2022-04-25 20:50:00 -04:00
Vladimir Vereschaka 8e4cd7295c [CMake] Update cache file for Win to ARM Linux cross toolchain builders. NFC.
Use default test configuration file for the libunwind tests.
2022-04-25 17:44:35 -07:00
Vladimir Vereschaka db92019ab9 [libunwind] Update the test configuration files to support the remote execution.
These changes allow remote execution for the libunwind library tests.

Differential Revision: https://reviews.llvm.org/D123890
2022-04-25 17:33:03 -07:00
Nico Weber 31456ff191 [gn build] Kind of port e6f44a3cd2 (DirectXTests) 2022-04-25 20:25:39 -04:00
Vitaly Buka 2d014b72cc [test][clangd] Use StringRef instead of std::string
runWithAST stores the first parameters as StringRef, so we can't
use temporarily std::string from parameter ID.
2022-04-25 16:38:18 -07:00
Will Hawkins e07c092b85
[lldb] Update online help text (consistency, typo)
Update the online help text for breakpoint set to be
consistent with respect to the spelling of Objective-C
and fix a few space-related typos.

Differential revision: https://reviews.llvm.org/D124338
2022-04-25 16:31:26 -07:00
Craig Topper 494d86d45b [RISCV] Pre-commit test for D122769. NFC 2022-04-25 16:13:57 -07:00
Zequan Wu 827ff1e576 [LLDB][NativePDB] Fix incorrect file index of inlinees introduced by f00cd23cae 2022-04-25 16:07:04 -07:00
Eric Schweitz 1f31795cb3 [NFC] Cleanup code to get back in synch for upstreaming.
Differential Revision: https://reviews.llvm.org/D124410
2022-04-25 15:57:04 -07:00
Chris Bieneman e6f44a3cd2 Add PointerType analysis for DirectX backend
As implemented this patch assumes that Typed pointer support remains in
the llvm::PointerType class, however this could be modified to use a
different subclass of llvm::Type that could be disallowed from use in
other contexts.

This does not rely on inserting typed pointers into the Module, it just
uses the llvm::PointerType class to track and unique types.

Fixes #54918

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D122268
2022-04-25 17:49:43 -05:00
Jeremy Morse 987cd7c3ed Revert "Reapply D124184, [DebugInfo][InstrRef] Add a size operand to DBG_PHI"
This reverts commit 5db9250231.

Further to the early revert, the sanitizers have found something wrong with
this.
2022-04-25 23:30:15 +01:00
Frederik Gossen 8fbf9acc8c Add missing comparison operators to SmallVector
Differential Revision: https://reviews.llvm.org/D124407
2022-04-25 18:18:14 -04:00
Vitaly Buka 0c99575df4 [libc++] Avoid lifetime UB in __thread_local_data()
Detected on many lld tests with -fsanitize-memory-use-after-dtor.
Also https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux-fast after D122869 will report a lot of them.

Threads may outlive static variables. Even if ~__thread_specific_ptr() does nothing, lifetime of members ends with ~ and accessing the value is UB https://eel.is/c++draft/basic.life#1

```
==9214==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x557e1cec4539 in __libcpp_tls_set ../include/c++/v1/__threading_support:428:12
    #1 0x557e1cec4539 in set_pointer ../include/c++/v1/thread:196:5
    #2 0x557e1cec4539 in void* std::__msan::__thread_proxy<
      std::__msan::tuple<...>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*) ../include/c++/v1/thread:285:27

  Memory was marked as uninitialized
    #0 0x557e10a0759d in __sanitizer_dtor_callback compiler-rt/lib/msan/msan_interceptors.cpp:940:5
    #1 0x557e1d8c478d in std::__msan::__thread_specific_ptr<std::__msan::__thread_struct>::~__thread_specific_ptr() libcxx/include/thread:188:1
    #2 0x557e10a07dc0 in MSanCxaAtExitWrapper(void*) compiler-rt/lib/msan/msan_interceptors.cpp:1151:3
```

The test needs D123979 or  -fsanitize-memory-param-retval enabled by default.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122864
2022-04-25 14:56:44 -07:00
Quinn Pham 09e75d3f09 [libcxx][NFC] Inclusive language: remove use of sanity check
from libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/

[NFC] As part of using inclusive language within the llvm project, this
patch rewords comments to remove sanity check.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D124391
2022-04-25 16:53:51 -05:00
Jakub Chlanda 76d1f5eaa8 [NVPTX] Support float <-> 2 x half bitcasts
Make sure NVPTX backend can handle bitcasting between `float` and `<2 x half>` types.

This was discovered through: https://github.com/intel/llvm/issues/5969
I'm not suggesting that such bitcasts make much sense, but it feels like the compiler should not hard crash on them.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D124171
2022-04-25 14:37:41 -07:00
Artem Belevich 993054c1c9 Change NVPTX/f16x2-instructions.ll to use unix EOL. NFC 2022-04-25 14:30:23 -07:00
Sanjay Patel 6c8cb219f5 [InstCombine] add tests for icmp with extended operands; NFC 2022-04-25 17:13:29 -04:00
Sanjay Patel 6631907ad2 [InstCombine] use isKnownNonNegative to reduce code duplication; NFC
We may be able to make the ValueTracking wrapper smarter
in the future (for example, analyze a simple recurrence),
so this will automatically benefit if that happens.
2022-04-25 17:13:29 -04:00
Quinn Pham b3e8e43789 [compiler-rt][NFC] Inclusive language: remove use of sanity check/test
from compiler-rt/lib/tsan

[NFC] As part of using inclusive language within the llvm project, this
patch rewords comments to remove sanity check and sanity test.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D124390
2022-04-25 16:13:11 -05:00