Commit Graph

422065 Commits

Author SHA1 Message Date
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
Matt Arsenault 7714e03175 RegAllocGreedy: Allow last chance recolor to retry overlapping tuples
Last chance recoloring didn't try recoloring a done register with the
same class since it believed there was no point. This doesn't
necessarily apply if the members in that class overlap. Allow the
recoloring to proceed if the assigned interfering physical register
overlaps with the candidate register.

This avoids an allocation failure with overlapping tuples. This
testcase could be handled better, and I don't believe should reach
last chance recoloring. The failure only manifests with the mutually
unsatisfiable register hints to overlapping tuples. The earlier
assignment decisions probably should have figured out that using these
hints was a bad idea.
2022-04-25 17:07:17 -04:00
Quinn Pham 0386213352 [clang][NFC] Inclusive language: remove use of Whitelist in clang/lib/Analysis/
[NFC] As part of using inclusive language within the llvm project, this patch
rewords a comment to replace Whitelist with Allowlist in
`RetainSummaryManager.cpp`.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D124389
2022-04-25 15:26:36 -05:00
Krzysztof Drewniak d35f7f254f [mlir] Allow data flow analysis of non-control flow branch arguments
This commit adds the visitNonControlFlowArguments method to
DataFlowAnalysis, allowing analyses to provide lattice values for the
arguments to a RegionSuccessor block that aren't directly tied to an
op's inputs. For example, integer range interface can use this method
to infer bounds for the step values in loops.

This method has a default implementation that keeps the old behavior
of assigning a pessimistic fixedpoint state to all such arguments.

Reviewed By: Mogball, rriddle

Differential Revision: https://reviews.llvm.org/D124021
2022-04-25 20:19:34 +00:00
Martin Storsjö 7164c5f051 [libunwind] [CMake] Remove leftover no-op cmake variable setting. NFC.
The setting and restoring of this variable became unused in
3ee0cec88e / D112155.

Differential Revision: https://reviews.llvm.org/D124372
2022-04-25 23:01:22 +03:00
Martin Storsjö c98d9502fc [libunwind] Fix build warnings in Unwind-EHABI.cpp. NFC.
Differential Revision: https://reviews.llvm.org/D124371
2022-04-25 23:00:52 +03:00
Peter Klausler 2c272a4e8f [flang][runtime] Fix total MAXLOC/MINLOC for non-integer data
A template argument was hard-coded as the Integer type category
rather than properly forwarding the type category of the data for
type-specific instantiations of total (no DIM=) MAXLOC and MINLOC.
This broke total MAXLOC and MINLOC reductions for real and character
data.

Differential Revision: https://reviews.llvm.org/D124303
2022-04-25 12:42:20 -07:00
Paul Robinson 5c90ecae2d [PS5] Driver test for analyzer defaults 2022-04-25 12:42:00 -07:00
Peter Klausler f65e76d16d [flang] Add semantic checks for intrinsic function REDUCE()
Support REDUCE's special semantic requirements in intrinsic
procedure semantics.

Differential Revision: https://reviews.llvm.org/D124296
2022-04-25 12:37:53 -07:00
Yuanfang Chen d3efa577f5 [lit] Keep stdout/stderr when using GoogleTest format
When a unit test crashes or timeout, print the shard's stdout and
stderr. When a unit test fails, attaches the test's output to the LIT
output to help debugging.

While at it, concatenating shard's environment variables using space
instead of newline to make the reproducer script user friendly.

Based on D123797. (Thanks to @lenary)
2022-04-25 12:26:03 -07:00
Valery N Dmitriev 88b9e46fb5 [SLP] Steer for the best chance in tryToVectorize() when rooting with binary ops.
tryToVectorize() method implements one of searching paths for vectorizable tree roots in SLP vectorizer,
specifically for binary and comparison operations. Order of making probes for various scalar pairs
was defined by its implementation: the instruction operands, then climb over one operand if
the instruction is its sole user and then perform same actions for another operand if previous
attempts failed. Problem with this approach is that among these options we can have more than a
single vectorizable tree candidate and it is not necessarily the one that encountered first.
Trying to build vectorizable tree for each possible combination for just evaluation is expensive.
But we already have lookahead heuristics mechanism which we use for finding best pick among
operands of commutative instructions. It calculates cumulative score for candidates in two
consecutive lanes. This patch introduces use of the heuristics for choosing the best pair among
several combinations. We only try one that looks as most promising for vectorization.
Additional benefit is that we reduce total number of vectorization trees built for probes
because we skip those looking non-profitable early.

Reviewed By: Alexey Bataev (ABataev), Vasileios Porpodas (vporpo)
Differential Revision: https://reviews.llvm.org/D124309
2022-04-25 12:25:33 -07:00
Sam McCall 6035649d4c [Serialization] Remove dead TYPE_FUNCTION_PROTO abbreviation. NFC
It was added in 01b2cb47 but never used.
2022-04-25 21:16:54 +02:00
Peter Klausler b8f5cf9d2c [flang] Accept "INFINITY" as real input
Both "INF" and "INFINITY" are standard.

Differential Revision: https://reviews.llvm.org/D124401
2022-04-25 12:12:10 -07:00
jfurtek c4caa90b15 [mlir][tblgen] Generate builders with inferred return types and unwrapped attributes
This diff causes mlir-tblgen to generate code for an additional builder for an
operation argument with a return type that can be inferred *AND* an attribute in
the argument list can be "unwrapped." (Previously, the unwrapped build function
was only generated for builders with explicit return types in separate or
aggregate form.) As an example, this builder might be used by code that creates
operations that implement the `SameOperandsAndResultType` interface. A test case
was created.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D124043
2022-04-25 19:00:44 +00:00
Jeremy Furtek a266a21000 [mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes
This diff allows the EnumAttr class to be used for bit enum attributes (in
addition to previously supported integer enum attributes). While integer
and bit enum attributes share many common implementation aspects, parsing
bit enum values requires a separate implementation. This is accomplished
by creating empty parser and printer strings in the EnumAttrInfo record,
and having derived classes (specific to bit and integer enums) override with
an appropriate parser/printer string.

To support existing bit enums that may use a vertical bar separator, the
parser is modified to support the | token.

Tests were added for bit enums alongside integer enums.

Future diffs for fastmath attributes in the arithmetic dialect will use these
changes.

(resubmission of earlier abaondoned diff, updated to reflect subsequent changes
in the repository)

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D123880
2022-04-25 19:00:00 +00:00
jfurtek 4e5dee2f30 [mlir][ods] Add tablegen field for concise printing of BitEnum attributes
This diff introduces a tablegen field for bit enum attributes
(`printBitEnumPrimaryGroups`) to control printing when the enum uses "group"
cases. An example would be an implementation that uses a `fastmath` enum value
as an alias for individual fastmath flags. The proposed field would allow
printing of simply `fast` for the enum value, instead of the more verbose list
that would include `fast` as well as the individual flags (e.g. `reassoc,nnan,
ninf,nsz,arcp,contract,afn,fast`).

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D123871
2022-04-25 18:48:35 +00:00
Ishaan Gandhi 87468e85fc compile commands header to source heuristic lower-cases filenames before inferring file types
This leads to ".C" files being rewritten as ".c" files and being inferred to be "c" files as opposed to "c++" files.

Fixes https://github.com/clangd/clangd/issues/1108

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D124262
2022-04-25 20:40:56 +02:00
Rahman Lavaee e59e580116 [BOLT] Refactor DataAggregator::printLBRHeatMap.
This also fixes some logs that were impacted by D123067.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D124281
2022-04-25 11:39:44 -07:00
Mingming Liu 408bb9a375 Add a regression test to guard the 0 hot-caller threshold in SamplePGO + ThinLTO. - Add a comment near where the threshold is set. 2022-04-25 18:29:56 +00:00
Peter Klausler 6bcdde2334 [flang][runtime] Fix KIND=16 real/complex component I/O
Don't treat KIND=16 as 80-bit extended floating-point any more on x86.

Differential Revision: https://reviews.llvm.org/D124400
2022-04-25 11:18:21 -07:00
Nathan Lanza 950c95cfdd [coroutines] Get an IntegerType from the value instead of defaulting to 64 bit
This AliasPtr is being created always from an Int64 even for targets
where 32 bit is the proper type. e.g. “thumbv7-none-linux-android16”.
This causes the assert in the `get` func to fail as we're getting a 32
bit from the APInt.

Fix this by simply always just getting the type from the value instead.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D123272
2022-04-25 11:10:46 -07:00
Sam McCall ef7439bdf9 [Basic] SourceManager docs: macro expansion SLocs aren't a single token. NFC
And haven't been since 2011: eeca36fe9a
2022-04-25 19:57:47 +02:00
Craig Topper 40f1af4760 [RISCV] Add isCommutable to ADD/ADDW/MUL/AND/OR/XOR/MIN/MAX/CLMUL
Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D123970
2022-04-25 10:53:41 -07:00
David Green 1159984802 [CostModel] Add fptoi_sat costmodel tests. NFC 2022-04-25 18:44:35 +01:00
Vitaly Buka bf0d613690 [libcxx] Disable long double -> int128 test with msan
On x86 long double is 80 bit with padding, which produces
uninitialized bits in the result.
This will trigger errors with -fsanitize-memory-param-retval.

Can be triggered with D123979.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D123980
2022-04-25 10:42:10 -07:00
Fangrui Song 39e23bb059 [LegacyPM] Remove HWAsanSanitizerLegacyPass
Using the legacy PM for the optimization pipeline was deprecated in 13.0.0.
Following recent changes to remove non-core features of the legacy
PM/optimization pipeline, remove AddressSanitizerLegacyPass...

...,
ModuleAddressSanitizerLegacyPass, and ASanGlobalsMetadataWrapperPass.

MemorySanitizerLegacyPass was removed in D123894.
AddressSanitizerLegacyPass was removed in D124216.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D124337
2022-04-25 10:21:26 -07:00
Louis Dionne 4051cac256 [libc++][NFC] Use brace-init instead of parens to workaround macro expansion in badly behaved systems 2022-04-25 11:17:11 -06:00
David Green 9727c77d58 [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
Arthur Eubanks 6f73bd7813 [test] Remove legacy PM pipeline test
The legacy PM for the optimization pipeline is deprecated and in the process of being cleaned up.
2022-04-25 10:02:38 -07:00
Nathan Sidwell c47bcf9af6 [demangler][NFC] OperatorInfo table unit test
Placing a run-once test inside the operator lookup function caused
problems with the thread sanitizer. See D122975.

Break out the operator table into a member variable, and move the test
to the unit test machinery.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D123390
2022-04-25 10:02:08 -07:00
Peter Klausler 72904a990c [flang] Avoid global name conflict when BIND(C,NAME=) is used
At the top level of program units in a source file, two subprograms
are allowed to have the same name if at least one of them has a
distinct interoperable binding name.  F18's symbol table requires
(most) symbols in a scope to have distinct names, though.  Solve
by using compiler-created names for the symbols of global scope
subprograms that have interoperable binding names.

Differential Revision: https://reviews.llvm.org/D124295
2022-04-25 09:25:44 -07:00
Peter Klausler 149d3e4365 [flang] Disambiguate F(X)=Y case where F is a function returning a pointer
F(X)=Y may be initially parsed as a statement function definition; an
existing pass will detect statement functions that should be rewritten
into assignment statemets with array element references as their
left-hand side variables.  However, F() may also be a reference to a
function that returns a data pointer, and f18 did not handle this
case correctly.

The right fix is to rewrite the parse tree for F(X)=Y into an assignment
to a function reference result.  The cases that are actually assignments
to array elements -- including all of the cases previously handled --
will have their left-hand sides converted to array element references
later by another existing rewriting step.

Differential Revision: https://reviews.llvm.org/D124299
2022-04-25 09:25:09 -07:00
Zakk Chen ffe03ff75c [RISCV] Fix incorrect policy implement for unmasked vslidedown and vslideup.
vslideup works by leaving elements 0<i<OFFSET undisturbed.
so it need the destination operand as input for correctness
regardless of policy. Add a operand to indicate policy.

We also add policy operand for unmaksed vslidedown to keep the interface consistent with vslideup
because vslidedown have only undisturbed at 0<i<vstart but user have no way to control of vstart.

Reviewed By: rogfer01, craig.topper

Differential Revision: https://reviews.llvm.org/D124186
2022-04-25 09:18:41 -07:00
Simon Pilgrim e8305c0b8f [X86] combineX86ShuffleChain - don't fold to truncate(concat(V1,V2)) if it was already a PACK op
Fixes #55050
2022-04-25 17:13:44 +01:00
Christudasan Devadasan 16d87efc2a [AMDGPU] Lit test pre-commit changes (NFC)
Run line change needed for an upcoming patch.
2022-04-25 21:22:33 +05:30
Christudasan Devadasan 9f631cf7c6 [AMDGPU] Regenerate lit test pattern (NFC). 2022-04-25 21:12:33 +05:30
Saleem Abdulrasool 07513605b2 CODE_OWNERS: update information for builtins
Mark myself as the code owner for the builtins library as per the
discussion at
https://discourse.llvm.org/t/code-owner-for-compiler-rt-builtins-library.

Differential Revision: https://reviews.llvm.org/D124263
Reviewed By: aaron.ballman, lattner
2022-04-25 15:36:52 +00:00
Sam McCall 1c65c734c9 Clear temporary file in test, buildbot appears to be reusing an old one.
https://lab.llvm.org/buildbot/#/builders/214/builds/903/steps/6/logs/FAIL__Clang__pch-with-module_m
2022-04-25 17:26:39 +02:00
Piotr Sobczak c6afbdb5d2 Revert "[AMDGPU] Use d16 flag for image.sample instructions"
This reverts commit d1762fc454.

Reverting D124232 as the buildbot reported some errors in sanitizers.
2022-04-25 17:18:49 +02:00
Yitzhak Mandelbaum 37b4782e3e [clang][dataflow] Fix `Environment::join`'s handling of flow-condition merging.
The current implementation mutates the environment as it performs the
join. However, that interferes with the call to the model's `merge` operation,
which can modify `MergedEnv`. Since any modifications are assumed to apply to
the post-join environment, providing the same environment for both is
incorrect. This mismatch is a particular concern for joining the flow
conditions, where modifications in the old environment may not be propagated to
the new one.

Differential Revision: https://reviews.llvm.org/D124104
2022-04-25 15:05:50 +00:00
Jeremy Morse 5db9250231 Reapply D124184, [DebugInfo][InstrRef] Add a size operand to DBG_PHI
This was applied in fda4305e53, reverted in 13815e8cbf, the problem
was that fp80 X86 registers that were spilt to the stack aren't expected by
LiveDebugValues. It pre-allocates a position number for all register sizes
that can be spilt, and 80 bits isn't exactly common.

The solution is to scan the register classes to find any unrecognised
register sizes, adn pre-allocate those position numbers, avoiding a later
assertion.
2022-04-25 15:50:15 +01:00
Joseph Huber 5ad07ac400 [Libomptarget] Use entry name for global info
Currently, globals on the device will have an infinite reference count
and an unknown name when using `LIBOMPTARGET_INFO` to print the mapping
table. We already store the name of the global in the offloading entry
so we should be able to use it, although there will be no source
location. To do this we need to create a valid `ident_t` string from a
name only.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D124381
2022-04-25 09:56:43 -04:00