Commit Graph

420526 Commits

Author SHA1 Message Date
Siu Chi Chan 0f6cbdee57
[clang-offload-bundler] fix "no output file" issue with -outputs
Fix backward compatibility issue due to D120662.

Change-Id: I7cd0f704aabbaac7dcf59fd4b73b4f0e0cdfa69f

Reviewed By: yaxunl, saiislam

Differential Revision: https://reviews.llvm.org/D123387
2022-04-08 17:11:27 +00:00
Arthur Eubanks b22ffc7b98 [CaptureTracking] Ignore ephemeral values in EarliestEscapeInfo
And thread DSE's ephemeral values to EarliestEscapeInfo.

This allows more precise analysis in DSEState::isReadClobber() via BatchAA.

Followup to D123162.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123342
2022-04-08 10:07:26 -07:00
Fangrui Song e07dfa5328 [MC][ELF] Improve st_size propagation rule
`.symver foo, foo@ver` creates the MCSymbolELF `foo@ver` whose almost all
attributes (including st_size) should inherit from `foo` (GNU as behavior).

a041ef1bd8 added st_size propagation which works
for many cases but fails for the following one:

```
.set __GLIBC_2_12_sys_errlist, _sys_errlist_internal
.type   __GLIBC_2_12_sys_errlist,@object
.size   __GLIBC_2_12_sys_errlist, 1080
.symver __GLIBC_2_12_sys_errlist, sys_errlist@GLIBC_2.12
...
_sys_errlist_internal:
.size   _sys_errlist_internal, 1072
```

`sys_errlist@GLIBC_2.12`'s st_size is 1072 (incorrect), which does not match
`__GLIBC_2_12_sys_errlist`'s st_size: 1080.

The problem is that `Base` is (the final) `_sys_errlist_internal` while we want
to respect (the intermediate) `__GLIBC_2_12_sys_errlist`'s st_size.
Fix this by following the MCSymbolRefExpr assignment chain and finding
the closest non-null `getSize()`, which covers most needs. Notably MCBinaryExpr
is not handled, but it is rare enough to matter.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D123283
2022-04-08 10:06:44 -07:00
Fangrui Song 67acc34e2a [MC][test] Improve offset.s 2022-04-08 09:58:04 -07:00
Kevin Athey b401d2a43c Add one more definition for symbols in prctl unit test.
one more follow up to: https://reviews.llvm.org/D122851

Differential Revision: https://reviews.llvm.org/D123404
2022-04-08 09:46:15 -07:00
Daniel Grumberg 80ae366592 [clang][extract-api] Emit "navigator" property of "name" in SymbolGraph
Differential Revision: https://reviews.llvm.org/D123391
2022-04-08 17:29:00 +01:00
PeixinQiao eb4d5b852e [flang] Fix semantic analysis for "forall" targeted by "label"
As Fortran 2018 3.18 states, the branch target statement can be
`forall-construct-stmt`, but cannot be `forall-stmt`. `forall-stmt` is
wrapped by `Statement` in `action-stmt` and `action-stmt` can be one
branch target statement. Fix the semantic analysis and add two
regression test cases in lowering.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D123373
2022-04-09 00:27:53 +08:00
Fraser Cormack 34e1b4774a [RISCV] Select unmasked FP setcc insts via ISel post-process
Similar to D123217 but for the floating-point patterns. No change in
generated output, while reducing the generated table size.

Reviewed By: arcbbb

Differential Revision: https://reviews.llvm.org/D123291
2022-04-08 17:13:43 +01:00
Vang Thao cd1071171c [AMDGPU] Fix inline asm causing assert during PreRARematerialize stage in scheduler pass
Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D123348
2022-04-08 09:22:32 -07:00
Snehasish Kumar 6dd6a6161f [memprof] Deduplicate and outline frame storage in the memprof profile.
The current implementation of memprof information in the indexed profile
format stores the representation of each calling context fram inline.
This patch uses an interned representation where the frame contents are
stored in a separate on-disk hash table. The table is indexed via a hash
of the contents of the frame. With this patch, the compressed size of a
large memprof profile reduces by ~22%.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D123094
2022-04-08 09:15:20 -07:00
kristina 575a1d48e7 NFC: Avoid unused variable warning in UnwindLevel1.c 2022-04-08 17:11:29 +01:00
Craig Topper 1903b99154 [RISCV] Always select (and (srl X, C), Mask) as (srli (slli X, C2), C3).
SLLI is always compressible to C.SLLI as long as the source and dest
register is the same.

ANDI and SRLI are only compressible if the register is x8-x15. By
using SLLI we have a better chance of generating shorter code.

I had to exclude one exclusion for the BEXTI case so that it's
pattern match could still fire.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D123336
2022-04-08 09:04:04 -07:00
Simon Pilgrim 57f4dcfe15 [InstCombine] Add sub(add(x,y),minmax(x,y)) -> maxmin(x,y) tests
Based on Issue #37628
2022-04-08 17:03:12 +01:00
Kevin Athey 5562d9b3c0 Add definitions for symbols in unit test for prctl.
Follow up to: https://reviews.llvm.org/D122851

Differential Revision: https://reviews.llvm.org/D123395
2022-04-08 08:56:14 -07:00
Nikita Popov 930a68765d [Loads] Check type size in bits during store to load forwarding
Rather than checking the rounded type store size, check the type
size in bits. We don't want to forward a store of i1 to a load
of i8 for example, even though they have the same type store size.
The padding bits have unspecified contents.

This is a partial fix for the issue reported at
https://reviews.llvm.org/D115924#inline-1179482,
the problem also needs to be addressed more generally in the
constant folding code.
2022-04-08 17:29:29 +02:00
Florian Hahn 29fe998eaa
[VPlan] Preserve debug location when creating branch.
Update createEmptyBasicBlock to preserve the debug location of the
previous terminator.
2022-04-08 17:22:53 +02:00
Florian Hahn 547567fe2b
[LV] Add test for missing debug info on branch in vector loop.
Adds a test case where currently no debug location is added to branches
in the vector body.
2022-04-08 17:22:53 +02:00
Zaara Syeda 07005440ae [LSR] Optimize unused IVs to final values in the exit block
Loop Strength Reduce sometimes optimizes away all uses of an induction variable
from a loop but leaves the IV increments. When the only remaining use of the IV
is the PHI in the exit block, this patch will call rewriteLoopExitValues to
replace the exit block PHI with the final value of the IV to skip the updates
in each loop iteration.

Differential Revision: https://reviews.llvm.org/D118808
2022-04-08 11:16:37 -04:00
Mark de Wever 476047bf8e [libc++] Adds back_insert_iterator::__get_container.
Adds a `__get_container` member as suggested by @Quuxplusone in D110497.

Includes  s/_LIBCPP_INLINE_VISIBILITY/_LIBCPP_HIDE_FROM_ABI/.

Reviewed By: Quuxplusone, #libc, ldionne

Differential Revision: https://reviews.llvm.org/D110573
2022-04-08 17:13:50 +02:00
Mark de Wever 7277b00a29 [NFC][libc++][format] Prepare unit tests.
Before implementing P2216's format-string adjust the unit tests.
After P2216 the format* functions require a compile-time string literal.
This changes prepares the tests.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D122534
2022-04-08 17:11:45 +02:00
Alexandre Ganea ffaf667a43 [Support][unittests] Silence warning when building with Clang 13 on
Windows.
2022-04-08 11:08:21 -04:00
Joseph Huber 2e0cb61570 [OpenMP] Fix linker error when building info tool
Summary:
The changes made in D123177 added new targets to the
`LIBOMPTARGET_TESTED_PLUGINS` variable which was linked against when
building the `llvm-omp-target-info` tool. This caused linker errors on
the export scripts. This patch removes that dependency, it still builds
and runs as expected so I will assume it's correct.
2022-04-08 10:50:31 -04:00
Nikita Popov 659871cede [ConstantFold] Add test for load of i8 from i1 (NFC)
Semantics here are a bit unclear, but the store-to-load forwarding
case at least should be a miscompile.
2022-04-08 16:32:51 +02:00
Shraiysh Vaishay fa4b1e1e95 [flang][OpenMP] Added allocate clause translation for OpenMP block constructs
This patch adds translation for allocate clause for parallel and single
constructs.

Also added tests for block constructs.

This patch also adds tests for parallel construct which were not added earlier.

Reviewed By: NimishMishra, peixin

Differential Revision: https://reviews.llvm.org/D122483

Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
2022-04-08 20:01:22 +05:30
Aaron Ballman be93716593 Clarify language option default value behavior; NFC
The LANGOPT macro allows you to specify a default value for the
langauge option. However, it's expected that these values be constant
rather than depending on other language options (because the
constructor setting the default values does not know the language mode
at the time it's being constructed).

Some of our language options were abusing this and passing in other
language mode options which were then set correctly by other parts of
frontend initialization. This removes the default values for the
language options, and then ensures they're consistently set from the
same place when setting language standard defaults.
2022-04-08 10:26:16 -04:00
Joseph Huber ae377575b2 [OpenMP] Remove help and documentation for old flag
Summary:
The `-fopenmp-target-new-runtime` flag has not been used for awhile. It
was present in a previous release so we shouldn't remove it for
backwards compatibility, but we shouldn't have documentation or a help
message for it.
2022-04-08 10:16:33 -04:00
Christudasan Devadasan 2c46d067e1 [AMDGPU][SIMachineFunctionInfo] Code cleanup (NFC). 2022-04-08 19:42:48 +05:30
Nikita Popov 3075e5d2ef [X86][FastISel] Fix with.overflow + select eflags clobber (PR54369)
Don't try to directly use the with.overflow flag result in a cmov
if we need to materialize constants between the instruction
producing the overflow flag and the cmov. The current code is
careful to check that there are no other instructions in between,
but misses the constant materialization case (which may clobber
eflags via xor or constant expression evaluation).

Fixes https://github.com/llvm/llvm-project/issues/54369.

Differential Revision: https://reviews.llvm.org/D122825
2022-04-08 16:12:28 +02:00
Carlos Alberto Enciso 10c11f5c43 [llvm-pdbutil] Move global state (Filters) inside LinePrinter class.
The changes described by:

https://reviews.llvm.org/D121801
https://reviews.llvm.org/D122226

Moved some llvm-pdbutil functionality to the debug PDB library.

This patch addresses one outstanding issue concerning the global
state (Filters) created in the PDB library.

- Move 'Filters' inside the 'LinePrinter' class.
- Omit 'Optional' and just pass 'PrintScope &HeaderScope' everywhere.

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D122887
2022-04-08 14:54:55 +01:00
Benjamin Kramer 175265ef80 Fix another g++ incompatibility. Same issue as 932f27dc1f. 2022-04-08 15:53:23 +02:00
Jean Perier 4535bb9b80 [flang] Handle dynamically optional argument in EXIT
The actual argument passed to STATUS may be a dummy OPTIONAL or a
disassociated POINTER/unallocated ALLOCATABLE.

Differential Revision: https://reviews.llvm.org/D123380
2022-04-08 15:51:44 +02:00
Nikita Popov 7d2a1b6de4 [Sanitizer] Add -no-opaque-pointers to IR test (NFC)
This test is currently looking for specific typed-pointer IR,
so explicitly disable opaque pointers.
2022-04-08 15:42:05 +02:00
Nikita Popov 3876cd10ae [Profile] Add -no-opaque-pointers to IR tests (NFC)
The output differs slightly with opaque pointers (no GEP constexpr),
add -no-opaque-pointers for now.
2022-04-08 15:42:05 +02:00
Nikita Popov 692a147bf4 [CGCall] Make findDominatingStoreToReturnValue() more robust
This was skipping specific lifetime + bitcast patterns, but with
opaque pointers the bitcast will not be present, and we did not
perform this fold.

Instead skip over lifetime.end and bitcasts generally, without
trying to correlate them.
2022-04-08 15:18:12 +02:00
Nathan James 0e0b0feff1
[clang-tidy] Make performance-inefficient-vector-operation work on members
Fixes https://llvm.org/PR50157

Adds support for when the container being read from in a range-for is a member of a struct.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D101624
2022-04-08 14:17:41 +01:00
Vivek Khandelwal b20719dc7d [mlir][Linalg] Add pooling_nchw_sum op.
This commit adds pooling_nchw_sum as a yaml op.

Reviewed By: cathyzhyi, gysit

Differential Revision: https://reviews.llvm.org/D123013
2022-04-08 17:57:47 +05:30
Jean Perier f1cfa461f2 [flang][NFC] rename isAbsent to isStaticallyAbsent in IntrinsicCall.cpp
isAbsent/isPresent helpers only give information about static presence
of intrinsic arguments. Many intrinsic arguments optionality is dynamic
(an absent dummy can legally be passed to these intrinsics). This
requires a different handling (like `handleDynamicOptional`).

Rename the helpers to avoid misleading coder/reader into thinking all
optionality cases are covered by them.

Differential Revision: https://reviews.llvm.org/D123378
2022-04-08 13:49:30 +02:00
Fraser Cormack 18106b99f0 [VP] Explicitly map from VP intrinsic to ISD opcode
This patch aims to overcome an issue in these mappings where, when an ISD
node was registered with BEGIN_REGISTER_VP_SDNODE but outwidth the scope
of a pair of BEGIN_REGISTER_VP_INTRINSIC/END_REGISTER_VP_INTRINSIC
macros, the switch cases fell apart. This in particular happened with
VP_SETCC, where we'd end up with something along the lines of:

  case Intrinsic::vp_fcmp:
    break;
  case Intrinsic::vp_icmp:
    break;
    ResOpc = ISD::VP_SETCC;
  case Intrinsic::vp_store:
    ...

To remedy this, we introduce a special-purpose mapping macro which can
map any number of VP intrinsic opcodes to an ISD opcode.

As a result, we no longer need to special-case the mapping from vp.icmp
and vp.fcmp to VP_SETCC, as the new helper macro does it for us.

Thanks to @craig.topper for noticing this and to @rogfer01 for the idea.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D123324
2022-04-08 12:30:22 +01:00
LLVM GN Syncbot c8084fd907 [gn build] Port 08920cc043 2022-04-08 11:20:14 +00:00
David Green a93607c479 [AArch64] Remove always true Perfect cost check. NFC
Perfect shuffle costs are always encoded less than 4, and shouldn't
really have a cost more than 3, so it makes no sense to check it when
generating shuffles. The perfect shuffle is likely always better than a
tbl too (although that may depend on whether it is in a loop).
2022-04-08 12:16:34 +01:00
Aaron Ballman 33ab88ef8d Fix Sphinx build 2022-04-08 07:12:08 -04:00
Sven van Haastregt 1331ad22c3 [OpenCL] Add generic addrspace guards for get_fence
Align guards of these builtins with opencl-c.h.
2022-04-08 12:08:10 +01:00
Nico Weber 26b3a1ea34 [gn build] (manually) port bf2dc4b376 2022-04-08 07:07:32 -04:00
Abinav Puthan Purayil b536f24d22 [AMDGPU] Use GCNPat in the buffer atomic pattern multiclasses 2022-04-08 16:28:11 +05:30
Benjamin Kramer 932f27dc1f Disambiguate conversion cast for GCC
GCC 9 has problems with this.

mlir/include/mlir/IR/OperationSupport.h: In member function ‘mlir::Value mlir::MutableOperandRange::operator[](unsigned int) const’:
mlir/include/mlir/IR/OperationSupport.h:912:43: error: call of overloaded ‘OperandRange(const mlir::MutableOperandRange&)’ is ambiguous
  912 |     return static_cast<OperandRange>(*this)[index];
      |
mlir/include/mlir/IR/OperationSupport.h:789:21: note: candidate: mlir::OperandRange::OperandRange(const llvm::iterator_range<llvm::detail::indexed_accessor_
range_base<mlir::OperandRange, mlir::OpOperand*, mlir::Value, mlir::Value, mlir::Value>::iterator>&)
   using RangeBaseT::RangeBaseT;
                     ^~~~~~~~~~
mlir/include/mlir/IR/OperationSupport.h:786:7: note: candidate: constexpr mlir::OperandRange::OperandRange(const mlir::OperandRange&)
 class OperandRange final : public llvm::detail::indexed_accessor_range_base<
       ^~~~~~~~~~~~
mlir/include/mlir/IR/OperationSupport.h:786:7: note: candidate: constexpr mlir::OperandRange::OperandRange(mlir::OperandRange&&)
2022-04-08 12:55:09 +02:00
Thomas Symalla 6d97ca690c [AMDGPU] Increase detection range for s_mov, v_cmpx transformation.
We found that it might be beneficial to have the SIOptimizeExecMasking
pass detect more cases where v_cmp, s_and_saveexec patterns can be
transformed to s_mov, v_cmpx patterns. Currently, the search range
for finding a fitting v_cmp instruction is 5, however, this is doubled
to 10 here.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D123367
2022-04-08 12:47:24 +02:00
Nikolas Klauser 08920cc043 [libc++] Add __is_callable type trait and begin granularizing type_traits
`__is_callable` is required to ensure that the classic algorithms are only called with functions or functors. I also begin to granularize `<type_traits>`.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D123114
2022-04-08 12:23:52 +02:00
Nikolas Klauser 628fcfd520 [libc++] Add tests for std::string default constructor and destructor
Reviewed By: ldionne, var-const, #libc, nilayvaish

Spies: nilayvaish, libcxx-commits

Differential Revision: https://reviews.llvm.org/D123129
2022-04-08 12:21:43 +02:00
Matthias Gehre 492c5c05e1 compiler-rt/lib/builtins/udivmodei5.c: Fix missing macro argument 2022-04-08 10:55:35 +01:00
Simon Pilgrim 5b45c0b677 [InstCombine] Add various other modulo-by-constant tests for Issue #22303 2022-04-08 10:37:13 +01:00