Commit graph

414825 commits

Author SHA1 Message Date
Florian Hahn 66400fc2dd
[ConstraintElimination] Support add with precondition.
If we can prove that an addition without wrap flags won't wrap, decompse
the operation.

Issue #48253
2022-02-11 20:26:25 +00:00
YASHASVI KHATAVKAR f9f78a2c40 Fix build broken by missing empty line in SourceLevelDebugging.rst 2022-02-11 15:19:07 -05:00
Martin Storsjö 8a0a706f09 [libcxx] Wrap [[no_unique_address]] in a macro, for clang-cl
This should silence all remaining clang-cl build warnings.

Differential Revision: https://reviews.llvm.org/D119430
2022-02-11 22:02:32 +02:00
Sanjay Patel 99ed84242f [x86] add test for load ordering; NFC
This is reduced from a test that failed with D118376.
The C source is posted in issue #53695
2022-02-11 15:00:10 -05:00
Sanjay Patel bce7f942bc [x86] scrub less memory ops in test; NFC
The addresses matter - we want to verify the splitting
and order of the memops.
2022-02-11 15:00:09 -05:00
Konstantin Varlamov 10953974ed [libc++][NFC] Work around false positive ODR violations from ASan.
This works around a known issue in ASan. ASan doesn't instrument weak
symbols. Because instrumentation increases object size, the binary can
end up with two versions of the same object, one instrumented and one
not instrumented, with different sizes, which ASan will report as an ODR
violation. In libc++, this affects typeinfo for `std::bad_function_call`
which is emitted as a weak symbol in the test executable and as a strong
symbol in the shared library.

The main open issue for ASan appears to be
https://github.com/google/sanitizers/issues/1017.

Differential Revision: https://reviews.llvm.org/D119410
2022-02-11 11:56:51 -08:00
Arthur Eubanks b59a402237 [MSan][OpaquePtr] Use inline asm elementtype instead of getPointerElementType() 2022-02-11 11:50:35 -08:00
Florian Mayer 11b0506c08 [Sanitizers] Fix build broken by missing import. 2022-02-11 11:43:00 -08:00
Dmitry Vyukov 54e96ac835 hwasan: fix up includes
Fix up includes after 595d340dce
("sanitizer_common: make internal/external headers compatible").

Differential Revision: https://reviews.llvm.org/D119570
2022-02-11 20:41:37 +01:00
YASHASVI KHATAVKAR 70fdbf35de Adding DiBuilder interface for assumed length strings 2022-02-11 14:40:02 -05:00
Philip Reames c02deae18c [SCEVPredicate] Remove getExpr mechanism [NFC]
This mechanism was used for a couple of purposes, but the primary one was keeping track of which predicates in a union might apply to an expression.  As these sets are small and agressively deduped, this has little value.
2022-02-11 11:35:58 -08:00
Arthur Eubanks c0281c7607 [OpaquePtr][SPARC] Remove getPointerElementType() call in SparcISelLowering
Requires keeping better track of sret types.
2022-02-11 11:31:19 -08:00
Eric Schweitz c45bd4b9e5 [flang] Upstream fix to allocmem codegen to deal with missing dimensions
for sequence of character types.

Upstream type test. Upstream test. Fix tests.

Do not run on windows, as that is not an implemented target.

Differential Revision: https://reviews.llvm.org/D119551
2022-02-11 11:12:49 -08:00
Florian Mayer 8f0e5b4e26 [NFC] [MTE] Use helpers for stack tagging.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119503
2022-02-11 10:59:09 -08:00
Roman Lebedev 97484f46eb
[NFCI][SCEV] SCEVTraversal: if search terminated, don't push further ops of nary
Even if the search is marked as terminated after only looking at
the first operand, we'd still look at the remaining operands
before actually ending the search.

This seems pointless and wasteful, let's not do that.
2022-02-11 21:58:19 +03:00
Roman Lebedev 65715ac72a
[SCEV] Generalize umin_seq matching
Since we don't greedily flatten `umin_seq(a, umin(b, c))` into `umin_seq(a, b, c)`,
just looking at the operands of the outer-level `umin` is not sufficient,
and we need to recurse into all same-typed `umin`'s.
2022-02-11 21:58:19 +03:00
Roman Lebedev c234809ff8
[SCEV] Recognize x == 0 ? 0 : umin_seq(..., x, ...) -> umin_seq(x, umin_seq(...)) 2022-02-11 21:58:19 +03:00
Roman Lebedev 281421693b
[SCEV] Recognize x == 0 ? 0 : umin(..., x, ...) -> umin_seq(x, umin(...))
That is the canonical expansion for umin_seq,
so we really should roundtrip it.
2022-02-11 21:58:19 +03:00
Roman Lebedev 4d0c0e6cc2
[SCEV] createNodeForSelectOrPHIInstWithICmpInstCond(): generalize eq handling
The current logic was: https://alive2.llvm.org/ce/z/j8muXk
but in reality the offset to the Y in the 'true' hand
does not need to exist: https://alive2.llvm.org/ce/z/MNQ7DZ
https://alive2.llvm.org/ce/z/S2pMQD

To catch that, instead of computing the Y's in both
hands and checking their equality, compute Y and C,
and check that C is 0 or 1.
2022-02-11 21:58:19 +03:00
Roman Lebedev a473c457f6
[NFC][SCEV] createNodeForSelectOrPHIInstWithICmpInstCond(): dedup eq/ne pred handling 2022-02-11 21:58:19 +03:00
Roman Lebedev bfce0ca203
[NFC][SCEV] Add test more tests for umin_seq recognition 2022-02-11 21:58:18 +03:00
Roman Lebedev 93c93fd08f
[NFC][SCEV] Add some tests for select->umax recognition
Apparently we didn't have any tests for that codepath?
2022-02-11 21:58:18 +03:00
David Green f810b40c3b [X86] Replace X86ISD::AVG with generic ISD::AVGCEILU
Pulled out of D106237, this replaces the X86ISD::AVG DAG node with the
generic ISD::AVGCEILU. It doesn't remove the detectAVGPattern method,
but the extra generic ISel matching does alter the existing test.

Differential Revision: https://reviews.llvm.org/D119073
2022-02-11 18:57:18 +00:00
Florian Mayer 19fdf85f58 [hwasan] keep debug intrinsicts in AllocaInfo.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119498
2022-02-11 10:56:53 -08:00
Peter Steinfeld 1341b5a0f5 [flang] Allow mixed association of procedure pointers and targets
Section 10.2.2.4, paragraph 3 states that a procedure pointer with an explicit
interface must have the same characteristics as its target.  Previously, we
interpreted this as disallowing such pointers to point to procedures with
implicit interfaces.  But several other compilers allow this.

We make an exception for the case where the explicit interface cannot be
called via an implicit interface.

This change makes us allow this, also

Differential Revision: https://reviews.llvm.org/D119404
2022-02-11 10:55:45 -08:00
Peter Kasting b3b2538df1 [lld/coff] Make lld-link work in a non-MSVC shell, add /winsysroot:
Makes lld-link work in a non-MSVC shell by autodetecting MSVC toolchain. Also
adds support for /winsysroot and a few other switches.

All this is done by refactoring to share code with clang-cl's existing support
for the same.

Differential Revision: https://reviews.llvm.org/D118070
2022-02-11 13:55:18 -05:00
Arthur Eubanks d408abf403 [gn build] Manually port c7eb846345
Since the bot is broken due to hwasan issues, it's not auto updating the file lists.
2022-02-11 10:54:43 -08:00
Florian Mayer e7356fb3e2 [nfc] [hwasan] factor out logic to collect info about stack
this is the first step in unifying some of the logic between hwasan and
mte stack tagging. this only moves around code, changes to converge
different implementations of the same logic follow later.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D118947
2022-02-11 10:54:12 -08:00
Paul Robinson ce5588fdf4 [RGT] Refactor environment-specific checks to use GTEST_SKIP()
This allows using GTEST_SKIP() to identify un-executed tests.

Found by the Rotten Green Tests project.
2022-02-11 10:47:07 -08:00
Paul Robinson a0ac6a9212 [RGT] Refactor Windows-specific checks into their own test
This allows using GTEST_SKIP() to identify un-executed tests.

Found by the Rotten Green Tests project.
2022-02-11 10:47:04 -08:00
Paul Robinson d2495b69f2 [RGT] Exercise both paths through a test
BitcastToGEP had an opaque/typed pointer decision point, make sure it
exercises both sides.

Found by the Rotten Green Tests project.
2022-02-11 10:47:00 -08:00
Johannes Doerfert ede248e614 [OpenMP][FIX] The llvm.amdgcn.s.barrier is actually not aligned
If we assume `llvm.amdgcn.s.barrier` is aligned we may remove it and
cause OpenMP GPU applications on the AMD GPU to be stuck or wrongly
synchronized.

Reported by Carlo Bertolli.
2022-02-11 12:42:50 -06:00
Arthur Eubanks 87dd3d350c [clang][OpaquePtr] Remove call to getPointerElementType() in CodeGenModule::GetAddrOfGlobalTemporary() 2022-02-11 10:39:49 -08:00
Dmitry Vyukov 595d340dce sanitizer_common: make internal/external headers compatible
This is a follow up to 4f3f4d6722
("sanitizer_common: fix __sanitizer_get_module_and_offset_for_pc signature mismatch")
which fixes a similar problem for msan build.

I am getting the following error compiling a unit test for code that
uses sanitizer_common headers and googletest transitively includes
sanitizer interface headers:

In file included from third_party/gwp_sanitizers/singlestep_test.cpp:3:
In file included from sanitizer_common/sanitizer_common.h:19:
sanitizer_interface_internal.h:41:5: error: typedef redefinition with different types
('struct __sanitizer_sandbox_arguments' vs 'struct __sanitizer_sandbox_arguments')
  } __sanitizer_sandbox_arguments;
common_interface_defs.h:39:3: note: previous definition is here
} __sanitizer_sandbox_arguments;

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D119546
2022-02-11 19:39:44 +01:00
Philip Reames 3e27fb8590 [PSE] Allow duplicate predicates in debug output
This lets us avoid redundant implication work in the constructor of SCEVUnionPredicate which simplifies an upcoming change.  If we're actually building a predicate via PSE, that goes through addPredicate which does include the implication check.
2022-02-11 10:39:01 -08:00
Simon Pilgrim 20af71f8ec [X86] combineVSelectToBLENDV - handle vselect(vXi1,A,B) -> blendv(sext(vXi1),A,B)
For pre-AVX512 targets, attempt to sign-extend a vXi1 condition mask to pass to a X86ISD::BLENDV node

Fixes Issue #53760
2022-02-11 18:38:17 +00:00
Stanislav Mekhanoshin c7eb846345 [AMDGPU] Merge AMDGPULDSUtils into AMDGPUMemoryUtils
Differential Revision: https://reviews.llvm.org/D119502
2022-02-11 10:32:24 -08:00
David Green 4072e362c0 [ISel] Port AArch64 HADD and RHADD to ISel
This ports the aarch64 combines for HADD and RHADD over to DAG combine,
so that they can be used in more architectures (notably MVE in a
followup patch). They are renamed to AVGFLOOR and AVGCEIL in the
process, to avoid confusion with instructions such as X86 hadd. The code
was also rewritten slightly to remove the AArch64 idiosyncrasies.

The general pattern for a AVGFLOORS is
  %xe = sext i8 %x to i32
  %ye = sext i8 %y to i32
  %a = add i32 %xe, %ye
  %r = lshr i32 %a, 1
  %t = trunc i32 %r to i8

An AVGFLOORU is equivalent with zext. Because of the truncate
lshr==ashr, as the top bits are not demanded. An AVGCEIL also includes
an extra rounding, so includes an extra add of 1.

Differential Revision: https://reviews.llvm.org/D106237
2022-02-11 18:28:56 +00:00
Dávid Bolvanský d828281e78 [AlwaysInliner] Respect noinline call site attribute
```
always_inline foo() { }

bar () {

noinline foo();
}
```

We should prefer call site attribute over attribute on decl. This is fix for AlwaysInliner, similar fix is needed for normal Inliner (follow up).

Related to https://reviews.llvm.org/D119061

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D119553
2022-02-11 19:23:11 +01:00
Reid Kleckner 8224114891 [CodeView] Match any backend version in the new test
This makes the test pass for any LLVM_VERSION_MAJOR/MINOR value. Vendors
override these, and they change every six months.
2022-02-11 10:20:10 -08:00
Nikolas Klauser 169a66eac8 [libc++] Remove __functional_base
Reviewed By: ldionne, Quuxplusone, #libc

Spies: Mordante, mgorny, libcxx-commits, arichardson, llvm-commits, arphaman

Differential Revision: https://reviews.llvm.org/D119439
2022-02-11 19:16:01 +01:00
Tim Northover 2ba06bed6b Revert "StackProtector: ignore debug insts when splitting blocks."
This reverts commit 7605ca85f1.

It caused an assertion failure in Fuschia.
2022-02-11 18:06:28 +00:00
Austin Kerbow 0bb25b4603 [InferAddressSpaces] Fix assert on invalid cast ordering
If a cast is needed when replacing uses with newly created values, the
cast must be inserted after the instruction that defines the new value.

Fixes: SWDEV-321215

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D119524
2022-02-11 10:02:30 -08:00
Arthur Eubanks 22f4f94256 [CoroFrame][OpaquePtr] Remove getPointerElementType() call
Get it from the byval type instead.
2022-02-11 09:53:20 -08:00
Krzysztof Parzyszek 02e7479e6b [Hexagon] Add patterns for select(i1, Q, Q) 2022-02-11 09:45:20 -08:00
LLVM GN Syncbot ae0d861cb3 [gn build] Port 31f9519d48 2022-02-11 17:36:54 +00:00
Matthias Springer 9106d35b91 [mlir][bufferize] Use rewriter instead of replacing all uses directly
This is important for compatibility with DialectConversion.
2022-02-12 02:35:36 +09:00
Craig Topper 541c9ba842 [RISCV] Insert VSETVLI at the end of a basic block if we didn't produce BlockInfo.Exit.
This is an alternative to D118667 that instead of fixing the store
to match phase 1, it tries to detect the mismatch with the expected
value at the end of the block. This inserts a vsetvli after the vse
to satisfy the requirement of the other basic block.

We still have serious design issues in the pass, that is going to
require some rethinking.

Differential Revision: https://reviews.llvm.org/D119518
2022-02-11 09:34:16 -08:00
Craig Topper f35ac872b8 Revert "[RISCV] Fix a vsetvli insertion bug involving loads/stores." and "[RISCC] Add missing words to comment. NFC"
This reverts commit f943c58cae.
and commit 7eb7810727.

This introduced a new bug that appears to be easier to hit.

Differential Revision: https://reviews.llvm.org/D119517
2022-02-11 09:34:16 -08:00
Craig Topper ba9a7ae798 [RISCV] Add test case for a vsetvli insertion bug found after D118667.
We're missing a vsetvli before a vse after a redsum in this test.

This appears to be because the vmv.s.x has a VL of 1, but did not
trigger a vsetvli because it is a scalar move op and any non-zero
VL would work. So it looked at it the predecessors and decided it was
that they all had a non-zero vl. Then the redsum was visited, it
also took the VL from the predecessors since the vmv.s.x and the 4
was found compatible.

Finally we visit the vse and it looks at the BBLocalInfo and sees
that is compatible because it contains a VL of 1 from the vmv.s.x,
the first instruction in the block. BBLocalInfo was not updated
when the vredsum was visited because BBLocalInfo was valid and no
vsetvli was generated.

I think fundamentally the vmv.s.x optimization has the same first
phase and third phase not matching problem that D118667 was trying
to fix for stores.

Differential Revision: https://reviews.llvm.org/D119516
2022-02-11 09:34:16 -08:00