Commit Graph

427278 Commits

Author SHA1 Message Date
Kazu Hirata
aa88161b37 [lldb] Use value_or instead of getValueOr (NFC) 2022-06-19 09:12:01 -07:00
Sanjay Patel
0399473de8 [InstCombine] add fold for (ShiftC >> X) <u C
https://alive2.llvm.org/ce/z/RcdzM-

This fixes a regression noted in issue #56046.
2022-06-19 11:03:28 -04:00
Simon Pilgrim
1ebe5cac46 [DAG] SimplifyDemandedBits - add DemandedElts handling to ISD::SIGN_EXTEND_INREG simplification 2022-06-19 15:35:29 +01:00
Simon Pilgrim
db1be696c4 [DAG] SimplifyDemandedBits - add ISD::VSELECT handling 2022-06-19 15:18:25 +01:00
Sanjay Patel
feb4b336ac [InstCombine] add/adjust tests for signbit tests; NFC
Additonal coverage for D127903.
2022-06-19 10:09:56 -04:00
Eric Gullufsen
4b7d51f129 [InstCombine] add baseline tests for signbit cmp folds; NFC
D127903 / issue #55988
2022-06-19 09:03:28 -04:00
Simon Pilgrim
41455dd1dc [X86] Remove isTargetShuffleSplat and just use SelectionDAG::isSplatValue
shuffle(splat(x)) -> splat(x), it doesn't have to be a target specific broadcast
2022-06-19 11:22:57 +01:00
Kazu Hirata
757d9d22cd [lld] Use value_or instead of getValueOr (NFC) 2022-06-19 00:29:41 -07:00
Kazu Hirata
97c87c6f7c [AST] Fix an unused variable warning
This paptch fixes:

  warning: unused variable ‘DD’ [-Wunused-variable]
2022-06-19 00:20:58 -07:00
Kazu Hirata
5dd171dcb5 [clang-tools-extra] Use value_or instead of getValueOr (NFC) 2022-06-19 00:13:38 -07:00
Kazu Hirata
06decd0b41 [clang] Use value_or instead of getValueOr (NFC) 2022-06-18 23:21:34 -07:00
Fangrui Song
57e43ebc42 [Driver][Gnu] Don't passs --dynamic-linker in -r mode
No behavior change as GNU ld/gold/ld.lld ignore --dynamic-linker in -r mode.
This change makes the intention clearer as we already suppress --dynamic-linker
for -shared, -static, and -static-pie.
2022-06-18 23:13:19 -07:00
Kazu Hirata
129b531c9c [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00
Arthur Eubanks
1e556f459b [test][GlobalOpt] Update precommitted test 2022-06-18 21:58:16 -07:00
Arthur Eubanks
9fac606af2 [test][GlobalOpt] Regenerate some tests 2022-06-18 21:34:38 -07:00
Kazushi (Jam) Marukawa
f61f7be0c7 [VE][NFC] Remove obsoleted function declaration 2022-06-19 13:33:46 +09:00
Arthur Eubanks
4a5201f484 [NFC][GlobalOpt] Remove unused parameters 2022-06-18 21:23:39 -07:00
Kazu Hirata
3c49576417 [ADT] Add has_value, value, value_or to llvm::Optional
This patch adds has_value, value, value_or to llvm::Optional so that
llvm::Optional looks more like std::optional.

I will keep the existing functions while migrating their callers and
then remove them later.

Differential Revision: https://reviews.llvm.org/D128131
2022-06-18 21:21:33 -07:00
Kazu Hirata
a5258e5b27 Revert "[MCParser] Use default member initialization (NFC)"
This reverts commit 68090a014c.

The patch seems to cause a build error on ppc64le:

https://lab.llvm.org/buildbot#builders/121/builds/20536
2022-06-18 21:02:09 -07:00
Kazu Hirata
68090a014c [MCParser] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 20:54:56 -07:00
Kazu Hirata
556bcc7821 [ADT] Rename value to val (NFC)
I'd like to introduce functions, such as value, value_or, has_value,
etc to make llvm::Optional look more like std::optional.  Renaming
value to val avoids name conflicts.

Differential Revision: https://reviews.llvm.org/D128125
2022-06-18 20:19:18 -07:00
Tue Ly
2846c2bb4f [libc] Temporary disable environment tests for PATH variable.
This is blocking fullbuild bot.
2022-06-18 23:04:33 -04:00
Tue Ly
c5ca7649e3 [libc][Obvious] Fix c++20-designator warnings for tests that use TmHelper.h. 2022-06-18 22:55:57 -04:00
Arthur Eubanks
213d489707 [test][GlobalOpt] Precommit more tests
And fix up existing tests to not have so much UB.
2022-06-18 19:36:48 -07:00
Ye Luo
54b45afb59 [libomptarget]Add a trap for external omptarget from LLVM
Old LLVM installation may expose its internal omptarget CMake target when being used by find_package(LLVM) and caused issues in the CMake of libomptarget that is being built. Trap the issue early.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D128129
2022-06-18 21:08:53 -05:00
Jacques Pienaar
8df54a6a03 [mlir] Update accessors to prefixed form (NFC)
Follow up from flipping dialects to both, flip accessor used to prefixed
variant ahead to flipping from _Both to _Prefixed. This just flips to
the accessors introduced in the preceding change which are just prefixed
forms of the existing accessor changed from.

Mechanical change using helper script
https://github.com/jpienaar/llvm-project/blob/main/clang-tools-extra/clang-tidy/misc/AddGetterCheck.cpp and clang-format.
2022-06-18 17:53:22 -07:00
Kazu Hirata
c5935af058 [Toolchains] Use llvm::is_contained (NFC) 2022-06-18 15:57:50 -07:00
Kazu Hirata
c399b3a608 [Vectorize] Use llvm::is_contained (NFC) 2022-06-18 15:49:15 -07:00
Kazu Hirata
06dc4028d9 [Support] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 15:46:09 -07:00
Arthur Eubanks
07b9937d0c [test][GlobalOpt] Precommit test 2022-06-18 15:44:27 -07:00
Kazu Hirata
726b2dd040 [IPO] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 15:41:20 -07:00
Brad Smith
6dd094dd43 [Driver][OpenBSD] Use Arch reference instead of getArch(). NFC 2022-06-18 18:11:15 -04:00
Brad Smith
119a13199a [Driver] Pass -X to ld for riscv64-openbsd
Noticing D127826, add support for OpenBSD which uses lld on riscv64.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D128109
2022-06-18 17:58:58 -04:00
Roy Jacobson
21eb1af469 [Concepts] Implement overload resolution for destructors (P0848)
This patch implements a necessary part of P0848, the overload resolution for destructors.
It is now possible to overload destructors based on constraints, and the eligible destructor
will be selected at the end of the class.

The approach this patch takes is to perform the overload resolution in Sema::ActOnFields
and to mark the selected destructor using a new property in FunctionDeclBitfields.

CXXRecordDecl::getDestructor is then modified to use this property to return the correct
destructor.

This closes https://github.com/llvm/llvm-project/issues/45614.

Reviewed By: #clang-language-wg, erichkeane

Differential Revision: https://reviews.llvm.org/D126194
2022-06-19 00:30:37 +03:00
Simon Pilgrim
b911cbdcb9 [X86] Add missing common AVX2 check prefix 2022-06-18 20:24:57 +01:00
Arthur Eubanks
e4406cefa0 [RPOFuncAttrs] Fix norecurse detection
We wanted to check if all uses of the function are direct calls, but the
code didn't account for passing the function as a parameter.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128104
2022-06-18 12:20:10 -07:00
Kazu Hirata
eb15c80c89 [IPO] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 12:17:09 -07:00
Kazu Hirata
47b39c5157 [X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 12:11:58 -07:00
Kazu Hirata
1590d39f2e [X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 12:08:07 -07:00
Kazu Hirata
7c987bb4d9 [X86] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 12:05:34 -07:00
Kazu Hirata
3cbe0bc4a1 [CodeGen] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 12:01:34 -07:00
Huan Nguyen
543f13c99b [BOLT] Allow function entry to be a cold fragment
Allow cold fragment to get new address.

Our previous assumption is that a fragment (.cold) is only reached
through the main fragment of same function. In addition, .cold fragment
must be reached through either (a) direct transfer, or (b) split jump
table. For (a), we perform a simple fix-up. For (b), we currently mark
all relevant fragments as non-simple. Therefore, there is no need to
get new address for .cold fragment.

This is not always the case, as function entry can be rarely executed,
and is placed in .text.cold segment. Essentially we cannot tell which
the source-level function entry is based on hot and cold segments,
so we must treat each fragment a function on its own. Therfore, we
remove the assertion that a function entry cannot be cold fragment.

Test Plan:
```
ninja check-bolt
```

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D128111
2022-06-18 11:39:51 -07:00
Craig Topper
545a71c0d6 [RISCV] Pre-promote v1i1/v2i1/v4i1->i1/i2/i4 bitcasts before type legalization
Type legalization will convert the bitcast into a vector store and
scalar load.

Instead this patch widens the vector to v8i1 with undef, and bitcasts
it to i8. v8i1->i8 has custom handling for type legalization already to
bitcast to a v1i8 vector and use an extract_element.

The code here was lifted from X86's avx512 support.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D128099
2022-06-18 11:06:45 -07:00
Fangrui Song
af6d2a0b68 [docs] Re-generate ClangCommandLineReference.rst 2022-06-18 11:01:54 -07:00
Kazu Hirata
80c12bdb3b [clang] Call *set::insert without checking membership first (NFC) 2022-06-18 10:41:26 -07:00
Kazu Hirata
f8b5be64ab [IPO] Call *set::insert without checking membership first (NFC) 2022-06-18 10:37:04 -07:00
Kazu Hirata
437f960062 [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 10:22:05 -07:00
Kazu Hirata
4271a1ff33 [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 10:17:22 -07:00
Jacques Pienaar
eca86cb2ed [mlir] Start migrating more dialects to prefixed form
Marked all dialects that could be (reasonably) easily flipped to _Both
prefix. Updating the accessors to prefixed form will happen in follow
up, this was to flush out conflicts and to mark all dialects explicitly
as I plan to flip OpBase default to _Prefixed to avoid needing to
migrate new dialects.

Except for Standalone example which got flipped to _Prefixed.

Differential Revision: https://reviews.llvm.org/D128027
2022-06-18 10:10:31 -07:00
Simon Pilgrim
37185ceac9 [Object] Make IsLittleEndian check constexpr to silence static analyzer dead code warnings.
The "ELFT::TargetEndianness == support::little" check is known at compile time
2022-06-18 17:35:54 +01:00