413948 Commits

Author SHA1 Message Date
Valentin Clement
b880455768
[flang] Remove unused converter for now
AbstractConverter private variable is currently not used
and triggers a buildbot failure.

https://lab.llvm.org/buildbot/#/builders/180/builds/3119

This fixes the buildbot.
2022-02-07 11:56:06 +01:00
Sven van Haastregt
c15782bcf5 [OpenCL] opencl-c.h: make attribute order consistent; NFC
For most builtins, `__purefn` always comes after `__ovld`, but the
read_image functions did not follow this pattern.
2022-02-07 10:54:55 +00:00
Igor Kirillov
4ae885b1e3 [OpenMP] kmp_atomic_float10_max_min.c test should only be executed on x86 platform
Differential Revision: https://reviews.llvm.org/D118988
2022-02-07 10:07:54 +00:00
Dimitry Andric
28fb22c90f [TSan] Handle FreeBSD specific indirection of libpthread functions
Similar to 60cc1d3218fc for NetBSD, add aliases and interceptors for the
following pthread related functions:

- pthread_cond_init(3)
- pthread_cond_destroy(3)
- pthread_cond_signal(3)
- pthread_cond_broadcast(3)
- pthread_cond_wait(3)
- pthread_mutex_init(3)
- pthread_mutex_destroy(3)
- pthread_mutex_lock(3)
- pthread_mutex_trylock(3)
- pthread_mutex_unlock(3)
- pthread_rwlock_init(3)
- pthread_rwlock_destroy(3)
- pthread_rwlock_rdlock(3)
- pthread_rwlock_tryrdlock(3)
- pthread_rwlock_wrlock(3)
- pthread_rwlock_trywrlock(3)
- pthread_rwlock_unlock(3)
- pthread_once(3)
- pthread_sigmask(3)

In FreeBSD's libc, a number of internal aliases of the pthread functions
are invoked, typically with an additional prefixed underscore, e.g.
_pthread_cond_init() and so on.

ThreadSanitizer needs to intercept these aliases too, otherwise some
false positive reports about data races might be produced.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D119034
2022-02-07 11:01:37 +01:00
Simon Pilgrim
74555fd367 [DAG] visitINSERT_VECTOR_ELT - break if-else chain as they both return (style). NFC. 2022-02-07 09:58:47 +00:00
Simon Pilgrim
d7be2bff16 [X86] combineShiftRightArithmetic - break if-else chain as they all return (style). NFC. 2022-02-07 09:54:34 +00:00
Simon Pilgrim
5d3a86489f [GlobalISel] Move getOpcode() calls inside assert() to avoid (void)s. NFC.
Tidier solution to the unused variable warnings - we already do this in other places in this file.
2022-02-07 09:50:27 +00:00
Zi Xuan Wu
a190fcdfcc [CSKY] Add inline asm constraints and related codegen support
There are kinds of inline asm constraints and corresponding register class or register as following.

 'b': mGPRRegClass
 'v': sGPRRegClass
 'w': sFPR32RegClass or sFPR64RegClass
 'c': C register
 'z': R14 register
 'h': HI register
 'l': LO register
 'y': HI or LO register

It also adds codegen test for inline-asm including constraints, clobbers and abi names.
2022-02-07 17:45:37 +08:00
Simon Pilgrim
289b8e0d2f [X86] Add fp80 copysign test coverage
Add PR41749 test coverage
2022-02-07 09:44:01 +00:00
Djordje Todorovic
afd54e1ed1 [SLPVectorizer] Fix "unused variable" build warning 2022-02-07 10:38:19 +01:00
Nikita Popov
8a71854183 [Bitcode] Handle invalid abbrev number error more gracefully
Avoid report_fatal_error(), propagate the error upwards instead.
2022-02-07 10:34:34 +01:00
Nikita Popov
82ef888fbf [Bitcode] Add fuzzer for bitcode reading
Inspired by the discussion on D118694, this adds a straightforward
fuzzer for bitcode reading. Currently it will very quickly run into
OOM, because we do unconditional vector reservations with
user-provided sizes.
2022-02-07 10:24:39 +01:00
Brad Smith
1831cbd9d4 [Driver][OpenBSD] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D119071
2022-02-07 04:07:30 -05:00
Mariya Podchishchaeva
1cee960898 [SYCL] Disallow explicit casts between mismatching address spaces
Reviewed By: bader

Differential Revision: https://reviews.llvm.org/D118935
2022-02-07 11:57:30 +03:00
Djordje Todorovic
def10a2895 [GlobalIsel] Fix another "unused variable" warning 2022-02-07 09:32:22 +01:00
Djordje Todorovic
eab395fa40 Fix the warning after D118805
A variable was used within assert() only.
2022-02-07 09:25:02 +01:00
Valentin Clement
6518c40931
[flang] Add test for quiet with local variable in STOP stmt
Depends on D118978.

Differential Revision: https://reviews.llvm.org/D118982
2022-02-07 09:17:28 +01:00
Valentin Clement
2c2e5a5d0f
[flang] Basic local variable lowering
This patch add lowering for simple local variable.

- The signatures in `ConvertType.h` have been simplified to take advantage of the `AbstractConverter`.
- The lowering make use of the `allocateLocal` from the `FirOpBuilder`.

This lowering is used in patch D118982

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan, jeanPerier, schweitz

Differential Revision: https://reviews.llvm.org/D118978
2022-02-07 09:14:09 +01:00
Luo, Yuanke
24562babdf [X86] Add test cases for fmul/fdiv with select. 2022-02-07 16:10:44 +08:00
Jun Zhang
65adf7c211
[NFC][Analyzer] Use range based for loop.
Use range base loop loop to improve code readability.

Differential Revision: https://reviews.llvm.org/D119103
2022-02-07 15:45:58 +08:00
luxufan
9920943ea2 [JITLink] Fix the incorrect relocation behavior for R_RISCV_BRANCH
In D116573, the relocation behavior of R_RISCV_BRANCH didn't consider that branch instruction like 'bge' has a branch target address which is given as a PC-relative offset, sign-extend and multiplied by 2.
Although the target address is a 12-bits number, acctually its range is [-4096, 4094].

This patch fix it.

Differential Revision: https://reviews.llvm.org/D118151
2022-02-07 14:34:19 +08:00
Kazu Hirata
3a3cb929ab [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
Chuanqi Xu
1391f91b1f [NFC] Precommit test case for PR53357 2022-02-07 12:47:14 +08:00
zhongyunde 00443407
b3b129f11f [DAGCombiner][AArch64] Enhance to support for scalar CSINC
Enhance to fold csel into csinc instruction.
Fix https://github.com/llvm/llvm-project/issues/53071

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D116915
2022-02-07 10:27:48 +08:00
Phoebe Wang
8bb32e5cfe [X86] Add pre-commit test for bit test optimization. NFC 2022-02-07 09:38:55 +08:00
Jacques Pienaar
2204ac2978 [mlir][bazel] Update post ControlFlow dialect split 2022-02-06 17:21:48 -08:00
Kazu Hirata
949f56465b [IR] Use default member initialization in GlobalValue (NFC) 2022-02-06 16:36:29 -08:00
Kazu Hirata
a1a8d10a17 [Transforms] Use default member initialization in LibCallSimplifier (NFC) 2022-02-06 16:36:27 -08:00
Kazu Hirata
3fce5bb7b0 [Transforms] Use default member initialization in LoopVersioning (NFC) 2022-02-06 16:36:25 -08:00
Benjamin Kramer
6635c12ada [mlir] Use SmallBitVector instead of SmallDenseSet for AffineMap::compressSymbols
This is both more efficient and more ergonomic to use, as inverting a
bit vector is trivial while inverting a set is annoying.

Sadly this leaks into a bunch of APIs downstream, so adapt them as well.

This would be NFC, but there is an ordering dependency in MemRefOps's
computeMemRefRankReductionMask. This is now deterministic, previously it
was dependent on SmallDenseSet's unspecified iteration order.

Differential Revision: https://reviews.llvm.org/D119076
2022-02-07 00:21:44 +01:00
River Riddle
330838eb90 [mlir] Fix GpuToLLVM conversion pass after ControlFlow operations were split from Standard 2022-02-06 15:10:03 -08:00
Stella Laurenzo
fe23a6fb75 [mlir] Fixup python bindings after splitting cf ops from std. 2022-02-06 14:51:17 -08:00
River Riddle
ace01605e0 [mlir] Split out a new ControlFlow dialect from Standard
This dialect is intended to model lower level/branch based control-flow constructs. The initial set
of operations are: AssertOp, BranchOp, CondBranchOp, SwitchOp; all split out from the current
standard dialect.

See https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061

Differential Revision: https://reviews.llvm.org/D118966
2022-02-06 14:51:16 -08:00
Eugene Zhulenev
edca177cbe [mlir] Add canonicalizer to remove redundant shape.cstr_broadcastable ops
Depends On D119025

Reviewed By: frgossen

Differential Revision: https://reviews.llvm.org/D119043
2022-02-06 14:46:42 -08:00
Congzhe Cao
1ef04326ec [LoopInterchange] Support loop interchange with floating point reductions
Enabled loop interchange support for floating point reductions
if it is allowed to reorder floating point operations.

Previously when we encouter a floating point PHI node in the
outer loop exit block, we bailed out since we could not detect
floating point reductions in the early days. Now we remove this
limiation since we are able to detect floating point reductions.

Reviewed By: #loopoptwg, Meinersbur

Differential Revision: https://reviews.llvm.org/D117450
2022-02-06 17:04:47 -05:00
Mehdi Amini
0d8850ae2c Remove dead forward declaration (NFC) 2022-02-06 19:48:46 +00:00
Simon Pilgrim
94453952fc [KnownBits] Add support for X*X self-multiplication (update)
Rename the SelfMultiply argument to make it clearer that the argument must not be undef

Differential Revision: https://reviews.llvm.org/D108992
2022-02-06 19:40:08 +00:00
Simon Pilgrim
b93287754b [InstCombine] Add mul(x,x) tests showing miscompile
As raised by @efriedma on D117995 - the source must not be undef to demand any bits in mul(x,x) other than bit[1]

https://alive2.llvm.org/ce/z/Cxkjen
2022-02-06 19:13:16 +00:00
Craig Topper
c35ccd2ac8 [DAGCombiner][RISCV] Allow rotates by non-constant to be matched for i32 on riscv64 with Zbb.
rv64izbb has a RORW/ROLW instructions that operate on the lower
32-bits of a 64-bit value and sign extend bit 31 of the result.

DAGCombiner won't match rotate idioms because the i32 type isn't Legal
on riscv64.

This patch teaches DAGCombiner to allow it if the type is going to
be promoted and the target has Custom type legalization for ISD::ROTL
or ISD::ROTR. I've restricted this to scalar types. It doesn't appear
any in tree targets other than riscv64 have custom type legalization
for rotates.

If this patch isn't acceptable, I guess I can match SRLW, SLLW, and OR
after type legalization, but I'd like to avoid that if possible.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D119062
2022-02-06 10:58:12 -08:00
Kazu Hirata
eb65f971f2 [llvm] Fix header guards (NFC)
Identified with llvm-header-guard.
2022-02-06 10:54:48 -08:00
Kazu Hirata
ee4b6cf538 [Breakpoint] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
2022-02-06 10:54:46 -08:00
Kazu Hirata
3a8c51480f [CodeGen] Use = default (NFC)
Identified with modernize-use-equals-default
2022-02-06 10:54:44 -08:00
Kazu Hirata
631b94cc22 [Driver] Remove redundant string initialization (NFC)
Identified with readability-redundant-string-init.
2022-02-06 10:54:42 -08:00
Jared Irwin
31626cc111 [lld-macho] Add -pagezero_size
Adds `-pagezero_size`. `-pagezero_size` commonly used for kernel development.
`-pagezero_size` changes the `__PAGEZERO` size, removing that segment if it is set to zero.

One of the four flags from {D118570}
Now with error messages and tests.

Differential Revision: https://reviews.llvm.org/D118724
2022-02-06 13:15:16 -05:00
Bjorn Pettersson
cecf11c315 [DAGCombiner] Fold SSHLSAT/USHLSAT to SHL when no saturation will occur
When the shift amount is known and a known sign bit analysis of
the shiftee indicates that no saturation will occur, then we can
replace SSHLSAT/USHLSAT by SHL.

Differential Revision: https://reviews.llvm.org/D118765
2022-02-06 18:59:06 +01:00
Bjorn Pettersson
0f68597605 Pre-commit test cases for DAG combine folds of SSHLSAT/USHLSAT -> SHL
It should be possible to replace SSHLSAT and USHLSAT with SHL when
it is known that no saturation will take place (e.g. by analysing
known sign bits in the first shift operand).

Differential Revision: https://reviews.llvm.org/D118764
2022-02-06 18:59:06 +01:00
Simon Pilgrim
1b27940a11 Revert rG7275de7fb2f087871611d037d1b529b226dd0521 "[AArch64] translateLocChar - silence dead code warning"
Seems to cause some buildbot misbehaviour (+ there's a dumb copy+paste typo in the commit message....)
2022-02-06 17:19:23 +00:00
Simon Pilgrim
1ab7d43bf9 [clang][CodeGen] Add _BitInt test coverage to builtins-elementwise-math.c
As suggested on D117898, we should be testing irregular _BitInt types with the __builtin_elementwise_* intrinsics
2022-02-06 17:17:28 +00:00
Simon Pilgrim
784c78f20f Fix Wdocumentation unknown parameter warning 2022-02-06 16:52:32 +00:00
Florian Hahn
541ca12dcd
[LV] Use VPReplicateRecipe::isUniform instead isUniformAfterVec (NFCI).
In scalarizeInstruction(), isUniformAfterVectorization is used to detect
cases where it is sufficient to always access the first lane. This
should map directly checking whether the operand is a uniform replicate
recipe.

Differential Revision: https://reviews.llvm.org/D116654
2022-02-06 16:37:20 +00:00