Commit Graph

428056 Commits

Author SHA1 Message Date
Brad Smith 066043c84f [Driver][Minix] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D128554
2022-06-25 16:16:38 -04:00
Manoj Gupta da0448a361 Revert "[libc++] Simplify type_traits and use more builtins"
This reverts commit 42f8f55798.

Breaks float128 usage, test case provided in D127226.

Differential Revision: https://reviews.llvm.org/D128587
2022-06-25 12:38:05 -07:00
Fangrui Song 4cb05dc3cb [ELF] Support quoted name in the TARGET command 2022-06-25 12:31:20 -07:00
Fangrui Song 363b29567e [ELF] Support quoted symbol in the ENTRY command
This matches GNU ld and matches other places we unquote the symbol name.

Fixes #56208
2022-06-25 12:19:45 -07:00
Fangrui Song c5578fca16 [ELF][test] Improve linkerscript/entry.s 2022-06-25 12:14:47 -07:00
Philip Reames b61235739f Fix build after ab736a27
This class is templatized by the concrete subclass - not all subclasses have a data layout field called DL.
2022-06-25 12:10:19 -07:00
Fangrui Song e733b80f3c [LiveInterval] Simplify. NFC 2022-06-25 11:59:33 -07:00
Kazu Hirata 3b7c3a654c Revert "Don't use Optional::hasValue (NFC)"
This reverts commit aa8feeefd3.
2022-06-25 11:56:50 -07:00
Kazu Hirata aa8feeefd3 Don't use Optional::hasValue (NFC) 2022-06-25 11:55:57 -07:00
Kazu Hirata b8df4093e4 [clang, clang-tools-extra] Don't use Optional::{hasValue,getValue} (NFC) 2022-06-25 11:55:33 -07:00
Sunho Kim 7d101e43cd [ORC][LLJIT] Define atexit symbol in GenericLLVMIRPlatformSupport.
Define atexit symbol in GenericLLVMIRPlatformSupport so that it doesn't need to be defined by user.

On windows, llvm codegen emits atexit runtime calls to support global deinitializers as there is no lower function like cxa_atexit as in Itanium C++ ABI. ORC JIT user had to define custom atexit symbol manually. This was a hassle as it has to deal with dso_handle and cxa_atexit internals of LLJIT. If client didn't provide atexit definition, the default behaviour is just linking with host atexit function which is destined to fail as it calls dtors when the host program exits. This is after jit instances and buffers are freed, so users would see weird access violation exception from the uknown location. (in console application, the debugger thinks exception happened in scrt_common_main_seh)

This is a hack that has some caveats. (e.g. memory address is not identical) But, it's better than the situation described in the above. Ultimately, we will move on to ORC runtime that is able to solve the memory address issue properly.

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D128037
2022-06-26 03:50:08 +09:00
Philip Reames 9803b0d1e7 [RISCV] Implement getVScaleForTuning and thus prefer scalable vectorization when enabled
LoopVectorizer uses getVScaleForTuning for deciding how to discount the cost of a potential vector factor by the amount of work performed. Without the callback implemented, the vectorizer was defaulting to an estimated vscale of 1. This results in fixed vectorization looking falsely profitable (since it used the command line VLEN).

The test change is pretty limited since a) we don't have much coverage of the vectorizer with scalable vectors at all, and b) what little coverage we have mostly uses i64 element types. There's a separate issue with <vscale x 1 x i64> which prevents us from getting to this stage of costing, and thus only the one test explicitly written to avoid that is visible in the diff. However, this is actually a very wide impact change as it changes the practical vectorization result when both fixed and scalable is enabled to scalable.

As an aside, I think the vectorizer is at little too strongly biased towards scalable when both are legal, but we can explore that separately. For now, let's just get the cost model working the way it was intended.

Differential Revision: https://reviews.llvm.org/D128547
2022-06-25 11:25:23 -07:00
Kazu Hirata d152e50c15 [llvm] Don't use Optional::{hasValue,getValue} (NFC) 2022-06-25 11:24:23 -07:00
Philip Reames ab736a2750 [BasicTTI] Account for vector of pointers in getMemoryOpCost
By using getPrimitiveSizeInBits, we were getting 0 for every pointer type. This code is trying to account for the cost of truncating a store or extending a load to convert from the source vector element type to the legal vector element type.

I'd originally seen this as a crash when trying to scalarize a <vscale x 1 x ptr> type coming from the vectorizer. Here's a minimum reproducer to exercise the code in question.

void e(int *argv[], int *p) {
  for (int i = 0; i < 1024; i++)
    argv[i] = p;
}

This was checked in as the splat_ptr test in 2cf320d. After bbf3fd, this no longer crashes since we correctly return invalid if the extending load/truncating store isn't legal.

Differential Revision: https://reviews.llvm.org/D128228
2022-06-25 11:11:58 -07:00
Philip Reames 767ba58f80 [RISCV] Make getMinRVVVectorSizeInBits and getMaxRVVVectorSizeInBits protected [nfc]
These are now only used in the implementation of getRealMinVLen and getRealMaxVLEn, and useRVVForFixedLengthVectors; make them protected to discourage new users.
2022-06-25 11:11:31 -07:00
Casey Carter c5ba46ea18 [libcxx][test] MaybePOCCAAllocator should meet the Cpp17Allocator requirements
Implement `rebind`, the rebinding constructor, and rebind-compatible comparison operators.

Differential Revision: https://reviews.llvm.org/D118279
2022-06-25 11:02:42 -07:00
Guillaume Chatelet 1baf1fc276 [NFC] Remove dead code 2022-06-25 17:18:45 +00:00
LLVM GN Syncbot 303b214699 [gn build] Port c92056d038 2022-06-25 17:03:46 +00:00
Corentin Jabot c92056d038 [Clang][C++23] P2071 Named universal character escapes
Implements [[ https://wg21.link/p2071r1  | P2071 Named Universal Character Escapes ]] - as an extension in all language mode, the patch  not warn in c++23 mode will be done later once this paper is plenary approved (in July).

We add

 * A code generator that transforms `UnicodeData.txt` and `NameAliases.txt` to a space efficient data structure that can be queried in `O(NameLength)`
 * A set of functions in `Unicode.h` to query that data, including

   * A function to find an exact match of a given Unicode character name
   * A function to perform a loose (ignoring case, space, underscore, medial hyphen) matching
   * A function returning the best matching codepoint for a given string per edit distance

 * Support of `\N{}` escape sequences in String and character Literals, with loose and typos diagnostics/fixits
 * Support of `\N{}` as UCN with loose matching diagnostics/fixits.

Loose matching is considered an error to match closely the semantics of P2071.

The generated data contributes to 280kB of data to the binaries.

`UnicodeData.txt` and `NameAliases.txt`  are not committed to the repository in this patch, and regenerating the data is a manual process.

Reviewed By: tahonermann

Differential Revision: https://reviews.llvm.org/D123064
2022-06-25 19:03:33 +02:00
Kazu Hirata f8c1c9afd3 [mlir] Fix a warning
This patch fixes:

  llvm-project/mlir/lib/Dialect/Linalg/Transforms/SplitReduction.cpp:300:26:
  error: comparison of integers of different signs: 'int64_t' (aka
  'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
2022-06-25 09:18:04 -07:00
Jacques Pienaar 701051a8c2 [mlir][shape] Switch types to ODS generated (NFC)
These were already pretty simple, so just switching to generated.
2022-06-25 09:06:52 -07:00
Matt Arsenault e7bc73739a GlobalISel: Make LoadStoreOpt preserve all
Avoids dropping CSE info analysis
2022-06-25 09:24:54 -04:00
Matt Arsenault 341e03f9f3 X86: Regenerate test checks 2022-06-25 09:24:53 -04:00
Matt Arsenault a397846cb0 CodeGen: Use else if between Value and PseudoSourceValue cases
These are mutually exclusive.
2022-06-25 09:24:25 -04:00
Arjun P 8a7ead691b [MLIR][Presburger] Support computing a representation of a set that only has locals that are divs
This paves the way for integer-exact projection, and for supporting
non-division locals in subtraction, complement, and equality checks.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D127463
2022-06-25 14:23:32 +01:00
Michał Górny 1452e2e5cb Reland "[lldb] [llgs] Support multiprocess in qfThreadInfo"
Now preserving the non-standard behavior of returning "OK" response
when there is no debugged process.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D128152
2022-06-25 15:15:37 +02:00
sstwcw 1f69f7ea9a [clang-format] NFC Sort names of format token types
Suggested by HazardyKnusperkeks in D126845.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D126934
2022-06-25 12:09:49 +00:00
Rainer Orth b4ae67fffa [asan][test] XFAIL global-location-nodebug.cpp on Solaris
A new test `FAIL`s on Solaris:

  FAIL: AddressSanitizer-i386-sunos ::
TestCases/global-location-nodebug.cpp (465 of 64279)
  FAIL: AddressSanitizer-i386-sunos-dynamic ::
TestCases/global-location-nodebug.cpp (961 of 64279)

The problem is the unconditional use of `-Wl,-S`:

  ld: fatal: dlopen() of support library (-lstdc++) failed with error:
ld.so.1: ld: -lstdc++: open failed: No such file or directory

`ld -S` has a completely different semantics compared to GNU `ld
-S`/`--strip-debug`: specify a link-edit support library.  To avoid this,
I've chosen to `XFAIL` the test.

Tested on `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D128516
2022-06-25 10:40:11 +02:00
Michał Górny f609b54e24 Revert "[lldb] [llgs] Support multiprocess in qfThreadInfo"
This reverts part of commit 75757c86c6.
It broke the following test:

  commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py

I need more time to figure it out, so I'm reverting the code changes
and marking the tests depending on them xfail.
2022-06-25 09:46:28 +02:00
Pavel Samolysov 6e3d4712b9 [DeadArgElim] Replace insert with emplace (NFC) 2022-06-25 10:31:27 +03:00
Valentin Clement 575eb2133b
[flang] Use descriptors for real/complex input other than kinds 4 and 8
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, vdonaldson

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-06-25 09:19:34 +02:00
Siva Chandra Reddy 4965cea2f3 [libc] Add compound assignment and pre-increment operators to UInt. 2022-06-25 06:38:24 +00:00
Fangrui Song 262b4091f9 [Driver] Fix -fstrict-flex-arrays= help message after D126864 2022-06-24 22:20:37 -07:00
Fangrui Song 572b08790a [clang] Add back -fsanitize=array-bounds workaround for size-1 array after -fstrict-flex-arrays change
Before C99 introduced flexible array member, common practice uses size-1 array
to emulate FAM, e.g. https://github.com/python/cpython/issues/94250
As a result, -fsanitize=array-bounds instrumentation skipped such structures
as a workaround (from 539e4a77bb).

D126864 accidentally dropped the workaround. Add it back with tests.
2022-06-24 22:15:47 -07:00
Siva Chandra Reddy a83034ef2b [libc][Obvious] Compare values of the same type in memory_utils/backend_test. 2022-06-25 04:50:04 +00:00
Siva Chandra Reddy bcdd9fbf08 [libc][Obvious] Fix incorrect nested namespace name. 2022-06-25 04:47:21 +00:00
Siva Chandra Reddy 66a6c1073a [libc] Add a cacheline size of arm target.
It is set arbitrarily at 32 now. It can be adjusted as required in
future.
2022-06-25 04:42:40 +00:00
Petr Hosek f3caa98e49 Revert "[CMake][compiler-rt] Clean up the use of libcxx and libcxxabi"
This reverts commit 4164cfa537 since
it broke the clang-x86_64-debian-fast builder:

  https://lab.llvm.org/buildbot/#/builders/109/builds/41339
2022-06-25 03:10:55 +00:00
Petr Hosek 4164cfa537 [CMake][compiler-rt] Clean up the use of libcxx and libcxxabi
We no longer support the use of LLVM_ENABLE_PROJECTS for libcxx and
libcxxabi. We don't use paths to libcxx and libcxxabi in compiler-rt.

Differential Revision: https://reviews.llvm.org/D126905
2022-06-25 02:53:43 +00:00
Shao-Ce SUN 529f05cdbb [RISCV][MC] Fold UIMM related code
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D128495
2022-06-25 10:50:50 +08:00
Björn Schäpers b3aeca3962 [clang-format] Further improve requires clause detection
If there is a typeish token before the requires, it can't be a requires
expression.

Fixes https://github.com/llvm/llvm-project/issues/56176

Differential Revision: https://reviews.llvm.org/D128496
2022-06-25 04:43:38 +02:00
Petr Hosek 72ec31afad [CMake] Use set rather than list PREPEND
list PREPEND is only supported since CMake 3.15.

Differential Revision: https://reviews.llvm.org/D128548
2022-06-25 02:19:55 +00:00
Min-Yih Hsu 1f62e245e6 [MCA][unittest] Hot fix for -Wpessimizing-move on test harness
Hot fix for -Wpessimizing-move build errors regarding MCA unit test
harness introduced in 97579dcc6d.
2022-06-24 18:31:27 -07:00
Jonas Devlieghere be265d25ca
[lldb] Add support for specifying a log handler
This patch adds a new flag to `log enable`, allowing the user to specify
a custom log handler. In addition to the default (stream) handler, this
allows using the circular log handler (which logs to a fixed size,
in-memory circular buffer) as well as the system log handler (which logs
to the operating system log).

Differential revision: https://reviews.llvm.org/D128323
2022-06-24 18:24:00 -07:00
Mircea Trofin 7ae92a69c2 [MLInliner] No need to invalidate everything post-inlining.
We really just need to invalidate loop info and the dominator tree, in
addition to the FunctionPropertiesInfo we were invalidating originally.
Doing more adds unnecessary compile time overhead.
2022-06-24 18:22:06 -07:00
LLVM GN Syncbot 73709fe09c [gn build] Port b847692ed8 2022-06-25 01:03:12 +00:00
Nico Weber 012412d192 [gn build] (manually) port 97579dcc6d (LLVMMCATests)
The CMake code makes a number of imho strange choices. I pointed those
out on https://reviews.llvm.org/D127083.

The GN build mirrors the CMake build's choices for now.
2022-06-24 21:02:35 -04:00
lewuathe bd861056a5 [mlir][affine] Rigorous check for loop unrolling store operation
Static loop unrolling does not change the operation type. We can rigorously make sure to use affine.store in the check.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D128237
2022-06-25 09:30:43 +09:00
Fabian Parzefall 96f6ec5090 [BOLT] Mark option values of --split-functions deprecated
The SplitFunctions pass does not distinguish between various splitting
modes anymore. This change updates the command line interface to
reflect this behavior by deprecating values passed to the
--split-function option.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D128558
2022-06-24 17:01:13 -07:00
lewuathe d72d488039 [mlir][quant] output spec verification check for quant.region
We can have validation test for quant.region having incompatible output spec.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D128245
2022-06-25 08:57:44 +09:00