Commit Graph

418544 Commits

Author SHA1 Message Date
Stanislav Mekhanoshin 43c4d915a3 [AMDGPU] Added gfx940 mfma dst constraint test. NFC. 2022-03-18 13:34:35 -07:00
Stanislav Mekhanoshin e9a49c6483 [AMDGPU] gfx940 basic speed model
This is incomplete and will handle more instructions as they are added.

Differential Revision: https://reviews.llvm.org/D121966
2022-03-18 13:19:47 -07:00
Stanislav Mekhanoshin 4570527e72 [AMDGPU] Disable some MFMA instructions on gfx940
Differential Revision: https://reviews.llvm.org/D121956
2022-03-18 13:19:12 -07:00
Sterling Augustine 61d5d12ca9 Update llvm-config.h.cmake for 7b983917d4 2022-03-18 12:59:15 -07:00
Stanislav Mekhanoshin 0a79e1f30a [AMDGPU] reuse blgp as neg in 2 mfma operations on gfx940
GFX940 repurposes BLGP as NEG only in DGEMM MFMA.

Differential Revision: https://reviews.llvm.org/D121745
2022-03-18 12:56:51 -07:00
Dominic Chen 58a583c229 [scudo] Fix static and unused function type annotations
Differential Revision: https://reviews.llvm.org/D121855
2022-03-18 12:52:29 -07:00
Dominic Chen 26a5f9bd03 [scudo] Don't assume preprocessor macro is defined
Differential Revision: https://reviews.llvm.org/D121857
2022-03-18 12:52:18 -07:00
Eli Friedman 2f497ec3a0 [ARM] Fix ARM backend to correctly use atomic expansion routines.
Without this patch, clang would generate calls to __sync_* routines on
targets where it does not make sense; we can't assume the routines exist
on unknown targets. Linux has special implementations of the routines
that work on old ARM targets; other targets have no such routines. In
general, atomics operations which aren't natively supported should go
through libatomic (__atomic_*) APIs, which can support arbitrary atomics
through locks.

ARM targets older than v6, where this patch makes a difference, are rare
in practice, but not completely extinct. See, for example, discussion on
D116088.

This also affects Cortex-M0, but I don't think __sync_* routines
actually exist in any Cortex-M0 libraries. So in practice this just
leads to a slightly different linker error for those cases, I think.

Mechanically, this patch does the following:

- Ensures we run atomic expansion unconditionally; it never makes sense to
completely skip it.
- Fixes getMaxAtomicSizeInBitsSupported() so it returns an appropriate
number on all ARM subtargets.
- Fixes shouldExpandAtomicRMWInIR() and shouldExpandAtomicCmpXchgInIR() to
correctly handle subtargets that don't have atomic instructions.

Differential Revision: https://reviews.llvm.org/D120026
2022-03-18 12:43:57 -07:00
Nico Weber 3ac84c430b Reland "[gn build] (manually) port 6316129e066e"
This reverts commit 21b97df74c.
6316129e06 relanded in 7b983917d4.
2022-03-18 15:43:02 -04:00
Nikolas Klauser 01df675191 [libc++] Enable modernize-loop-convert
Reviewed By: ldionne, Mordante, #libc

Spies: var-const, aheejin, libcxx-commits

Differential Revision: https://reviews.llvm.org/D121216
2022-03-18 20:34:19 +01:00
Michael Kruse 12ac339e9e [polly] Fix NPM unittests after D121566. 2022-03-18 14:25:44 -05:00
Mehdi Amini 7b983917d4 Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled
This re-lands 6316129e06 after fixing the condition logic.

The new flag seems to not be working yet on Windows, where the builtin
trap isn't "no return".

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D121750
2022-03-18 19:24:14 +00:00
Benjamin Kramer 89d8035e36 Use llvm::append_range where applicable
It knows the size, so no need to call reserve beforehand. NFCI.
2022-03-18 20:05:48 +01:00
Simon Pilgrim 5dde9c1286 [CostModel][X86] Reduce cost of extracting bool vector elements
For constant indices, these are now just a MOVMSK+TEST/BT
2022-03-18 19:02:47 +00:00
Philip Reames 1093949cff [SLP] Add comment clarifying assumption that tripped me up [NFC]
I keep thinking this assumption is probably exploitable for a bug in the existing implementation, but all of my attempts at writing a test case have failed.  So for the moment, just document this very subtle assumption.
2022-03-18 11:40:19 -07:00
Kazu Hirata 3e0f7c7881 [Vectorize] Fix an 'unused function' warning
This patch fixes:

  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3917:13: error:
  unused function 'needToScheduleSingleInstruction'
  [-Werror,-Wunused-function]
2022-03-18 11:24:57 -07:00
Kazu Hirata 6cf1bd3ad3 [VE] Fix an 'unused variable' warning
This patch fixes:

  llvm/lib/Target/VE/VVPISelLowering.cpp:186:11: error: unused
  variable 'PassThru' [-Werror,-Wunused-variable]
2022-03-18 11:24:56 -07:00
Kazu Hirata b3d8c0d069 [Vectorize] Fix an 'unused variable' warning
This patch fixes:

  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8148:18: error:
  unused variable 'SDTE' [-Werror,-Wunused-variable]
2022-03-18 11:24:54 -07:00
Nick Desaulniers e1bae23f6f [SCCP] do not clean up dead blocks that have their address taken
[SCCP] do not clean up dead blocks that have their address taken

Fixes a crash observed in IPSCCP.

Because the SCCPSolver has already internalized BlockAddresses as
Constants or ConstantExprs, we don't want to try to update their Values
in the ValueLatticeElement. Instead, continue to propagate these
BlockAddress Constants, continue converting BasicBlocks to unreachable,
but don't delete the "dead" BasicBlocks which happen to have their
address taken.  Leave replacing the BlockAddresses to another pass.

Fixes: https://github.com/llvm/llvm-project/issues/54238
Fixes: https://github.com/llvm/llvm-project/issues/54251

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D121744
2022-03-18 11:02:15 -07:00
Asher Mancinelli 34538dba9b [libc++] Make shared_ptr move unique_ptr's deleter
Addresses LWG 3548 which mandates that when shared_ptr is being constructed from a unique_ptr, the unique_ptr's deleter should be moved and not copied.

Reviewed By: #libc, philnik, EricWF

Differential Revision: https://reviews.llvm.org/D119159
2022-03-18 11:50:31 -06:00
Philip Reames 8f108c32bc Revert "[SLP] Optionally preserve MemorySSA"
This reverts commit 1cfa986d68.  See https://github.com/llvm/llvm-project/issues/54256 for why I'm discontinuing the project.

Seperately, it turns out that while this patch does correctly preserve MSSA, it's correct only at the end of the pass; not between vectorization attempts.  Even if we decide to resurrect this, we'll need to fix that before reapplying.
2022-03-18 10:45:59 -07:00
Florian Mayer 078b546555 [HWASan] do not replace lifetime intrinsics with tagged address.
Quote from the LLVM Language Reference
  If ptr is a stack-allocated object and it points to the first byte of the
  object, the object is initially marked as dead. ptr is conservatively
  considered as a non-stack-allocated object if the stack coloring algorithm
  that is used in the optimization pipeline cannot conclude that ptr is a
  stack-allocated object.

By replacing the alloca pointer with the tagged address before this change,
we confused the stack coloring algorithm.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D121835
2022-03-18 10:39:51 -07:00
Walter Erquinigo b7d525ad38 [trace][intelpt] fix some test failures
Minor fixes needed and now `./bin/lldb-dotest -p TestTrace` passes
correctly.

- There was an incorrect iteration.
- Some error messages changed.
- The way repeat commands are handled changed a bit, so I had to create
a new --continue arg in "thread trace dump instructions" to handle this
correctly.

Differential Revision: https://reviews.llvm.org/D122023
2022-03-18 10:35:34 -07:00
Zequan Wu 217f267efe Revert "[pseudo] Split greatergreater token."
This reverts commit f66d3758bd.

It breaks windows bot.
2022-03-18 10:15:48 -07:00
Alan Zhao 8cd8bd4a5c Implement __cpuid and __cpuidex as Clang builtins
https://reviews.llvm.org/D23944 implemented the #pragma intrinsic from
MSVC. This causes the statement #pragma intrinsic(cpuid) to fail [0]
on Clang because cpuid is currently implemented in intrin.h instead
of a Clang builtin. Reimplementing cpuid (as well as it's releated
function, cpuidex) should resolve this.

[0]: https://crbug.com/1279344

Differential revision: https://reviews.llvm.org/D121653
2022-03-18 18:13:52 +01:00
Petr Hosek a014cb8650 [CMake][Fuchsia] Drop Darwin architectures
We want to build all available ones.

Differential Revision: https://reviews.llvm.org/D122022
2022-03-18 10:09:57 -07:00
Petr Hosek 0f9a855e7c [CMake][Fuchsia] Include llvm-undname
This is useful when developing on Windows.

Differential Revision: https://reviews.llvm.org/D122021
2022-03-18 10:09:13 -07:00
Florian Mayer dbc918b649 Revert "[HWASan] do not replace lifetime intrinsics with tagged address."
Failed on buildbot:

/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llc: error: : error: unable to get target for 'aarch64-unknown-linux-android29', see --version and --triple.
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-project/llvm/test/Instrumentation/HWAddressSanitizer/stack-coloring.ll --check-prefix=COLOR

This reverts commit 208b923e74.
2022-03-18 10:04:48 -07:00
William S. Moses d144cf5a98 [MLIR][MemRef] Nested allocation scope inlining
If a stack allocation is within a nested allocation scope
don't count that as an allocation of the outer allocation scope
that would prevent inlining.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D121981
2022-03-18 13:04:13 -04:00
Petr Hosek ec10ac750a [runtimes] Detect changes to Tests.cmake
This ensures that Tests.cmake is tracked by Ninja and any changes to
this file from the subbuilds are correctly detected.

Differential Revision: https://reviews.llvm.org/D121647
2022-03-18 10:01:52 -07:00
William S. Moses dbe96c8da0 [MLIR][SCF] Combine nested ifs with yields
This patch extends the existing combine nested if
combination canonicalization to also handle ifs which
yield values

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D121923
2022-03-18 13:00:28 -04:00
Florian Hahn 5ab421fb4e
[LICM] Add allowspeculation pass options.
This adds a new option to control AllowSpeculation added in D119965 when
using `-passes=...`.

This allows reproducing #54023 using opt.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D121944
2022-03-18 16:51:57 +00:00
Florian Mayer 208b923e74 [HWASan] do not replace lifetime intrinsics with tagged address.
Quote from the LLVM Language Reference
  If ptr is a stack-allocated object and it points to the first byte of the
  object, the object is initially marked as dead. ptr is conservatively
  considered as a non-stack-allocated object if the stack coloring algorithm
  that is used in the optimization pipeline cannot conclude that ptr is a
  stack-allocated object.

By replacing the alloca pointer with the tagged address before this change,
we confused the stack coloring algorithm.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D121835
2022-03-18 09:45:05 -07:00
Zakk Chen f5fea45d09 [RISCV][NFC] Add tests to address invalid arch dependencies.
Improve test converage.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D121578
2022-03-18 09:41:04 -07:00
Shraiysh Vaishay ae1623b306 [flang][Parser] Add a node for individual sections in sections construct
This patch adds parser nodes for each indivudual section in sections
construct. This should help with the translation to FIR. `!$omp section`
was not recognized as a construct and hence needed special handling.

`OpenMPSectionsConstruct` contains a list of `OpenMPConstruct`. Each
such `OpenMPConstruct` wraps an `OpenMPSectionConstruct`
(section, not sections). An `OpenMPSectionConstruct` is a wrapper around
a `Block`.

Reviewed By: kiranchandramohan, peixin

Differential Revision: https://reviews.llvm.org/D121680
2022-03-18 21:55:35 +05:30
Tomas Matheson 831ab35b2f [ARM][AArch64] generate subtarget feature flags
Reland of D120906 after sanitizer failures.

This patch aims to reduce a lot of the boilerplate around adding new subtarget
features. From the SubtargetFeatures tablegen definitions, a series of calls to
the macro GET_SUBTARGETINFO_MACRO are generated in
ARM/AArch64GenSubtargetInfo.inc.  ARMSubtarget/AArch64Subtarget can then use
this macro to define bool members and the corresponding getter methods.

Some naming inconsistencies have been fixed to allow this, and one unused
member removed.

This implementation only applies to boolean members; in future both BitVector
and enum members could also be generated.

Differential Revision: https://reviews.llvm.org/D120906
2022-03-18 16:07:00 +00:00
Jonas Devlieghere 453f8c87ff
[lldb] Remove lldb/lldb subdir created by wrong patch level
Bad application of patch -p<level>.
2022-03-18 09:06:15 -07:00
Johannes Doerfert 1df3a913ef [OpenMP][FIX] Make test check lines less strict
The ppc64be bot emits the dtor metadata first for some reason. We should
investigate this or make the _cc_ update script able to use variables
instead of fixed numbers (e.g., !1). The IR update script does that
already.
2022-03-18 10:53:32 -05:00
William S. Moses 5a31403b51 [MLIR][SCF] Create selects from if yield results which are not defined in the body
Previously, the canonicalizer to create ifs from selects would only work
if the if did not have a body other than yielding. This patch upgrade the functionality
to be able to create selects from any if result whose operands are not defined
within the body.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D121943
2022-03-18 11:38:29 -04:00
Sanjay Patel 1f001b25f1 [InstCombine] add tests for bswap with shifted operand; NFC 2022-03-18 11:22:15 -04:00
Eric Schweitz d50298dded [NFC][mlir] Run clang-format on file. 2022-03-18 08:19:37 -07:00
Eric Schweitz 1c083e6985 [mlir] Add support for the nest attribute to the LLVM-IR dialect conversion.
Differential Revision: https://reviews.llvm.org/D121948
2022-03-18 08:15:03 -07:00
Dmitry Vyukov 9e66e5872c tsan: print signal num in errno spoiling reports
For errno spoiling reports we only print the stack
where the signal handler is invoked. And the top
frame is the signal handler function, which is supposed
to give the info for debugging.
But in same cases the top frame can be some common thunk,
which does not give much info. E.g. for Go/cgo it's always
runtime.cgoSigtramp.

Print the signal number.
This is what we can easily gather and it may give at least
some hints regarding the issue.

Reviewed By: melver, vitalybuka

Differential Revision: https://reviews.llvm.org/D121979
2022-03-18 16:12:11 +01:00
LLVM GN Syncbot 00145bcb4c [gn build] Port a36c2dd6d5 2022-03-18 14:44:37 +00:00
Valentin Clement 308fc3f277
[flang] Lower select case statement
This patch adds lowering for the `select case`
statement.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-18 15:41:29 +01:00
Florian Hahn 1b7ef6aac8
[BasicAA] Account for wrapping when using abs(VarIndex) >= abs(Scale).
The patch adds an extra check to only set MinAbsVarIndex if
abs(V * Scale) won't wrap. In the absence of IsNSW, try to use the
bitwidths of the original V and Scale to rule out wrapping.

Attempt to model https://alive2.llvm.org/ce/z/HE8ZKj

The code in the else if below probably needs the same treatment, but I
need to come up with a test first.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D121695
2022-03-18 14:41:15 +00:00
Yitzhak Mandelbaum a36c2dd6d5 [clang][dataflow] Add modeling of Chromium's CHECK functionality
Chromium's implementation of assertions (`CHECK`, `DCHECK`, etc.) are not
annotated with "noreturn", by default. This patch adds a model of the logical
implications of successfully executing one of these assertions.

Differential Revision: https://reviews.llvm.org/D121797
2022-03-18 14:39:23 +00:00
Simon Pilgrim b58413da9b [SLP][X86] Add baseline SSE2 test run to lookahead.ll 2022-03-18 14:27:04 +00:00
Kevin P. Neal bd050a34fe [FPEnv][InstSimplify] Teach CannotBeNegativeZero() about constrained intrinsics.
Currently some optimizations are disabled because llvm::CannotBeNegativeZero()
does not know how to deal with the constrained intrinsics. This patch fixes
that by extending the existing implementation.

Differential Revision: https://reviews.llvm.org/D121483
2022-03-18 10:24:48 -04:00
Marek Kurdej c59c2b6bd1 [clang-format] Refactor ShouldBreakBeforeBrace to use switch. NFC. 2022-03-18 15:16:01 +01:00