Commit Graph

405312 Commits

Author SHA1 Message Date
Jacques Pienaar
e5a4d0f149 [mlir] Fix unused function warning (NFC)
Delete function no longer needed as all derived classes override
printer.
2021-11-21 15:06:08 -08:00
Jacques Pienaar
6f9cceb775 [mlir] Move trait to InferTypeOpInterface
Step towards removing the hard coded behavior for this trait and to instead use common interface.

Differential Revision: https://reviews.llvm.org/D114208
2021-11-21 14:41:12 -08:00
Kazu Hirata
c133fb321f [CodeGen] Use llvm::is_contained (NFC) 2021-11-21 10:36:20 -08:00
Kazu Hirata
fc981cedea [llvm] Use range-based for loops (NFC) 2021-11-21 10:36:18 -08:00
Simon Pilgrim
4a5e1ffcf9 [ARM] Regenerate sxt_rot.ll tests 2021-11-21 18:33:29 +00:00
Simon Pilgrim
eced44637c [Thumb2] Regenerate ext + rot tests 2021-11-21 18:33:28 +00:00
Simon Pilgrim
357d636289 [PowerPC] Regenerate rlwinm2.ll test 2021-11-21 18:33:28 +00:00
Philip Reames
73d52ee785 Add a best practice section on how to configure a fast builder
This is based on conversations with a couple of folks currently running buildbots. There's a couple pieces which didn't make it in, but this tries to cover the common themes.

Differential Revision: https://reviews.llvm.org/D114325
2021-11-21 08:01:29 -08:00
Arjun P
ad48ef1e31 [MLIR][NFC] Simplex::restoreRow: improve documentation 2021-11-21 19:23:55 +05:30
Simon Pilgrim
3234f2d9c1 [ARM][ParallelDSP] Regenerate complex_dot_prod.ll test 2021-11-21 12:01:44 +00:00
David Green
2b9c41189e [AArch64] Extra testing for sinking splats to various instructions. NFC 2021-11-21 11:46:34 +00:00
Fangrui Song
648157b05a [ELF] Move getOutputSectionName from Writer.cpp to LinkerScript.cpp. NFC
and internalize it.
2021-11-20 22:18:09 -08:00
Kazu Hirata
f6bce30cf9 [llvm] Use range-based for loops (NFC) 2021-11-20 18:42:10 -08:00
Phoebe Wang
6cc820a3e2 [X86][FP16] Relax the pattern condition for VZEXT_MOVL to match more cases
Fixes pr52560

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D114313
2021-11-21 09:14:11 +08:00
Joe Loser
dca681fee9
[libc++][NFC] Fix typo in ranges::iterator_t synopsis
The `iterator_t` alias template is on `T` not a `R` like the other
neighboring alias templates. Fix the typo.
2021-11-20 19:15:00 -05:00
Arthur O'Dwyer
e74114add3 [libc++] [doc] Mark some spaceship-related LWG issues as "Complete."
LWG3330 has been "Completed" since D99309, which was in the 13.x timeframe.
Reviewed as part of D110738.
2021-11-20 18:16:22 -05:00
Roman Lebedev
df70cf5e14
[NFC][X86][Costmodel] Actually test +prefer-256-bit in replication-shuffle-related tests :(
While -prefer-256-bit indeed becomes complete with D114314,
the real-world (the one with +prefer-256-bit) coverage is lacking.

Hilarious.
2021-11-21 01:25:49 +03:00
Nikita Popov
aeba28bc62 [DSE] Drop hasAnalyzableMemoryWrite() (NFCI)
The functionality of hasAnalyzableMemoryWrite() is effectively
subsumed by getLocForWriteEx(), which will return None if the
instruction is not analyzable. The implementations don't match
exactly (e.g. getLocForWriteEx() does not limit non-calls to
stores), but in conjunction with the isRemovable() check, it ends
up being the same.
2021-11-20 23:20:12 +01:00
Felix Berger
fefe20b993 [clang-tidy] performance-unnecessary-copy-initialization: Correctly match the type name of the thisPointertype.
The matching did not work correctly for pointer and reference types.

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

Reviewed-by: courbet
2021-11-20 15:13:41 -05:00
Nikita Popov
0a2bde94a0 [LVI] Drop requirement that modulus is constant
If we're looking only at the lower bound, the actual modulus
doesn't matter. This is a leftover from when I wanted to consider
the upper bound as well, where the modulus does matter.
2021-11-20 21:06:08 +01:00
Nikita Popov
cd84cab6b3 [LVI] Support urem in implied conditions
If (X urem M) >= C we know that X >= C. Make use of this fact
when computing the implied condition range.

In some cases we could also establish an upper bound, but that's
both tricker and not interesting in practice.

Alive: https://alive2.llvm.org/ce/z/R5ZGSW
2021-11-20 21:01:26 +01:00
Nikita Popov
25a9ee52f1 [CVP] Add tests for implied conditions using urem (NFC) 2021-11-20 20:49:29 +01:00
Florian Hahn
cf8efbd30e
[VPlan] Wrap vector loop blocks in region.
A first step towards modeling preheader and exit blocks in VPlan as well.
Keeping the vector loop in a region allows for changing the VF as we
traverse region boundaries.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D113182
2021-11-20 17:59:48 +00:00
Sanjay Patel
337948ac6e [InstCombine] add folds for binop with sexted bool and constant operands
This is a generalization/extension of the existing and/or
folds noted with TODO comments. Those have a one-use
constraint that is not necessary.

Potential follow-ups are noted by the TODO comments in
the new function. We can also call this function from
other binop visit* functions, but we need to add tests
first.

This solves:
https://llvm.org/PR52543

https://alive2.llvm.org/ce/z/NWuCR5
2021-11-20 12:33:00 -05:00
Sanjay Patel
1d007d0e5a [InstCombine] add tests for bitwise logic with bool op; NFC 2021-11-20 12:32:55 -05:00
Arthur O'Dwyer
401b76fdf2 [libc++] [test] Eliminate libcpp-no-noexcept-function-type and libcpp-no-structured-bindings.
At this point, every supported compiler that claims a -std=c++17 mode
should also support these features.

Differential Revision: https://reviews.llvm.org/D113436
2021-11-20 11:44:57 -05:00
Arnab Dutta
ec7b0d4d34 [MLIR] Simplify Semi-affine expressions by rule based matching and replacing "expr - q * (expr floordiv q)" with "expr mod q" expression.
Add rule based matching for detecting and transforming "expr - q * (expr floordiv q)"
to "expr mod q", where q is a symbolic exxpression, in simplifyAdd function.

Reviewed By: bondhugula, dcaballe

Differential Revision: https://reviews.llvm.org/D112985
2021-11-20 21:05:36 +05:30
Joseph Huber
fbfe8fcbc3 [Libomptarget] Remove undefined symbol in old runtime
A function with no definition was left in the old runtime, causing
linker errors when trying to compile.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D114264
2021-11-20 08:26:57 -05:00
Dimitry Andric
7dbbb5d3a4 compiler-rt: Use FreeBSD's elf_aux_info to detect AArch64 HW features
Using the out-of-line LSE atomics helpers for AArch64 on FreeBSD also
requires adding support for initializing __aarch64_have_lse_atomics
correctly. On Linux this is done with getauxval(3), on FreeBSD with
elf_aux_info(3), which has a slightly different interface.

Differential Revision: https://reviews.llvm.org/D109330
2021-11-20 12:12:03 +01:00
Roman Lebedev
da47a63e03
[NFC][X86][Costmodel] Add AVX512DQ runlines to trunc.ll/extend.ll 2021-11-20 13:55:13 +03:00
Roman Lebedev
2f364f6f0d
[NFC][X86][MCA] Add forgotten test coverage for AVX512's VPMOVM2[BWDQ] / VPMOV[BWDQ]2M 2021-11-20 13:09:18 +03:00
Arnab Dutta
1f9ca5adba [MLIR] Avoid creation of buggy affine maps while replacing dimension and symbol
Initially before appending the newly composed dimension and symbols
to the dimension and symbol list whose size is to be passed in
AffineMap::get(), the call to the AffineMap::get() was made, resulting
in wrong dimCount and symbolCount being passed as argument. We move the
call to the AffineMap::get() after the diimension and symbol list are
updated.

Differential Revision: https://reviews.llvm.org/D114237
2021-11-20 12:01:29 +05:30
Craig Topper
a4373f6753 [X86] Don't combine (x86cmp (trunc (movmsk (bitcast X))), 0) if the truncate discards unknown bits.
We have transform that tries turn a pmovmskb into movmskps/pd or
movmskps to movmskpd. This transform isn't valid if the truncate
discarded bits that might be set by the original movmsk.

We could fix this by inserting an AND after the new movmsk to discard
the equivalent of the truncated bits, but I've left that for later
patch.

Fixes PR52567.

Differential Revision: https://reviews.llvm.org/D114306
2021-11-19 21:50:35 -08:00
Craig Topper
1cb991e754 [X86] Add test case for pr52567. NFC 2021-11-19 21:45:23 -08:00
Lang Hames
0dec59305a [ORC] Make JITDylib::AsynchronousSymbolQuerySet private.
This type does not need to be public
2021-11-19 21:15:18 -08:00
Kazu Hirata
d1abf481da [llvm] Use range-based for loops (NFC) 2021-11-19 21:12:13 -08:00
RamNalamothu
18f9351223 [AMDGPU] Do not generate ELF symbols for the local branch target labels
The compiler was generating symbols in the final code object for local
branch target labels. This bloats the code object, slows down the loader,
and is only used to simplify disassembly.

Use '--symbolize-operands' with llvm-objdump to improve readability of the
branch target operands in disassembly.

Fixes: SWDEV-312223

Reviewed By: scott.linder

Differential Revision: https://reviews.llvm.org/D114273
2021-11-20 10:32:41 +05:30
Lang Hames
43f5f6916f [ORC][JITLink] Move JITDylib name into JITLinkDylib base class.
This will enable better error messages and debug logs in JITLink.
2021-11-19 20:54:28 -08:00
ksyx
97b9e8438e [GVN][NFC] Remove redundant check
The if-check above deleted part guarantees that StoreOffset <= LoadOffset
and that StoreOffset + StoreSize >= LoadOffset + LoadSize, and given that
LoadOffset + LoadSize > LoadOffset when LoadSize > 0. Thus, this shows
StoreOffset + StoreSize > LoadOffset is guaranteed given LoadSize > 0,
while it could be meaningless to have a type with nonpositive size, so that
the check could be removed. The values are converted to signed types to
avoid unsigned operation with negative offsets.

Part of revision D100179
Reapply commit c35e8185d8 with fixing problem
reported by mstorsjo
2021-11-19 20:24:36 -05:00
Nathan Lanza
1bd4dc4f28 [hmaptool] Port to python3
This is just a few trivial changes -- change the interpreter and fix a
few byte-vs-string issues.

Differential Revision: https://reviews.llvm.org/D107944
2021-11-19 19:25:31 -05:00
James Nagurne
241df03ce5 [NFC] Test commit, add whitespace to end-of-line 2021-11-19 18:22:00 -06:00
Sam McCall
f764a1a5bd [clangd] Avoid possible crash: apply configuration after binding methods
The configuration may kick off indexing, which may involve sending LSP
messages.
The crash is fiddly to reproduce in a hermetic test (we need background
indexing on without disk storage, and to handle server->client messages
in LSPClient...)

Fixes https://github.com/clangd/clangd/issues/926
2021-11-20 01:13:38 +01:00
Ellis Hoag
de11de308b [InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment
The `llvm.instrprof.increment` intrinsic uses `i32` for the index. We should use this same type for the index into the GEP instructions.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D114268
2021-11-19 15:45:14 -08:00
Krzysztof Drewniak
a6f53afbcb [MLIR][GPU] Link in device libraries during HSA compilation if needed
To perform some operations, such as sin() or printf(), code compiled
for AMD GPUs must be linked to a series of device libraries. This
commit adds support for linking in these libraries.

However, since these device libraries are delivered as LLVM bitcode,
raising the possibility of version incompatibilities, this commit only
links in libraries when the functions from those libraries are called
by the code being compiled.

This code also sets the math flags to their most conservative values,
as MLIR doesn't have a `-ffast-math` equivalent.

Depends on D114114

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D114117
2021-11-19 22:29:37 +00:00
Quinn Pham
3f3bee42d2 [NFC][llvm] Inclusive language: remove instance of master from Thumb2SizeReduction.cpp
[NFC] As part of using inclusive language within the llvm project, this patch
replaces master with main in `Thumb2SizeReduction.cpp`.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D114196
2021-11-19 16:07:58 -06:00
rdzhabarov
d729f4c38f [mlir] Bug fix. Stream must outlive the pass manager.
Bug fix. Stream must outlive the pass manager.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D114277
2021-11-19 21:45:43 +00:00
Wei Wang
a075d67222 [Sema] fix nondeterminism in ASTContext::getDeducedTemplateSpecializationType
`DeducedTemplateSpecializationTypes` is a `llvm::FoldingSet<DeducedTemplateSpecializationType>` [1],
where `FoldingSetNodeID` is based on the values: {`TemplateName`, `QualType`, `IsDeducedAsDependent`},
those values are also used as `DeducedTemplateSpecializationType` constructor arguments.

A `FoldingSetNodeID` created by the static `DeducedTemplateSpecializationType::Profile` may not be equal
to`FoldingSetNodeID` created by a member `DeducedTemplateSpecializationType::Profile` of an instance
created with the same {`TemplateName`, `QualType`, `IsDeducedAsDependent`}, which makes
`DeducedTemplateSpecializationTypes` lookups nondeterministic.

Specifically, while `IsDeducedAsDependent` value is passes to the constructor, `IsDependent()` method on
the created instance may return a different value, because `IsDependent` is not saved as is:
```name=clang/include/clang/AST/Type.h
  DeducedTemplateSpecializationType(TemplateName Template,  QualType DeducedAsType, bool IsDeducedAsDependent)
      : DeducedType(DeducedTemplateSpecialization, DeducedAsType,
                    toTypeDependence(Template.getDependence()) | // <~  also considers `TemplateName` parameter
                        (IsDeducedAsDependent ? TypeDependence::DependentInstantiation : TypeDependence::None)),
```
For example, if an instance A with key `FoldingSetNodeID {A, B, false}` is inserted. Then a key
`FoldingSetNodeID {A, B, true}` is probed:
If it happens to correspond to the same bucket in `FoldingSet` as the first key, and `A.Profile()` returns
`FoldingSetNodeID {A, B, true}`, then it's a hit.
If the bucket for the second key is different from the first key, instance A is not considered at all, and it's
a no hit, even if `A.Profile()` returns  `FoldingSetNodeID {A, B, true}`.

Since `TemplateName`, `QualType` parameter values involve memory pointers, the lookup result depend on allocator,
and may differ from run to run. When this is used as part of modules compilation, it may result in "module out of date"
errors, if imported modules are built on different machines.

This makes `ASTContext::getDeducedTemplateSpecializationType` consider `Template.isDependent()` similar
`DeducedTemplateSpecializationType` constructor.

Tested on a very big codebase, by running modules compilations from directories with varied path length
(seem to affect allocator seed).

1. https://llvm.org/docs/ProgrammersManual.html#llvm-adt-foldingset-h

Patch by Wei Wang and Igor Sugak!

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D112481
2021-11-19 13:22:07 -08:00
Sanjay Patel
491efa7f31 [InstCombine] add/adjust tests for mask of sext i1; NFC
These are sibling transforms, but the test coverage was
uneven and incomplete.
2021-11-19 16:07:18 -05:00
Stefan Pintilie
e9d12c2480 [PowerPC][NFC] Add a series of codegen tests for vector reductions.
This patch only adds tests for PowerPC. The purpose of these tests
is to track what code is generated for various vector reductions.

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D113801
2021-11-19 15:03:01 -06:00
Louis Dionne
e059329b83 [libc++][NFC] Add missing include in test 2021-11-19 16:01:55 -05:00