Commit Graph

483221 Commits

Author SHA1 Message Date
David Spickett
810d09faf8 [lldb][test] Disable image lookup colour test on Windows
On Linux `main.c` shows up in the symbol search but this is not the
case on Windows according to:
https://lab.llvm.org/buildbot/#/builders/219/builds/7422/steps/6/logs/stdio

It's possible we could make this test work there once function
search highlighting is implemented.
2023-12-08 13:36:41 +00:00
David Spickett
ce3c7c0910 [lldb][test] Don't check line number in image lookup colour test
We can assume the correct symbol is found, so putting the line
number here is just going to confuse anyone extending these tests.
2023-12-08 13:34:07 +00:00
Benjamin Kramer
06ebe3b237 [NVPTX] Fix a typo that makes the output invalid PTX
It's surprisingly tricky to trigger this as it's only used by abs/neg
which expand into and/xor in the integer domain.
2023-12-08 14:22:07 +01:00
Jay Foad
e38c29c2b7 [AMDGPU] Add GFX11 test coverage to integer-mad-patterns.ll 2023-12-08 13:06:03 +00:00
David Sherwood
c1cfa1757c
[Clang] Emit TBAA info for enums in C (#73326)
When emitting TBAA information for enums in C code we currently just
treat the data as an 'omnipotent char'. However, with C strict aliasing
this means we fail to optimise certain cases. For example, in the
SPEC2017 xz benchmark there are structs that contain arrays of enums,
and clang pessmistically assumes that accesses to those enums could
alias with other struct members that have a different type.

According to

https://en.cppreference.com/w/c/language/enum

enums should be treated as 'int' types unless explicitly specified (C23)
or if 'int' would not be large enough to hold all the enumerated values.
In the latter case the compiler is free to choose a suitable integer
that would hold all such values.

When compiling C code this patch generates TBAA information for the enum
by using an equivalent integer of the size clang has already chosen for
the enum. I have ignored C++ for now because the rules are more complex.

New test added here:

  clang/test/CodeGen/tbaa.c
2023-12-08 12:58:39 +00:00
Jay Foad
2a0314f153 [GlobalISel] Fix comment on buildIsFPClass 2023-12-08 12:41:22 +00:00
Saiyedul Islam
5c4c199fe3
[AMDGPU][NFC] Improve testing for AMDHSA ABI Version (#74300)
Add tests for COV4 as well as COV5 instead of only testing for the
default version.
2023-12-08 18:09:45 +05:30
Simon Pilgrim
22fbd07bd7 [X86] combineLoad - consistently use cast<MemSDNode>. NFCI.
getBasePtr()/getMemoryVT() are common methods for all memory nodes.
2023-12-08 12:24:55 +00:00
Florian Hahn
5ea6a3fc6d
[VPlan] Compute scalable VF in preheader for induction increment. (#74762)
UF * VF is loop invariant and can be computed directly in the preheader.
This prepares the code for #74761 and reduces the test changes.
2023-12-08 12:18:31 +00:00
Mehdi Amini
69a0a3be01 [mlir] Add missing MLIR_ENABLE_EXECUTION_ENGINE option to MLIRConfig.cmake.in
This is the kind of options that downstream consumers of preconfigured MLIR
packages can check to see if the execution engine is available or not.
2023-12-08 04:12:47 -08:00
Clement Courbet
9017229ecd
[llvm-exegesis]Allow clients to do their own snippet running error ha… (#74711)
…ndling.

Returns an error *and* a benchmark rather than an error *or* a
benchmark. This allows users to have custom error handling while still
being able to inspect the benchmark.

Apart from this small API change, this is an NFC.

This is an alternative to #74211.
2023-12-08 13:01:01 +01:00
XiangZhang
1d6a678591
[LoopUnroll] Make use of MaxTripCount for loops with "#pragma unroll" (#74703)
Fix loop unroll fail caused by branches folding.

For example:
SimplifyCFG foldloop branches then cause loop unroll failed for "#program unroll" loop.
```
#program unroll
for (int I = 0; I < ConstNum; ++I) { // folding "I < ConstNum" and "Cond2"
  if (Cond2) {
  break;
  }
  xxx loop body;
}
```

The pragma unroll metadata only takes effect if there is an exact trip
count, but not if there is an upper bound trip count. This patch make it
work with an upper bound trip count as well in shouldPragmaUnroll().

Loop unroll is important in stack nervous devices (e.g. GPU, and that is
why a lot of GPU code mark loop with "#program unroll").
It usually much simplify the address (offset) calculations in old
iterations, then we can do a lot of others optimizations, e.g, SROA, for
these simplifed address (escape alloca the whole aggregates).
2023-12-08 19:43:10 +08:00
Simon Pilgrim
5f91335a55 [X86] canonicalizeBitSelect - always use VPTERNLOGD for sub-32bit types
We were using VPTERNLOGQ for everything but i32 types, which made broadcasts wider than necessary

Noticed in #73509
2023-12-08 11:38:32 +00:00
David Spickett
ffd61c1e96 [lldb] Add missing nullptr checks when colouring symbol output
This adds some checks missed by c90cb6eee8,
probably because some tests only run on certain platforms.
2023-12-08 11:24:07 +00:00
taalhaataahir0102
c90cb6eee8
[lldb] colorize symbols in image lookup with a regex pattern (#69422)
Fixes https://github.com/llvm/llvm-project/issues/57372

Previously some work has already been done on this. A PR was generated
but it remained in review:
https://reviews.llvm.org/D136462

In short previous approach was following:
Changing the symbol names (making the searched part colorized) ->
printing them -> restoring the symbol names back in their original form.

The reviewers suggested that instead of changing the symbol table, this
colorization should be done in the dump functions itself. Our strategy
involves passing the searched regex pattern to the existing dump
functions responsible for printing information about the searched
symbol. This pattern is propagated until it reaches the line in the dump
functions responsible for displaying symbol information on screen.

At this point, we've introduced a new function called
"PutCStringColorHighlighted," which takes the searched pattern, a prefix and suffix,
and the text and applies colorization to highlight the pattern in the
output. This approach aims to streamline the symbol search process to
improve readability of search results.

Co-authored-by: José L. Junior <josejunior@10xengineers.ai>
2023-12-08 11:09:04 +00:00
Simon Pilgrim
faecc736e2
[DAG] isSplatValue - node is a splat if all demanded elts have the same whole constant value (#74443) 2023-12-08 10:53:51 +00:00
Tom Eccles
bdacd56fd1
[flang][CodeGen] add nsw to address calculations (#74709)
`nsw` is a flag for LLVM arithmetic operations meaning "no signed wrap".
If this keyword is present, the result of the operation is a poison
value if overflow occurs. Adding this keyword permits LLVM to re-order
integer arithmetic more aggressively.

In

https://discourse.llvm.org/t/rfc-changes-to-fircg-xarray-coor-codegen-to-allow-better-hoisting/75257/16
@vzakhari observed that adding nsw is useful to enable hoisting of
address calculations after some loops (or is at least a step in that
direction).

Classic flang also adds nsw to address calculations.
2023-12-08 10:51:20 +00:00
Florian Hahn
633fe60149
[VPlan] Print flags for VPWidenCastRecipe.
Update VPWidenCastRecipe to also print flags. Simplify nneg printing
test and replace hard-coded value number references with patterns.
2023-12-08 10:48:54 +00:00
Mikhail Goncharov
b43ab18204 Reapply "[lldb][test] TestLocationListLookup.py: skip expr check on unsupported platforms (#74818)"
This reverts commit e33302fa12.

there is a fix already, sorry for the noise
2023-12-08 11:43:14 +01:00
Mikhail Goncharov
e33302fa12 Revert "[lldb][test] TestLocationListLookup.py: skip expr check on unsupported platforms (#74818)"
This reverts commit 11a7e5781c.

Test fails: https://lab.llvm.org/buildbot/#/builders/219/builds/7416 and
others.
2023-12-08 11:39:10 +01:00
Wang Pengcheng
ea85345eb6
[RISCV][NFC] Use raw_svector_ostream to construct key of SubtargetMap (#72964)
To simplify some code.
2023-12-08 18:34:31 +08:00
Simon Pilgrim
8859a4f630 [X86] LowerBUILD_VECTOR - don't use insert_element(constant, elt, idx) if we have a freeze(undef) element
Fixes #74736
2023-12-08 10:28:56 +00:00
Valery Pykhtin
901c5be524
[AMDGPU] Fix GCNUpwardRPTracker: max register pressure on defs. (#74422)
Treat a defined register as fully live "at" the instruction and update maximum pressure accordingly. Fixes #3786.
2023-12-08 11:27:08 +01:00
Nikita Popov
cf47af493b
[InstCombine] Generalize folds for inversion of icmp operands (#74317)
We have a bunch of folds that basically perform X pred Y to ~Y pred ~X
for various special cases where this saves an instruction.

Generalize these folds to use isFreeToInvert(). We have to make sure
that we consume an instruction in either of the inversions, otherwise
we're just going to swap the icmp back and forth.

Fixes https://github.com/llvm/llvm-project/issues/74302.
2023-12-08 11:25:41 +01:00
Graham Hunter
d0d5ef8133
[LV] Add support for linear arguments for vector function variants (#73941)
If we have vectorized variants of a function which take linear
parameters, we should be able to vectorize assuming the strides match.
2023-12-08 10:24:05 +00:00
Michael Buch
11a7e5781c
[lldb][test] TestLocationListLookup.py: skip expr check on unsupported platforms (#74818)
The `expect_expr` check was introduced in
https://github.com/llvm/llvm-project/pull/74772. It is failing on Linux
and Windows, so skip this test to unblock the bots
2023-12-08 10:09:38 +00:00
Ramkumar Ramachandra
b0f560b8ea
LoopVectorize/test: fix opt invocations with -march (NFC) (#74462)
opt accepts the -march command-line argument, but this argument only
makes sense in conjunction with -mtriple. Fix a couple of tests under
LoopVectorize that invoke opt with -march but without -mtriple, to avoid
confusing users.
2023-12-08 09:56:55 +00:00
Ramkumar Ramachandra
dabf8490a9
MIRLangRef: fix llc invocation lines to write output (#74104)
The first couple of llc invocations mentioned in the document are wrong,
and users will get confused about no output being written. Fix them.
2023-12-08 09:54:33 +00:00
Amir Bishara
cf2d625a5d
[mlir][linalg] Expose getPreservedProducerResults method from ElementwiseOpFusion file (#73850)
Declare `getPreservedProducerResults` function which helps to get the
preserved results of the producer linalg generic operation as a result
of elementwise fusion.
2023-12-08 11:50:33 +02:00
Nikita Popov
52296e2527 [DomCondCache] Remove unused variable (NFC) 2023-12-08 10:25:04 +01:00
Nikita Popov
292256673c [ValueTracking] Remove unused argument (NFC) 2023-12-08 10:25:04 +01:00
Daniil Kovalev
24f8bc5506
Revert "[llvm-readobj][AArch64][ELF][PAC] Support ELF AUTH constants" (#74816)
Reverts llvm/llvm-project#72713

Buildbot tests fail on clang-armv7-global-isel builder
https://lab.llvm.org/buildbot/#/builders/186/builds/13604
2023-12-08 12:10:27 +03:00
xiaoleis-nv
c340cf0a35
Fix argument name of GEPOp builder (#74810)
This MR fix the argument name of GEPOp builder from `basePtrType` to
`elementType` to avoid confusion.

Co-authored-by: Xiaolei Shi <xiaoleis@nvidia.com>
2023-12-08 00:28:12 -08:00
Vlad Serebrennikov
76ee344769
[clang][NFC] Refactor expected directives in C++ DRs 700-1999 (#74767)
This patch continues the work started with ea5b1ef016. See that commit and its
corresponding PR for details.
2023-12-08 12:10:57 +04:00
Michael Buch
58bdef2be7
[lldb][Symbol] Make sure we decrement PC before checking location list (#74772) 2023-12-08 07:32:23 +00:00
wanglei
cdc3732566 [LoongArch] Mark ISD::FNEG as legal 2023-12-08 15:07:58 +08:00
Sizov Nikita
827f8a7ef6
Add opt with ctlz and shifts of power of 2 constants (#74175)
This patch does the following simplifications:
```
cttz(shl(C, X), 1) -> add(cttz(C, 1), X)
cttz(lshr exact(C, X), 1) -> sub(cttz(C, 1), X)
ctlz(lshr(C, X), 1) --> add(ctlz(C, 1), X)
ctlz(shl nuw (C, X), 1) --> sub(ctlz(C, 1), X)
```
Alive2: https://alive2.llvm.org/ce/z/9KHlKc
Closes #41333
2023-12-08 15:06:23 +08:00
Kazu Hirata
28a78e2a4a [AMDGPU] Use isNullConstant (NFC) 2023-12-07 22:33:46 -08:00
Daniil Kovalev
c8616c724f
[llvm-readobj][AArch64][ELF][PAC] Support ELF AUTH constants (#72713)
This patch adds llvm-readobj support for:

- Dynamic R_AARCH64_AUTH_* relocations (including RELR compressed AUTH
relocations) as described here:
https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#auth-variant-dynamic-relocations

- .note.AARCH64-PAUTH-ABI-tag section as defined here
https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#elf-marking
2023-12-08 09:31:16 +03:00
wanglei
9f70e708a7
[LoongArch] Make ISD::FSQRT a legal operation with lsx/lasx feature (#74795)
And add some patterns:
1. (fdiv 1.0, vector)
2. (fdiv 1.0, (fsqrt vector))
2023-12-08 14:16:26 +08:00
Kazu Hirata
6c87a0af95 [Analysis] Remove unnecessary includes (NFC) 2023-12-07 22:15:32 -08:00
Mehdi Amini
847d8457d1 Apply clang-tidy fixes for performance-unnecessary-value-param in VectorToGPU.cpp (NFC) 2023-12-07 21:39:25 -08:00
Mehdi Amini
b8a3f0fd3a Apply clang-tidy fixes for llvm-qualified-auto in VectorToGPU.cpp (NFC) 2023-12-07 21:39:25 -08:00
Mehdi Amini
1cef577b90 Apply clang-tidy fixes for llvm-qualified-auto in PredicateTree.cpp (NFC) 2023-12-07 21:39:25 -08:00
Mehdi Amini
345d574b65 Apply clang-tidy fixes for llvm-prefer-isa-or-dyn-cast-in-conditionals in MapMemRefStorageClassPass.cpp (NFC) 2023-12-07 21:39:25 -08:00
Mehdi Amini
6ac80a7677 Apply clang-tidy fixes for readability-identifier-naming in GPUToLLVMConversion.cpp (NFC) 2023-12-07 21:39:25 -08:00
Kazu Hirata
59194253a0 [IR] Remove unnecessary includes (NFC) 2023-12-07 21:19:43 -08:00
Matthias Springer
f5724847ec
[mlir][Transforms][NFC] GreedyPatternRewriteDriver: Remove redundant worklist management code (#74796)
Do not add the previous users of replaced ops to the worklist during
`notifyOperationReplaced`.

The previous users are modified inplace as part of
`PatternRewriter::replaceOp`, which calls
`PatternRewriter::replaceAllUsesWith`. The latter function updates all
users with `updateRootInPlace`, which already puts all previous users of
the replaced op on the worklist. No further worklist management work is
needed in the `notifyOperationReplaced` callback.
2023-12-08 14:10:44 +09:00
Kazu Hirata
286ef12b47 [Target] Remove unnecessary includes (NFC) 2023-12-07 21:03:56 -08:00
Kazu Hirata
dc1f208346 [TableGen] Remove unnecessary includes (NFC)
Identified with clangd.
2023-12-07 21:03:55 -08:00