Commit Graph

414124 Commits

Author SHA1 Message Date
Aaron Ballman 22db4824b9 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the third batch of tests being updated (there are a significant
number of other tests left to be updated).
2022-02-07 09:25:01 -05:00
ksyx a70549ae43 [clang-format] Fix DefSeparator empty line issues
- Add or remove empty lines surrounding union blocks.
- Fixes https://github.com/llvm/llvm-project/issues/53229, in which
  keywords like class and struct in a line ending with left brace or
  whose next line is left brace only, will be falsely recognized as
  definition line, causing extra empty lines inserted surrounding blocks
  with no need to be formatted.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D119067
2022-02-07 14:23:21 +00:00
Kim Gräsman d7ddad408f Reformat CastExpr unittest suite; NFC
In preparation for adding new tests. No functional change.
2022-02-07 09:21:41 -05:00
Pavel Labath a53c5c66b3 [lldb/Platform] s/m_name/m_hostname
m_name is confusing, as there is a getter called GetName, but it returns
a completely different thing.
2022-02-07 14:58:55 +01:00
Balázs Kéri 29fc5e0245 [clang-tidy] Fixed a compile warning (NFC).
Fixed a "override" related warning in SharedPtrArrayMismatchCheck.h.
Related to differential revision: https://reviews.llvm.org/D117306
2022-02-07 14:56:27 +01:00
Sanjay Patel 79b3fe8070 [InstCombine] SimplifyDemandedBits - mul(x,x) is odd iff x is odd
https://alive2.llvm.org/ce/z/AXPr3k
2022-02-07 08:43:12 -05:00
Nikita Popov 149195f576 [PPCISelLowering] Avoid use of getPointerElementType()
Use the value type instead.
2022-02-07 14:30:15 +01:00
Bjorn Pettersson acdc419c89 [test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying
pass pipeline in opt.

Differential Revision: https://reviews.llvm.org/D119081
2022-02-07 14:26:59 +01:00
Bjorn Pettersson b280ee1dd7 [test] Use -passes=instsimplify instead of -instsimplify in a number of tests. NFC
Another step moving away from the deprecated syntax of specifying
pass pipeline in opt.

Differential Revision: https://reviews.llvm.org/D119080
2022-02-07 14:26:58 +01:00
Nikita Popov b7767c71c9 [OMPIRBuilder] Avoid use of getPointerElementType()
Looks like I missed this call when removing others in this file.
2022-02-07 14:22:34 +01:00
Roman Lebedev 77a0da926c
[LV] Remove `LoopVectorizationCostModel::useEmulatedMaskMemRefHack()`
D43208 extracted `useEmulatedMaskMemRefHack()` from legality into cost model.
What it essentially does is prevents scalarized vectorization of masked memory operations:
```
  // TODO: Cost model for emulated masked load/store is completely
  // broken. This hack guides the cost model to use an artificially
  // high enough value to practically disable vectorization with such
  // operations, except where previously deployed legality hack allowed
  // using very low cost values. This is to avoid regressions coming simply
  // from moving "masked load/store" check from legality to cost model.
  // Masked Load/Gather emulation was previously never allowed.
  // Limited number of Masked Store/Scatter emulation was allowed.
```

While i don't really understand about what specifically `is completely broken`
was talking about, i believe that at least on X86 with AVX2-or-later,
this is no longer true. (or at least, i would like to know what is still broken).
So i would like to follow suit after D111460, and like wise disable that hack for AVX2+.

But since this was added for X86 specifically, let's just instead completely remove this hack.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D114779
2022-02-07 16:08:31 +03:00
Kadir Cetinkaya f59787084e
[clang][Lexer] Fix tests after ff77071a4d 2022-02-07 14:06:32 +01:00
Simon Pilgrim 2e0409a545 [X86][SSE] Add some initial PAVGB/PAVGW tests
Once D119073 has landed, I'll start addressing these
2022-02-07 12:58:47 +00:00
Florian Hahn ef4df27940
[LV] Modernize some runtime check tests a bit.
Update tests to check runtime checks a bit more precisely.
2022-02-07 12:08:56 +00:00
LLVM GN Syncbot 05a374fa69 [gn build] Port c63522e6ba 2022-02-07 11:59:15 +00:00
Balázs Kéri c63522e6ba [clang-tidy] Add new check 'shared-ptr-array-mismatch'.
Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D117306
2022-02-07 12:57:58 +01:00
Rainer Orth 9576698a3e [DebugInfo][test] XFAIL DebugInfo/Generic/missing-abstract-variable.ll on SPARC
`DebugInfo/Generic/missing-abstract-variable.ll` `FAIL`s on SPARC.  When
`x` is inlined into `a`, the variable `s` is elided completely, so the
corresponding `CHECK`s fail.  Exactly the same happens on RISCV and the
test has already been `XFAIL`ed there.

This patch does the same on SPARC.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D119122
2022-02-07 12:43:56 +01:00
Nikita Popov f4fca0fbb0 [Bitcode] Replace assertion with check 2022-02-07 12:39:35 +01:00
Nikita Popov 747fab903f [Bitcode] Add missing test file
This was supposed to be part of
ec18030f5f.
2022-02-07 12:37:21 +01:00
Nikita Popov fdf8cb978f [Bitcode] Handle invalid data layout gracefully 2022-02-07 12:28:15 +01:00
Valentin Clement a8d48fe0fe
[flang] Handle character constant for error code in STOP stmt
Handle character constant ofr error code in the STOP statement.

Depends on D118992

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

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118993
2022-02-07 12:19:55 +01:00
Valentin Clement 74751f4b0c
[flang] Add lowering for ASCII character constant
Lower character constant of KIND = 1 with the
`createStringLiteral` helper function.

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

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118992
2022-02-07 12:17:41 +01:00
Nikita Popov 0c553bff8e [Bitcode] Guard against out of bounds value reference
We should make sure that the value ID is in bounds, otherwise
we will assert / read out of bounds.
2022-02-07 12:16:13 +01:00
Nikita Popov ec18030f5f [Bitstream] Check that there is enough space for blob
Instead of simply assuming that it will be zero. I double checked
that the bitstream reader doesn't have any special handling for
all-zero blobs, it will always write out the full contents.
2022-02-07 12:16:13 +01:00
Nikita Popov 89017772d9 [Bitcode] Don't assert on invalid attribute group record
Report an error instead.
2022-02-07 12:16:12 +01:00
Nikita Popov 3c86642edd [Bitstream] Reject implausibly large reservations
If we're trying to reserve more memory than bits in the stream,
reject this early to avoid OOM.
2022-02-07 12:16:12 +01:00
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 60cc1d3218 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