444619 Commits

Author SHA1 Message Date
chenglin.bi
b966fb08a2 [InstCombine] Precommit tests for D139253; NFC 2022-12-06 00:00:54 +08:00
Nico Weber
92f8a6eba7 [lld/mac] Fix --start-lib/--end-lib with split thinlto inputs
Fixes #59162. The test has a comment explaining what's going on.
See also Symbol::extract() in lld/ELF/Symbols.cpp.

The included test sadly also passes if I pass just bd448f01a62,
while doing that isn't enough to make my bigger repro case work
(if I port just that, something else asserts later on, but with
this fix here everything's fine in my bigger repro).

Differential Revision: https://reviews.llvm.org/D139199
2022-12-05 10:51:14 -05:00
Michał Górny
e99edb9235 Revert "[test] Fix CodeGen/M68k/pipeline.ll after D123394 MachineLateInstrsCleanupPass"
This reverts commit f55880e830e150d98e5340cdc3c4c41867a5514d.
The original change was reverted.
2022-12-05 16:47:17 +01:00
Sjoerd Meijer
1515308a54 [LoopFlatten] Precommit test for GH issue #59339. NFC. 2022-12-05 15:38:47 +00:00
Sjoerd Meijer
218e0c6922 [LoopFlatten] Add some LLVM_DEBUG messages. NFC. 2022-12-05 15:38:47 +00:00
Peter Klausler
9e855a6cb8 [flang] Map symbols in expressions when copying interface symbols
Given a MODULE SUBROUTINE or MODULE FUNCTION interface followed
later by a corresponding separate module subprogram definition in a
MODULE PROCEDURE, the copies of the interface's dummy argument and
function result symbols that populate the initial scope of that
MODULE PROCEDURE need to have any symbol references in their types
or bounds adjusted to point to their new counterparts.

Differential Revision: https://reviews.llvm.org/D139200
2022-12-05 07:33:57 -08:00
Samira Bazuzi
6e08ac8dce [flang][NFC] Add a no-arg constructor for Verbatim.
In C++20, types that declare or delete any constructors are no longer aggregates, breaking compilation of many existing uses of aggregate initialization.

Although `Verbatim` declares itself to not have a no-arg default constructor, this is circumvented in `basic-parsers.h` which returns a `RESULT{}` a.k.a. `Verbatim{}`. Adding the no-arg constructor while still deleting the copy/assignment constructors maintains the current state and also supports eventually building this in c++20 mode.

Fix suggested in https://discourse.llvm.org/t/build-failure-when-attempting-to-build-flang-with-c-20/66953.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D139228
2022-12-05 07:30:30 -08:00
Florian Hahn
eefd085843
[ConstraintElim] Add test with implicit/explicit GEP index truncate.
The implicit index truncate example is currently being miscompiled.
2022-12-05 15:25:08 +00:00
Sjoerd Meijer
8250180238 Revert "Recommit "[LoopFlatten] Enable it by default""
This reverts commit 3ea6a9a469fde168c527b1c34c09f6d684ec86af because of the
reported miscompilation in: https://github.com/llvm/llvm-project/issues/59339
2022-12-05 15:14:12 +00:00
bipmis
081b7f6b03 [AAch64] Optimize muls with operands having enough sign bits.
Muls with 64bit operands where each of the operand is having more than 32 sign bits, we can generate a single smull instruction on a 32bit operand.

Differential Revision: https://reviews.llvm.org/D138817
2022-12-05 15:08:31 +00:00
Matt Arsenault
51af4ddfc2 ValueTracking: Teach canCreateUndefOrPoison about more intrinsics
I tried to test the fallthrough to noundef callsite return attribute
case, but it seems that folds out as-is.
2022-12-05 10:04:13 -05:00
Emmmer
2d7f43f9ea [LLDB][RISCV] Add RV64F instruction support for EmulateInstructionRISCV
Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D139294
2022-12-05 22:54:08 +08:00
Matt Arsenault
dfa842e45a ValueTracking: Add some baseline intrinsic with freeze tests 2022-12-05 09:40:58 -05:00
LLVM GN Syncbot
d8ab7cf2d3 [gn build] Port dbe8c2c316c4 2022-12-05 14:27:33 +00:00
Dmitry Vyukov
08742e72a3 compiler-rt/test/metadata: restrict tests to x86_64
aarch64 builder broke with:

-- Supported architectures for crt: aarch64
CMake Error at compiler-rt/cmake/config-ix.cmake:244 (message):
  Unsupported architecture: x86_64
Call Stack (most recent call first):
  compiler-rt/cmake/config-ix.cmake:280 (get_target_flags_for_arch)
  compiler-rt/test/metadata/CMakeLists.txt:7 (get_test_cc_for_arch)
-- Configuring incomplete, errors occurred!

https://lab.llvm.org/buildbot/#/builders/223/builds/11423

Restrict the tests to x86_64 only.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D139323
2022-12-05 15:27:21 +01:00
Roman Lebedev
2a05bd212e
[NFC] Fix test/CodeGen/PowerPC/O0-pipeline.ll 2022-12-05 17:21:39 +03:00
Matt Arsenault
0b01e3d0ae clang: Convert builtins test to opaque pointers 2022-12-05 09:01:52 -05:00
Joseph Huber
df415774d2 [LinkerWrapper] Fix use-after-free when using JIT
Summary:
This portion of the code was unused until now and wasn't properly
updated after we moved to using `StringRef`.
2022-12-05 07:51:20 -06:00
Dmitry Vyukov
dbe8c2c316 Use-after-return sanitizer binary metadata
Currently per-function metadata consists of:
(start-pc, size, features)

This adds a new UAR feature and if it's set an additional element:
(start-pc, size, features, stack-args-size)

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D136078
2022-12-05 14:40:31 +01:00
Matt Arsenault
dbca874faa ValueTracking: Teach CannotBeOrderedLessThanZero about trivial ops
Handle canonicalize and arithmetic.fence
2022-12-05 08:39:07 -05:00
Matt Arsenault
db0f258479 ValueTracking: Teach isKnownNeverNaN about arithmetic_fence 2022-12-05 08:39:07 -05:00
Matt Arsenault
dac496fb1f ValueTracking: Teach isKnownNeverInfinity about arithmetic.fence 2022-12-05 08:39:07 -05:00
Matt Arsenault
7224cffd62 Intrinsics: Fix not speculating llvm.fptrunc.round
Move its definition to be with the other FP rounding intrinsics.
2022-12-05 08:39:07 -05:00
Vladislav Dzhidzhoev
f32cafedf0 [GlobalISel][DebugInfo] Propagate debug location for localized constants
After IRTranslator pass, constants are deduplicated and translated into instructions at entry block, having debug locations lost.
Localization of constants may cause emission of extra zero lines in debug_line section, like here https://godbolt.org/z/ecvsxxfKn. In this example, constant gets placed as
a first instruction in entry block, and despite it has no debug location, AsmPrinter emits zero line for it.

If a localized constant has the only user, we can assume that it has the same debug location as its user, since they are placed consequently.

Differential Revision: https://reviews.llvm.org/D128192
2022-12-05 16:38:24 +03:00
Juan Manuel MARTINEZ CAAMAÑO
a446827249 [NFC][Clang][Driver][AMDGPU] Avoid temporary copies of std::string by using Twine and StringRef
Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D139023
2022-12-05 07:27:10 -06:00
Dmitry Preobrazhensky
453eb9eb42 [AMDGPU][MC] Correct handling of mandatory literals
Differential Revision: https://reviews.llvm.org/D138661
2022-12-05 16:23:47 +03:00
Haojian Wu
2ef8fd8a69 An iwyu cleanup in flang/Frontend/TargetOptions.h 2022-12-05 14:19:17 +01:00
Sander de Smalen
4d2f0f723a [AArch64][SME] Avoid going through memory for streaming-compatible splats
Reviewed By: david-arm, paulwalker-arm

Differential Revision: https://reviews.llvm.org/D139111
2022-12-05 13:04:30 +00:00
Florian Hahn
6b940588a0
[ConstraintElim] Update comment after recent changes.
Update the comment to reflect the current code.
2022-12-05 12:19:09 +00:00
Guray Ozen
12cc8e7310 [mlir] Fix infinite loop in collapse
Incrementing `counter` variable is inside the if statement. If the code does not enter there, the while loop will iterate infinitely. This revision moves the codes outside of if statement.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D139005
2022-12-05 12:57:20 +01:00
luxufan
b0f7876917 [SCCP] Propagate equality of a not-constant
The equality state of a not-constant can be used to do constant
propagation. For example,
```
define i32 @equal_not_constant(ptr noundef %p, ptr noundef %q) {
entry:
  %cmp = icmp ne ptr %p, null
  br i1 %cmp, label %if.then, label %if.end

if.then:                                          ; preds = %entry
  %cmp.then = icmp eq ptr %p, %q
  br i1 %cmp.then, label %if.then1, label %if.end

if.then1:                                         ; preds = %if.then
  %cmp.then1 = icmp ne ptr %q, null
  call void @use(i1 %cmp.then1)
  br label %if.end

if.end:
  ret i32 0
}

```
In this case, we can fold `%cmp.then1` as `true`.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D139289
2022-12-05 19:54:13 +08:00
Petar Avramovic
fc85ccd7b3 AMDGPU/MC: Simplify AsmParser for VOP3P
Remove check that instruction has src_modifiers because
isRegOrImmWithInputMods essentially includes this check.
isMod is no longer used after the refactor. Also, was unreachable case
inside for loop. clamp and omod operands are handled after the loop.

Differential Revision: https://reviews.llvm.org/D139194
2022-12-05 12:45:39 +01:00
David Spickett
04aae2527b [LLVM][Runtimes] Surround unknown runtime with ""
So that when you do something like:
-DLLVM_ENABLE_RUNTIMES=;compiler-rt;libcxx;libcxxabi;libunwind

You get:
Runtime "" is not a supported runtime.  Supported runtimes are:

Instead of:
Runtime is not a supported runtime.  Supported runtimes are:

Which implies that "Runtime" is the name of the runtime you
tried to build, but in fact it was "".
2022-12-05 11:33:29 +00:00
Haojian Wu
14af1ad4ee [include-cleaner] Add two command-line flags to the include-cleaner
category.
2022-12-05 12:20:34 +01:00
Tomas Matheson
541a1371c0 Revert "[AArch64] Improve TargetParser API"
This reverts commit e83f1502f1be7a2a3b9a33f5a73867767e78ba6b.

Did not build with C++20 and caused problems with dynamic libs.
2022-12-05 11:09:03 +00:00
Nikita Popov
f101196d69 [SCCP] Add support for with.overflow intrinsics
This adds SCCP support for extractvalues of with.overflow.
We compute both the range of the result value and determine when
the overflow value is always false.

Differential Revision: https://reviews.llvm.org/D137713
2022-12-05 12:00:22 +01:00
Michael Buch
811ad246ac [lldb][Test] TestModulesCompileError.py: fix expected error string 2022-12-05 10:50:16 +00:00
Max Kazantsev
0c7910eab9 [NFC] Rename variable MaxBECount -> ConstantMaxBECount
Just to distinguish it from symbolic max which we plan to compute
here as well.
2022-12-05 17:48:36 +07:00
Simon Pilgrim
fceec8dcd8 Fix MSVC "not all control paths return a value" warning. NFC. 2022-12-05 10:39:54 +00:00
Adrian Kuegel
94d3df2015 [mlir][Tensor] Apply ClangTidy performance finding (NFC) 2022-12-05 11:22:20 +01:00
Tiehu Zhang
7927722a74 [AArch64][SVE2] Add patterns for eor3
Add patterns for:
    eor x, (eor y, z) -> eor3 x, y, z

Reviewed By: dmgreen, sdesmalen
Differential Revision: https://reviews.llvm.org/D138793
2022-12-05 18:16:55 +08:00
John McIver
553bdf4fde [NFC][clang] Strengthen checks in matrix-type-operators.c
* Add tbaa attribute checks
* Add end-of-line check to load instructions
2022-12-05 10:13:35 +00:00
John McIver
64428c0ddf [NFC][clang] Strengthen checks in matrix-type-operators.cpp
* Add tbaa attribute checks
* Add end-of-line check to load instructions
2022-12-05 10:12:25 +00:00
Valentin Clement
019bec8c8a
[flang][NFC] Remove implemented TODOs 2022-12-05 10:32:08 +01:00
Max Kazantsev
798fa4b415 [Test] Add 2 more simplified test with missing opts
These are simplified versions of one existing test, but we cannot deal
with them either.
2022-12-05 15:57:49 +07:00
Valentin Clement
42b21ddaad
[flang] Pointer assignment with remapping involcing polymorphic entities
Lower pointer assignment with remapping involving polymorphic entities
to runtime call to PointerAssociateRemapping.
For the time being all pointer assignment involcing polymorphic entities are
done with the runtime call. When lhs is not unlimited polymorphic
we might be able to do it inlined as well.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D139198
2022-12-05 09:36:11 +01:00
Nikita Popov
4de3184f07 [LAA] Use cross-iteration alias analysis
LAA analyzes cross-iteration memory dependencies, as such AA should
not make assumptions about equality of values inside the loop, as
they may come from different iterations.

Fix this by exposing the MayBeCrossIteration AA flag and enabling
it for LAA.

Differential Revision: https://reviews.llvm.org/D137958
2022-12-05 09:27:13 +01:00
Matthias Springer
1403073790 [mlir][tensor] Fold rank-reducing insert_slice with inverse collapse_shape
Differential Revision: https://reviews.llvm.org/D139221
2022-12-05 09:17:29 +01:00
Matthias Springer
50a2bb95ab [mlir][tensor] Fold rank-reducing extract_slice with inverse expand_shape
Differential Revision: https://reviews.llvm.org/D139220
2022-12-05 09:17:24 +01:00
Fangrui Song
23ad3dac0a [LegacyPM] Remove dead declarations 2022-12-05 08:09:23 +00:00