Nikita Popov [Wed, 12 Apr 2023 14:16:15 +0000 (16:16 +0200)]
[GVN] Regenerate test checks (NFC)
Sebastian Neubauer [Wed, 12 Apr 2023 14:15:09 +0000 (16:15 +0200)]
[AMDGPU] Fix amdgpu_gfx tail-call test
The inreg argument prevented the tail call optimization to kick in.
Remove the inreg, so this test actually uses a tail call.
Note that it now uses s[4:5] for the return address, which is invalid,
because these registers are supposed to be callee-save.
D147096 tried to fix that problem for the C calling convention.
Differential Revision: https://reviews.llvm.org/D148119
Florian Hahn [Wed, 12 Apr 2023 14:07:48 +0000 (15:07 +0100)]
[Matrix] Fix crash during dot product lowering.
Perform dot-product lowering before instruction fusion to avoid crash in
newly added test. Also update lowerDotProduct to properly mark optimized
matmul as fused.
Sergio Afonso [Mon, 10 Apr 2023 13:19:11 +0000 (14:19 +0100)]
[Flang][Driver][OpenMP] Enable options for selecting offloading phases in flang
This patch unlocks the "--offload-device-only", "--offload-host-only" and
"--offload-host-device" options available in Clang for use by the Flang driver.
These can be used to modify the behavior of the driver to select which
compilation invocations are triggered during OpenMP offloading.
Differential Revision: https://reviews.llvm.org/D147941
Nikita Popov [Wed, 12 Apr 2023 13:46:10 +0000 (15:46 +0200)]
[GVN] Add additional metadata adjustment tests (NFC)
Max Kazantsev [Wed, 12 Apr 2023 13:34:56 +0000 (20:34 +0700)]
[SimpleLoopUnswitch] Do not try to inject pointer conditions. PR62058
As shown in https://github.com/llvm/llvm-project/issues/62058, canonicalication
may fail with pointer types (and basically this transform is not expected to
work with pointers).
Max Kazantsev [Wed, 12 Apr 2023 13:33:39 +0000 (20:33 +0700)]
[Test] Add XFAIL test for PR62058
Details at https://github.com/llvm/llvm-project/issues/62058
Hans Wennborg [Wed, 12 Apr 2023 13:28:13 +0000 (15:28 +0200)]
[profile] Make __llvm_profile_global_timestamp static to unbreak Darwin
See comments on https://reviews.llvm.org/D147287
LLVM GN Syncbot [Wed, 12 Apr 2023 13:18:39 +0000 (13:18 +0000)]
[gn build] Port
e2b15ec235fe
LLVM GN Syncbot [Wed, 12 Apr 2023 13:18:38 +0000 (13:18 +0000)]
[gn build] Port
a6d9730f403a
Nico Weber [Wed, 12 Apr 2023 13:18:07 +0000 (09:18 -0400)]
Akash Banerjee [Wed, 12 Apr 2023 12:08:37 +0000 (13:08 +0100)]
[MLIR][OpenMP] Update OpenMPIRBuilderTest to use opaque pointers
This patch updates all tests to use to use the opaque pointers.
Differential Revision: https://reviews.llvm.org/D147599
Nicolas Vasilache [Wed, 12 Apr 2023 09:09:17 +0000 (02:09 -0700)]
[mlir][Linalg] Allow linalg.copy to be vectorized with masking
Differential Revision: https://reviews.llvm.org/D148095
Nikolas Klauser [Mon, 10 Apr 2023 17:31:22 +0000 (19:31 +0200)]
[libc++][NFC] rename __is_trivially_equality_comparable to __libcpp_is_trivially_equality_comparable
This is required for D147175.
Reviewed By: ldionne, Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D147953
Nikolas Klauser [Tue, 4 Apr 2023 11:05:59 +0000 (13:05 +0200)]
[libc++] Rename __tuple_dir back to __tuple
This essentially reverts D139270
Reviewed By: #libc, EricWF
Spies: tahonermann, libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D147519
Muhammad Omair Javaid [Wed, 12 Apr 2023 12:11:58 +0000 (17:11 +0500)]
[BOLT] Fix section-end-sym.s test to only run x86/Linux
section-end-sym.s contains x86_64 assembly instruction execution on target.
I have changed REQURIES: field system-linux --> x86_64-linux
This came up while testing LLVM 16.0.1 release on AArch64 Linux.
Dmitry Makogon [Wed, 12 Apr 2023 11:44:40 +0000 (18:44 +0700)]
[LoopUtils] Add isKnownPositiveInLoop and isKnownNonPositiveInLoop functions
Nicolas Vasilache [Wed, 12 Apr 2023 09:12:31 +0000 (02:12 -0700)]
[mlir][Linalg] Add support for tiling tensor.pad to scf.forall
Also, properly propagate the nofold attribute.
Differential Revision: https://reviews.llvm.org/D148114
Hans Wennborg [Wed, 12 Apr 2023 11:28:25 +0000 (13:28 +0200)]
Revert "Move "auto-init" instructions to the dominator of their users"
This could also move initialization of sret args, causing actually
initialized parts of such return values to be uninitialized. See
discussion on the code review.
> As a result of -ftrivial-auto-var-init, clang generates instructions to
> set alloca'd memory to a given pattern, right after the allocation site.
> In some cases, this (somehow costly) operation could be delayed, leading
> to conditional execution in some cases.
>
> This is not an uncommon situation: it happens ~500 times on the cPython
> code base, and much more on the LLVM codebase. The benefit greatly
> varies on the execution path, but it should not regress on performance.
>
> This is a recommit of
cca01008cc31a891d0ec70aff2201b25d05d8f1b with
> MemorySSA update fixes.
>
> Differential Revision: https://reviews.llvm.org/D137707
This reverts commit
50b2a113db197a97f60ad2aace8b7382dc9b8c31
and follow-up commit
ad9ad3735c4821ff4651fab7537a75b8f0bb60f8.
OCHyams [Wed, 12 Apr 2023 11:35:17 +0000 (12:35 +0100)]
Reapply (4) "[Assignment Tracking] Enable by default"
Re-land D146987.
This reverts commit
8af575657b1dc1113640286b3649842c2473c2cf
which reverts D146987.
OCHyams [Wed, 12 Apr 2023 11:28:59 +0000 (12:28 +0100)]
[Assignment Tracking] Fix assertion in AssignmentTrackingPass::runOnFunction
The assertion exists to ensure all variables passed into `trackAssignments` end
up with dbg.assigns associated with their backing allocas. The assertion
compared the passed-in and tracked variables using `DebugVariable`, which
includes the fragment as part of the variable identity.
It is possible for the backing alloca to be smaller than a variable (see test
case). In this case the input variable `(Var X, no fragment, no InlinedAt)`
isn't equal to the dbg.assign variable `(Var X, some fragment, no
InlinedAt)`. To cover this case the assertion now ignores fragments through the
use of `DebugVariableAggregate`.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D148100
Alexander Kornienko [Wed, 12 Apr 2023 10:30:23 +0000 (12:30 +0200)]
[lldb] Reduce chances of spurious failures in some build setups
The test may fail when running from a directory that contains the string used in
CHECK-NOT. We observe flakiness rate of around 3/100000. Increasing the length
helps reducing the rate of failures.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D148099
Nicolas Vasilache [Wed, 12 Apr 2023 10:51:08 +0000 (03:51 -0700)]
[mlir][Linalg] Add a structured transform to materialize a tensor.insert_slice via a linalg.copy
This is useful to materialize copies explicitly before bufferization and
transform them, avoiding the need to rediscover them after bufferization.
Differential Revision: https://reviews.llvm.org/D148108
Alex Zinenko [Mon, 3 Apr 2023 12:59:49 +0000 (12:59 +0000)]
[mlir] Add transform.foreach_match
Add a new transform op combinator that implements an "if-then-else"
style of mechanism for applying transformations. Its main purpose is to
serve as a higher-level driver when applying multiple transform scripts
to potentially overlapping pieces of the payload IR. This is similar to
how the various rewrite drivers operate in C++, but at a higher level
and with more declarative expressions. This is not intended to replace
existing pattern-based rewrites, but to to drive more complex
transformations that are exposed in the transform dialect and are too
complex to be expressed as simple declarative rewrites.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D148013
Dmitry Makogon [Wed, 12 Apr 2023 08:55:08 +0000 (15:55 +0700)]
[Test] Add ranges for some expressions in some SCEV tests (NFC)
Simon Pilgrim [Wed, 12 Apr 2023 10:54:18 +0000 (11:54 +0100)]
[X86] SimplifyDemandedBitsForTargetNode - add TESTPS/TESTPD support
We only need the sign bits from these nodes
Another step towards Issue #60007
Matt Arsenault [Tue, 11 Apr 2023 13:50:11 +0000 (09:50 -0400)]
InstCombine: Add some additional is.fpclass tests
Add some tests to generalize the clearing of known bits using
computeKnownFPClass instead of isKnownNeverNaN/isKnownNeverInfinity.
Matt Arsenault [Wed, 12 Apr 2023 02:24:33 +0000 (22:24 -0400)]
unittests: Use opaque pointers in a test
Matt Arsenault [Sat, 8 Apr 2023 13:21:31 +0000 (09:21 -0400)]
ValueTracking: Handle no-nan check for computeKnownFPClass for fadd/fsub
Copy the logic from isKnownNeverNaN for fadd/fsub.
Matt Arsenault [Sat, 8 Apr 2023 23:06:36 +0000 (19:06 -0400)]
ValueTracking: Remove outdated todo
Matt Arsenault [Thu, 26 Jan 2023 19:55:42 +0000 (15:55 -0400)]
AMDGPU: Push fneg into bitcast of integer select
Avoids some regressions in the math libraries in a future
patch.
Zahira Ammarguellat [Thu, 6 Apr 2023 19:21:14 +0000 (15:21 -0400)]
Set 'rounding_mode' to 'tonearest' with '#pragma STDC FENV_ACCESS OFF'.
In strict mode the 'roundin_mode' is set to 'dynamic'. Using this pragma to
get out of strict mode doesn't have any effect on the 'rounding_mode'.
See https://godbolt.org/z/zoGTf4j1G
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D147733
Simon Pilgrim [Wed, 12 Apr 2023 10:37:41 +0000 (11:37 +0100)]
[X86] Add test coverage for TESTPS/TESTPD showing the failure to demand only the sign bits
Part of Issue #60007
Simon Pilgrim [Wed, 12 Apr 2023 10:03:45 +0000 (11:03 +0100)]
[X86] combinePTESTCC - remove unnecessary legal vector type assertion
Most of these folds bitcast to the PTEST operand type anyway, and its only relevant for the PTEST->MOVMSK fold, which I'm looking at expanding to attempt to fold to PTEST->TESTP as well.
Noticed while beginning triage of Issue #60007
Pierre Gousseau [Wed, 12 Apr 2023 09:55:16 +0000 (10:55 +0100)]
[tsan] Add debugging interfaces into interface header.
Reviewed By: vitalybuka, dvyukov
Differential Revision: https://reviews.llvm.org/D147337
David Green [Wed, 12 Apr 2023 10:00:38 +0000 (11:00 +0100)]
[AArch64] Extend testing for folding fadd to predicated SVE insinstructions. NFC
This extends the existing tests to include negative zeros and additional
combinations. See D147724 and D147723.
Simon Pilgrim [Wed, 12 Apr 2023 09:37:51 +0000 (10:37 +0100)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC
Nikita Popov [Wed, 12 Apr 2023 09:55:01 +0000 (11:55 +0200)]
[SCEV] Add additional tests for finite loop trip counts (NFC)
Add post-inc variations of tests.
Alexey Lapshin [Wed, 5 Apr 2023 18:45:00 +0000 (20:45 +0200)]
[Reland][ADT][ConcurrentHashTable] adapt ConcurrentHashTable and its users to LLVM_ENABLE_THREADS=0 mode.
This patch hides thread specific handling under LLVM_ENABLE_THREADS guard.
It also removes usages of thread_local variables, since it has a weak
support on some platforms. Instead, the patch uses single mutex for locking
allocator. That may be replaced with more effective allocator later.
f.e. D142318
Differential Revision: https://reviews.llvm.org/D147649
Wang, Xin10 [Wed, 12 Apr 2023 09:26:00 +0000 (05:26 -0400)]
Fix Mem leak in LLVMTargetMachine.cpp
If we go to line 302, with one of MCE or MAB is not nullptr, then we could
leak mem here.
Use unique_ptr to maintain these 2 pointer can avoid it.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D148003
Jie Fu [Wed, 12 Apr 2023 09:19:06 +0000 (17:19 +0800)]
[mlir] Remove extra ';' outside of a function (NFC)
/data/llvm-project/mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp:342:2: error: extra ';' outside of a function is incompatible with C++
98 [-Werror,-Wc++98-compat-extra-semi]
}; // namespace
Oleg Shyshkov [Wed, 12 Apr 2023 08:48:14 +0000 (10:48 +0200)]
[mlir][bufferization] Make function boundary type convertion logic dynamic.
Having to choose from only static or dynamic layout for all function is limiting.
Differential Revision: https://reviews.llvm.org/D148074
Balázs Kéri [Wed, 12 Apr 2023 07:33:51 +0000 (09:33 +0200)]
[clang][analyzer] Improve bug reports of StdLibraryFunctionsChecker.
Add an additional explanation of what is wrong if a constraint is
not satisfied, in some cases.
Additionally the bug report generation is changed to use raw_ostream.
Reviewed By: Szelethus, NoQ
Differential Revision: https://reviews.llvm.org/D144003
Nikita Popov [Wed, 12 Apr 2023 08:17:28 +0000 (10:17 +0200)]
[GVNHoist] Regenerate test checks (NFC)
Corentin Jabot [Tue, 11 Apr 2023 14:32:31 +0000 (16:32 +0200)]
[Clang] Fix crash caused by line splicing in doc comment
Because the comment parser does not support slices,
we emit a warning for comments that do contain
a splice within their delimiter, and do not add them as
documentation comment.
Fixes #62054
Reviewed By: shafik, aaron.ballman
Differential Revision: https://reviews.llvm.org/D148029
Nikita Popov [Wed, 12 Apr 2023 07:48:01 +0000 (09:48 +0200)]
[IR] Use switch in Instruction::mayThrow() (NFC)
Martin Storsjö [Sat, 8 Apr 2023 18:51:02 +0000 (21:51 +0300)]
[libcxx] Move the private header __std_stream into the src subdir
This header isn't used by any public header, so there shouldn't
be any need to install it or treat it as a heder.
Once it's part of the src subdirectory, I guess one could consider
giving it a more traditional name too.
Differential Revision: https://reviews.llvm.org/D147855
Martin Storsjö [Wed, 5 Apr 2023 11:51:36 +0000 (14:51 +0300)]
[libcxxabi] [test] Don't cast a pointer to long, fixing the test on Windows
Use uintptr_t instead. On Windows, long is 32 bit even on 64 bit
architectures.
Differential Revision: https://reviews.llvm.org/D147639
Martin Storsjö [Tue, 11 Apr 2023 08:59:31 +0000 (11:59 +0300)]
[compiler-rt] [test] Remove a leftover XFAIL
This test succeeds on aarch64 windows now (tested both in mingw
mode and with clang-cl), most probably since commit
ccd96b3e03e18653e909852bfef105fc10782acb / D146667 ([builtins][test] Fix
divmodti4_test.c on Windows).
Differential Revision: https://reviews.llvm.org/D148000
Martin Storsjö [Wed, 29 Mar 2023 21:35:56 +0000 (00:35 +0300)]
[libcxx] [test] Check for C++ headers before building a test that uses them
When the libcxx test framework is executed within libunwind, there
are no standard C++ headers available (libunwind builds with
-nostdinc++, but doesn't add any libcxx headers to the include path).
Check that a test that includes <iostream> can be compiled before trying
to build and execute a test program that includes it.
Previously, the compile error here would block all libunwind tests from
executing altogether.
Differential Revision: https://reviews.llvm.org/D147630
Matthias Springer [Wed, 12 Apr 2023 06:50:27 +0000 (15:50 +0900)]
[mlir][transform] TrackingListener: Drop mappings of tracked ops when all handles are dead
No replacement ops are needed for tracked ops who's handles are all dead.
Differential Revision: https://reviews.llvm.org/D147510
Kazu Hirata [Wed, 12 Apr 2023 06:52:05 +0000 (23:52 -0700)]
Remove forward declarations of llvm::Any
This patch removes forward declarations of llvm::Any as they are not
used. Removing them gets us a bit closer to the world where we use
std::any instead of llvm::Any because we won't forward-declare std::
classes.
Wang, Xin10 [Wed, 12 Apr 2023 06:49:02 +0000 (02:49 -0400)]
Add delete to fix resource leak in llc.cpp
From line 693 in file llc.cpp, it uses new operator to creates a ModulePass
and assigned to MMIWP. If the condition after take the true branch, it has
chance to go in to line 702 or line 709, the function will return without
cleaning the memory.
The second issue existed for the same reason, the ref TPC get the pointer
created from LLVMTM.createPassConfig, and will leak memory if goes into
line 709.
This patch uses delete in the issued branch.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D147993
Matthias Springer [Wed, 12 Apr 2023 06:41:40 +0000 (15:41 +0900)]
[mlir][transform] Better debugging facilites for invalid API usage
This revision adds additional "expensive-checks" checks to the transform dialect that detect the most common cases of:
* Missing `consumesHandle` side effects on transform ops.
* Patterns that remove operations but do not notify the transform dialect.
In essence, these additional checks are looking for dangling pointers to erased payload ops in the transform dialect state and crash the program execution (by dereferencing free'd memory) or triggering an assertion failure. It is recommended to run these extra checks with ASAN. Otherwise, certain failures may not be detected. The ASAN error message can also be used to find the faulty transform op/pattern.
This change also fixes a few faulty transform ops.
Differential Revision: https://reviews.llvm.org/D147447
Phoebe Wang [Wed, 12 Apr 2023 06:25:18 +0000 (14:25 +0800)]
[Windows SEH] Fix ehcleanup crash for Windows -EHa
`Builder.GetInsertBlock()` may return null sometimes. https://godbolt.org/z/n1Ph47jP1
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D147867
Max Kazantsev [Wed, 12 Apr 2023 06:41:51 +0000 (13:41 +0700)]
[Test] Regenerate checks in some tests using auto-update script
luxufan [Wed, 12 Apr 2023 04:50:46 +0000 (12:50 +0800)]
[GVNHoist][NFC] Remove --check-globals in test file
luxufan [Tue, 11 Apr 2023 12:59:35 +0000 (20:59 +0800)]
[GVNHoist][NFC] Regenerate test case
Matthias Springer [Wed, 12 Apr 2023 03:54:21 +0000 (12:54 +0900)]
[mlir][transform] Dump match failures in TrackingListener
Differential Revision: https://reviews.llvm.org/D147997
Ben Shi [Wed, 12 Apr 2023 03:50:21 +0000 (11:50 +0800)]
[LoongArch] Optimize multiplication with immediates
Optimize (mul x, imm) to (ADD (SLLI x, s0), (SLLI x, s1)) or
(SUB (SLLI x, s0), (SLLI x, s1)) if possible.
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D147692
Ben Shi [Thu, 6 Apr 2023 08:27:06 +0000 (16:27 +0800)]
[LoongArch][NFC] Add tests of multiplication with immediates
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D147691
Ben Shi [Fri, 7 Apr 2023 03:45:05 +0000 (11:45 +0800)]
[AVR] Disable post increment load from program memory space
We temporarily only allow post increment load/store from/to data memory,
and disable post increment load from program space.
Updates https://github.com/llvm/llvm-project/issues/59914
Reviewed By: mzh
Differential Revision: https://reviews.llvm.org/D147761
wren romano [Tue, 11 Apr 2023 22:16:47 +0000 (15:16 -0700)]
[mlir][sparse] Canonicalizing arguments to genReshapeDstShape and foreachInSparseConstant
These functions don't need a`PatternRewriter`, they only need an `OpBuilder`. And, the builder should be the first argument, before the `Location`, to match the style used everywhere else in MLIR.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D148059
Hassnaa Hamdi [Tue, 11 Apr 2023 23:04:41 +0000 (23:04 +0000)]
Revert "[AArch64][DAGCombiner]: combine <2xi64> add/sub."
This reverts commit
6a8d8f3e28aed1b77356be74ee5109d7bdd37dd1.
Nico Weber [Tue, 11 Apr 2023 12:21:24 +0000 (08:21 -0400)]
[fuzzer] Fix -Wunreachable-code-aggressive warning in FuzzerDriver.cpp
Differential Revision: https://reviews.llvm.org/D148008
Rafael Auler [Tue, 11 Apr 2023 21:31:16 +0000 (14:31 -0700)]
[BOLT] Fix creation of invalid CFG in presence of dead code
When there is a direct jump right after an indirect one, in
the absence of code jumpting to this direct jump, this is obviously
dead code. However, BOLT was failing to recognize that by mistakenly
placing both jmp instructions in the same basic block, and creating
wrong successor edges. Fix that, so we can safely run UCE on
that. This bug also causes validateCFG to fail and BOLT to crash if it
is running ICP on that function.
Reviewed By: #bolt, Amir
Differential Revision: https://reviews.llvm.org/D148055
Jonas Devlieghere [Wed, 12 Apr 2023 00:03:49 +0000 (17:03 -0700)]
[lldb] Parse the crashlog only once
Now that we can pass Python objects to the scripted process instance, we
don't need to parse the crashlog twice anymore.
Differential revision: https://reviews.llvm.org/D148063
Lang Hames [Tue, 11 Apr 2023 04:17:37 +0000 (21:17 -0700)]
[ORC] Fix fallout from switch to _objc_map/load_images-based registration.
In
f448d44663a we switched to calling _objc_map_images and _objc_load_images
for MachO language metadata registration. This patch fixes some bugs arising
from that change:
(1) __objc_imageinfo processing was moved to a post-allocation pass, but this
prevents us from discarding the redundant copies. This commit moves
processing back to a pre-prune pass and inserts a symbol for the uniqued
__objc_image section. Runtime objects use an edge pointing to this symbol
to access the address.
(2) We were assuming that _objc_map_images & _objc_load_images were available
in the Objective-C runtime on 10.15, but these functions didn't become
available until later. This commit bumps the macOS version requirement to
13.1 where the functions should be available.
(3) The ORC-RT trivial-swift-types-section.S test was missing an
__objc_unwindinfo section, which triggered an assert that should have
been an error. The assert has been turned into an error, and the testcase
has been updated to include an __objc_imageinfo.
rdar://
107846455
Chia-hung Duan [Tue, 11 Apr 2023 22:42:02 +0000 (22:42 +0000)]
[scudo] Temporariy dispatch region from `RegionBeg`
In general, a region is located from region base and has size
`RegionSize`. However, some platforms may not support mapping from
region base. Before we have each platform implements their specific
MemMap to handle the offset. Temporarily dispatch the region from
`RegionBeg` instead.
Reviewed By: cferris, fabio-d
Differential Revision: https://reviews.llvm.org/D147792
Vitaly Buka [Tue, 11 Apr 2023 22:36:55 +0000 (15:36 -0700)]
[test][lsan] Reset pointer to leak memory
Aart Bik [Tue, 11 Apr 2023 18:42:29 +0000 (11:42 -0700)]
[mlir][sparse][gpu] put sparse compiler GPU end-to-end tests back
SM80 flag guards the test for targets that do not support A100 GPUs
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D147863
Vitaly Buka [Tue, 11 Apr 2023 22:32:22 +0000 (15:32 -0700)]
[lsan] Regression test for
7d328668691a
Caslyn Tonelli [Tue, 11 Apr 2023 21:18:29 +0000 (21:18 +0000)]
[libc] Fix typo in gnu_ext.td
Differential Revision: https://reviews.llvm.org/D148052
Ziqing Luo [Tue, 11 Apr 2023 22:01:59 +0000 (15:01 -0700)]
[-Wunsafe-buffer-usage] Match unsafe pointers being casted to bool or participating in pointer subtractions
Add two new unique cases to the Unspecified Pointer Context (UPC),
under which we match unsafe operation patterns:
- A pointer being casted to a boolean value is in a UPC;
- A pointer participating in pointer subtraction is in a UPC.
Reviewed by: NoQ (Artem Dergachev), malavikasamak (Malavika Samak)
Differential revision: https://reviews.llvm.org/D144064
Jonas Devlieghere [Tue, 11 Apr 2023 21:45:34 +0000 (14:45 -0700)]
[lldb] Parse image high address from JSON crashlogs
Use the base + size to correctly populate the image high address when
parsing JSON crashlogs.
Differential revision: https://reviews.llvm.org/D148053
Fangrui Song [Tue, 11 Apr 2023 21:44:43 +0000 (14:44 -0700)]
[bazel] Disable layering_check for llvm/unittests:mi_tests after D145707
Emilia Dreamer [Tue, 11 Apr 2023 21:33:12 +0000 (00:33 +0300)]
[clang-format] Don't modify template arguments on the LHS of assignment
After clang-format has determined that an equals sign starts an
expression, it will also go backwards and modify any star/amp/ampamp
binary operators on the left side of the assignment to be
pointers/references instead.
There already exists logic to skip over contents of parentheses and
square brackets, but this patch also expands that logic to apply to
angle brackets. This is so that binary operators inside of template
arguments would not be touched, primary arguments to non-type template
parameters.
Fixes https://github.com/llvm/llvm-project/issues/62055
Reviewed By: owenpan, MyDeveloperDay, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D148024
OCHyams [Tue, 11 Apr 2023 21:25:16 +0000 (22:25 +0100)]
Revert (4) "[Assignment Tracking] Enable by default"
This reverts commit
a0525f09ac1eda3fbb74e8708b3aa5b7379df0c2 which
lands D146987.
Buildbot: https://lab.llvm.org/buildbot/#/builders/70/builds/36214
Devajith V S [Tue, 11 Apr 2023 20:55:59 +0000 (13:55 -0700)]
[mlir][matchers] Add m_Op(StringRef) and m_Attr matchers
This patch introduces support for m_Op with a StringRef argument and m_Attr matchers. These matchers will be very useful for mlir-query that is being developed currently.
Submitting this patch separately to reduce the final patch size and make it easier to upstream mlir-query.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D147262
Caslyn Tonelli [Fri, 7 Apr 2023 22:16:01 +0000 (22:16 +0000)]
[libc] Add memmem implementation
Introduce the `memmem` libc string function.
`memmem_implementation` performs shared logic for `strstr`,
`strcasestr`, and `memmem`; essentially reconfiguring what was the
`strstr_implementation` to support length parameters.
Differential Revision: https://reviews.llvm.org/D147822
Caroline Tice [Mon, 10 Apr 2023 21:45:59 +0000 (14:45 -0700)]
[PATCH][lldb] Fix dereference of null pointer.
The function DWARFASTParserClang::ParsePointerToMemberType attempts to make
two pointers and then immediately tries to dereference them, without
verifying that the pointesr were successfully created. Sometimes the pointer
creation fails, and the dereference then causes a segfault. This add a check
that the pointers are non-null before attempting to dereference them.
OCHyams [Tue, 11 Apr 2023 19:41:52 +0000 (20:41 +0100)]
Reapply (3) "[Assignment Tracking] Enable by default"
Re-land D146987.
This reverts commit
4f1954ed67c12aca3fd3e67151185c64dc941768 which
reverts D146987.
Mircea Trofin [Tue, 11 Apr 2023 19:52:06 +0000 (12:52 -0700)]
[mlgo] Fix the help message for interactive mode default advice
This avoids the use-after-free introduced by D147794 and fixed
in
437dfa5b0365.
Alexey Bataev [Fri, 7 Apr 2023 13:14:36 +0000 (06:14 -0700)]
[SLP][NFC]Introduce ShuffleCostEstimator and adjustExtracts member function.
Added ShuffleCostEstimator class and the first adjustExtracts member,
which is just a copy of previous AdjustExtractCost lambda.
Differential Revision: https://reviews.llvm.org/D147787
Congcong Cai [Tue, 11 Apr 2023 18:45:49 +0000 (20:45 +0200)]
[clang-tidy] support nested inline namespace in c++20 for modernize-concat-nested-namespaces
Fixed https://github.com/llvm/llvm-project/issues/56022
c++20 support namespace like `namespace a::inline b {}`.
If an inline namespace is not the first, it can be concatened.
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D147946
Vlad Serebrennikov [Tue, 11 Apr 2023 19:14:29 +0000 (22:14 +0300)]
[clang] Add test for CWG1837
[[https://wg21.link/p1787 | P1787]]: CWG1837 is resolved by restricting `this` to referring to the innermost enclosing class.
Wording: see changes to [expr.prim.this] and [expr.prim.lambda].
Reviewed By: #clang-language-wg, erichkeane
Differential Revision: https://reviews.llvm.org/D148035
Vlad Serebrennikov [Tue, 11 Apr 2023 19:12:57 +0000 (22:12 +0300)]
[clang] Add test for CWG2007
[[https://wg21.link/p1787 | P1787]]: CWG2007 is resolved by skipping unqualified lookup for operators that must be member functions.
Wording: For the operators =, [], or ->, the set of non-member candidates is empty; otherwise, it includes the result of the unqualified lookup for operator@... ([over.match.oper]/3)
Reviewed By: #clang-language-wg, shafik
Differential Revision: https://reviews.llvm.org/D147839
Vlad Serebrennikov [Tue, 11 Apr 2023 19:03:13 +0000 (22:03 +0300)]
[clang] Add test for CWG2370
[[https://wg21.link/p1787 | P1787]]: CWG2370 is resolved by performing a search in (only) the immediate scope of any friend, per the [[ http://wiki.edg.com/bin/view/Wg21sandiego2018/CoreWorkingGroup#Core_issue_2370_friend_declarati | CWG opinion from San Diego ]].
Wording: In a friend declaration declarator whose declarator-id is a qualified-id whose lookup context is a class or namespace S, lookup for an unqualified name that appears after the declarator-id performs a search in the scope associated with S. If that lookup finds nothing, it undergoes unqualified name lookup. ([basic.lookup.unqual]/6).
Clarification for P1787 description: when applied to the test in this patch, "immediate scope" refers to `N`, and "(only)" refers to the fact that `type` is not searched in parent scope of `N`. See example after the wording if additional clarification is needed. The most relevant line there is `friend void A::f(F); // OK`.
Reviewed By: #clang-language-wg, shafik
Differential Revision: https://reviews.llvm.org/D147848
Craig Topper [Tue, 11 Apr 2023 18:30:15 +0000 (11:30 -0700)]
[RISCV] Add segment load/store to getTgtMemIntrinsic.
Vitaly Buka [Wed, 5 Apr 2023 23:46:42 +0000 (16:46 -0700)]
[hwasan] Don't require untagged pointer in __hwasan_tag_memory
Use likely have tagged pointer. I see no value making user to untag it.
Reviewed By: fmayer
Differential Revision: https://reviews.llvm.org/D147671
Caslyn Tonelli [Tue, 11 Apr 2023 02:57:38 +0000 (02:57 +0000)]
[libc] Fix swab placement
Per https://reviews.llvm.org/D147970#4256889, swab.cpp is moved out of
the /linux subdirectory and cmake specifications are amended to reflect
that swab is not OS-specific.
Differential Revision: https://reviews.llvm.org/D147988
Nitin John Raj [Fri, 7 Apr 2023 19:51:46 +0000 (12:51 -0700)]
[RISCV][Tablegen] Make VLXSched and VSXSched classes aware of data and index lmul
The LMUL for data and index are not guaranteed the same so we need different LMULs appended to the sched classes for them.
Differential Revision: https://reviews.llvm.org/D147814
Nitin John Raj [Fri, 7 Apr 2023 17:51:55 +0000 (10:51 -0700)]
[RISCV][Tablegen] Remove LMUL from ReadVLDX, ReadVSTX, ReadVLDSX, ReadVSTSX scheduler classes
This read is for a gpr pointer, and doesn't need to be LMUL aware.
Differential Revision: https://reviews.llvm.org/D147799
Alex Langford [Sat, 8 Apr 2023 01:39:24 +0000 (18:39 -0700)]
[lldb] Change return type of EventData::GetFlavor
There's no reason these strings need to be in the ConstString
StringPool, they're already string literals with static lifetime.
I plan on addressing other similar functions in follow up commits.
Differential Revision: https://reviews.llvm.org/D147833
Valentin Clement [Tue, 11 Apr 2023 17:42:44 +0000 (10:42 -0700)]
[mlir][openacc] Relax the single block constraint on acc.loop
The acc.loop operation was constrained by the SingleBlockImplicitTerminator.
This patch relax this constraint to allow multiple block in the loop.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D148025
Craig Topper [Tue, 11 Apr 2023 17:41:50 +0000 (10:41 -0700)]
[RISCV] Print a better error message when a rv32 CPU is used on rv64 and vice versa.
Instead of rejecting the CPU outright with no information, try
to diagnose that it doesn't match the triple.
Differential Revision: https://reviews.llvm.org/D147986
Craig Topper [Tue, 11 Apr 2023 17:41:46 +0000 (10:41 -0700)]
[RISCV] Remove getCPUFeaturesExceptStdExt.
This function was used to force +64bit or -64bit into the feature
string basd on -mcpu.
It's not entirely clear to me why this was needed. This informationo
is redundant with the triple. RISCVTargetInfo::initFeatureMap
independently recomputes it from the triple for the feature map.
It is ultimately needed in the backend, but that should be handled
by RISCVSubtarget processing the CPU name.
Differential Revision: https://reviews.llvm.org/D147978
Matthew Voss [Tue, 11 Apr 2023 17:13:58 +0000 (10:13 -0700)]
[PS4][clang] Pass -flto-jobs argument to orbis-ld
Pass -flto-jobs to orbis-ld correctly.
Differential Revision: https://reviews.llvm.org/D147660
OCHyams [Tue, 11 Apr 2023 17:03:51 +0000 (18:03 +0100)]
[Assignment Tracking] Trunc fragments for stores to vars smaller than the alloca
In D147777 emitDbgAssign was fixed to discard assignments which touched any
bits outside the bounds of a variable. This patch changes emitDbgAssign to
discard assignments which touch bits only outside the variable bounds, and
creates a truncated fragment expression for stores partially overlapping the
variable. This is necessary because the alloca is interpreted as a store (of
undef), meaning without this patch emitDbgAssign would discard the inital
dbg.assign for a variable that is smaller than the alloca.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D148018
OCHyams [Tue, 11 Apr 2023 16:36:39 +0000 (17:36 +0100)]
[Assignment Tracking][SROA] Don't un-poison dbg.assigns using multiple loc ops
Some dbg.assigns using poison become un-poisoned in SROA. The reason this
happens at all is because dbg.assigns linked to memory intrinsics use poison to
indicate they can't describe the stored value, but the value becomes available
after some optimisations. This needs reworking eventually, but for now we need
to ensure that when it does occur we don't create invalid expressions.
D147312 prevented this occuring when the dbg.assign uses DIArgLists, but that
wasn't a complete fix. We also need to ensure we avoid un-poisoning when the
existing expression uses more than one location operand (DW_OP_arg, n).
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D148020