Commit Graph

415911 Commits

Author SHA1 Message Date
Nathan James c34d898183
[ASTMatchers] Expand isInline matcher to VarDecl
Add support to the `isInline` matcher for C++17's inline variables.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D118900
2022-02-23 08:34:00 +00:00
Chuanqi Xu f85a6a8127 [NFC] Add unittest for Decl::isInExportDeclContext 2022-02-23 16:29:42 +08:00
Stanislav Gatev 7ea103de14 [clang][dataflow] Add support for global storage values
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: ymandel, xazax.hun

Differential Revision: https://reviews.llvm.org/D120149
2022-02-23 08:27:58 +00:00
LLVM GN Syncbot ef9a659631 [gn build] Port a2fab82f33 2022-02-23 08:21:48 +00:00
Haojian Wu a2fab82f33 [pseudo] Implement LRTable.
This patch introduces a dense implementation of the LR parsing table, which is
used by LR parsers.

We build a SLR(1) parsing table from the LR(0) graph.

Statistics of the LR parsing table on the C++ spec grammar:
  - number of states: 1449
  - number of actions: 83069
  - size of the table (bytes): 334928

Differential Revision: https://reviews.llvm.org/D118196
2022-02-23 09:21:34 +01:00
Lian Wang 3497124771 [RISCV] Add more test for GORCI aliaes in Zbp extension
Supplement tests for some aliaes of gorci.

RV32:
add orc4.h/orc2.h in rv32zbp.ll
add orc.h/orc16/orc8/orc4/orc2/orc in rv32zbp-intrinsic.ll

RV64:
add orc4.h/orc2.h in rv64zbp.ll
add orc.h/orc32/orc16/orc8/orc4/orc2/orc/orc16.w/orc8.w/
    orc4.w/orc2.w/orc.w in rv64zbp-intrinsic.ll

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D120388
2022-02-23 08:02:33 +00:00
Valentin Clement b3d1f073de
[flang] Lower real constant
This patch handles lowering of real constant.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-02-23 08:27:54 +01:00
Lian Wang 7abcb7ba87 [RISCV] Supplement more tests for GREVI aliaes in Zbp extension
Supplement tests for some aliaes of grevi.

RV32:
add rev4.h/rev2.h in rv32zbp.ll
add rev/rev2/rev4/rev8/rev16 in rv32zbp-intrinsic.ll

RV64:
add rev4.h/rev2.h in rv64zbp.ll
add rev.h/rev/rev2/rev4/rev8/rev16/rev32/rev.w/rev2.w/
    rev4.w/rev8.w/rev16.w in rv64zbp-intrinsic.ll

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D120304
2022-02-23 06:15:52 +00:00
minglotus-6 f415d74d1d [SampleProfile] Handle the case when the option `MaxNumPromotions` is zero.
In places where `MaxNumPromotions` is used to allocated an array, bail out early to prevent allocating an array of length 0.

Differential Revision: https://reviews.llvm.org/D120295
2022-02-22 21:44:32 -08:00
Fangrui Song b96fc4860f [ELF][test] Fix CU address_size in some gdb-index tests
Revert 251640ab57 which fixed the wrong thing.

While here, add `2>&1 | count 0` to assert no warning from lib/DebugInfo/DWARF.
2022-02-22 21:42:15 -08:00
Fangrui Song 045f07b7dc [ProfileData] Remove unused and racy FunctionSamples::Format after D51643
The write may be racy if ThinLTO creates multiple `InProcessThinBackend` instances.
2022-02-22 20:29:08 -08:00
Alex Lorenz f5153d9e72 [compiler-rt][builtins] build the macOS compiler-rt built-ins with Mac Catalyst support
This patch extends compiler-rt's cmake config to build macOS builtins with both macOS and Mac Catalyst support.
This is done by telling the compiler to emit macho files with two build version load commands.

Differential Revision: https://reviews.llvm.org/D118875
2022-02-22 19:32:19 -08:00
Fangrui Song 251640ab57 [ELF][test] Terminate .debug_info with a null entry to fix warnings 2022-02-22 19:20:56 -08:00
Arthur Eubanks 36e335eeb5 [clang] Remove Address::deprecated() calls in CodeGenFunction.cpp 2022-02-22 18:28:49 -08:00
Joseph Huber 6a0b78af91 [OpenMP] Remove static allocator in linker wrapper
Summary:
We don't need this static allocator to survive the entire file, the
strings stored have a defined lifetime.
2022-02-22 21:22:19 -05:00
Joseph Huber 55cb84d9fb [OpenMP] Unrecognized objects should not be considered failure
Summary:
This patch removes the error we recieve when attempting to extract
offloading sections. We shouldn't consider this a failure because
extracting bitcode isn't necessarily required.
2022-02-22 21:22:18 -05:00
David Blaikie 2172b1758d Remove redundant word word in AsmParser DIFlag parsing 2022-02-22 17:50:13 -08:00
Philip Reames a9861d3c85 [instcombine] Avoid binops for comparison consistency tests
It turns out that instcombine is smarter than I am, and several of these ended up folded for the wrong reasons.
2022-02-22 17:26:03 -08:00
Amara Emerson b661470bce Revert "Revert "[AArch64][GlobalISel] Optimize conjunctions of compares to conditional compares.""
This reverts commit 55c181a6c7.

The original commit I made was an old patch, mea culpa. Committing the right
implementation with test case for the reported crash.
2022-02-22 17:22:11 -08:00
Arthur Eubanks cde658fa1f [clang] Remove Address::deprecated() calls in CGVTables.cpp 2022-02-22 16:54:28 -08:00
Alina Sbirlea 7fea963a45 [Docs] Add self to credits 2022-02-22 16:43:53 -08:00
Alina Sbirlea ed69e3266c [Docs]Add office hours. 2022-02-22 16:40:01 -08:00
Philip Reames ea31442279 [NFC] Add a bit more coverage for an upcoming patch 2022-02-22 16:36:15 -08:00
Fangrui Song 1ec9dd3aae [sancov] Refactor getPreviousInstructionPc
Note: on some architectures lik AArch64, the PC does not match
compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp:`__sanitizer_cov_trace_pc_guard`
2022-02-22 16:30:02 -08:00
Stanislav Mekhanoshin 939d62c185 [AMDGPU] Pre-commit load/store combine tests. NFC. 2022-02-22 16:28:44 -08:00
Fangrui Song fc0bd3c2ce [libFuzzer] Refactor GetNextInstructionPc/GetPreviousInstructionPc
Port the change to compiler-rt/lib/fuzzer/FuzzerTracePC.cpp .
Update RISCV to use PC-2: this is coarse (C extension may be disabled) but
sufficient for pure symbolization purpose.

The commit is separate from D120362 so that bisecting/reverting is easier.
2022-02-22 16:25:57 -08:00
Aart Bik 8b83b8f131 [mlir][sparse] refactor sparse compiler pipeline to single place
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D120347
2022-02-22 16:23:56 -08:00
Philip Reames 9030d90aeb [instcombine] Add coverage for consistent use of unescaped malloc case 2022-02-22 16:21:56 -08:00
Fangrui Song 3de5322b5f [sanitizer] Refactor GetNextInstructionPc/GetPreviousInstructionPc
x86 uses offset 1 while most RISC architectures use offset 4.
Check x86 first to prevent changes for new RISC architectures.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D120362
2022-02-22 16:20:40 -08:00
Arthur Eubanks 3ef7e6c53c [clang] Remove an Address::deprecated() call in CGClass.cpp 2022-02-22 16:19:06 -08:00
Arthur Eubanks 105ddd0fdc [NFC] Remove dead code (try 2)
This is causing
../../llvm/include/llvm/Object/MachO.h:379:13: warning: private field 'Kind' is not used [-Wunused-private-field]
  FixupKind Kind;

Previous attempt in a23f7c0cb6.
2022-02-22 16:15:01 -08:00
Wouter van Oortmerssen 2368f18eb3 [WebAssembly] Fixed AsmPrinter not emitting .functype for intrinsics
Intrinsics like `memset` were not emitted as `.functype` because
WebAssemblyAsmPrinter::emitExternalDecls explicitly skips symbols
that are isIntrinsic. Removing that check doesn't work, since the symbol
from the module refers to a 4-argument `llvm.memset.p0i8.i32` rather
than the 3-argument `memset` symbol referenced in the call.
Our `WebAssemblyMCLowerPrePass` however does collect the
`memset` symbol, so the current solution is as simple as emitting
`.functype` for those.

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

Differential Revision: https://reviews.llvm.org/D120365
2022-02-22 16:14:26 -08:00
Philip Reames 8b9f42b61b [instcombine] Autogen a test for ease of update 2022-02-22 16:02:27 -08:00
Philip Reames 2cca2c7d18 [instcombine] Extend test coverage for a tricky bit of reasoning about unescaped mallocs 2022-02-22 16:01:39 -08:00
Philip Reames 57a6d92163 [instcombine] Add test coverage for a tricky bit of reasoning about unescaped mallocs 2022-02-22 15:52:42 -08:00
Owen Anderson 4745c994e4 Set std::numeric_limits<>::tinyness_before to true for floating point types on ARM platforms.
Set std::numeric_limits<>::tinyness_before to true for floating point types on ARM platforms.

Section E1.3.5 in the ARMv8 Architecture Reference Manual specifies:
  Underflow. The bit is set to 1 if the absolute value of the result
  of an operation, produced before rounding, is less than the minimum
  positive normalized number for the destination precision, and the
  rounded result is inexact.

Reviewed By: #libc, majnemer, EricWF

Differential Revision: https://reviews.llvm.org/D116338
2022-02-22 15:49:21 -08:00
Rahman Lavaee 029283c1c0 Encode address offsets of basic blocks relative to the end of the previous basic blocks.
Conceptually, the new encoding emits the offsets and sizes as label differences between each two consecutive basic block begin and end label. When decoding, the offsets must be aggregated along with basic block sizes to calculate the final relative-to-function offsets of basic blocks.

This encoding uses smaller values compared to the existing one (offsets relative to function symbol).
Smaller values tend to occupy fewer bytes in ULEB128 encoding. As a result, we get about 25% reduction
in the size of the bb-address-map section (reduction from about 9MB to 7MB).

Reviewed By: tmsriram, jhenderson

Differential Revision: https://reviews.llvm.org/D106421
2022-02-22 15:46:46 -08:00
David Green 774b571546 [AArch64] Alter mull shuffle(ext(..)) combine to work on buildvectors
We have a combine for converting mul(dup(ext(..)), ...) into
mul(ext(dup(..)), ..), for allowing more uses of smull and umull
instructions. Currently it looks for vector insert and shuffle vectors
to detect the element that we can convert to a vector extend. Not all
cases will have a shufflevector/insert element though.

This started by extending the recognition to buildvectors (with elements
that may be individually extended). The new method seems to cover all
the cases that the old method captured though, as the shuffle will
eventually be lowered to buildvectors, so the old method has been
removed to keep the code a little simpler. The new code detects legal
build_vector(ext(a), ext(b), ..), converting them to ext(build_vector(a,
b, ..)) providing all the extends/types match up.

Differential Revision: https://reviews.llvm.org/D120018
2022-02-22 23:37:22 +00:00
Jez Ng 606cb8548a [lld] Require C++14 in LLD standalone build
This is what the Clang standalone build does too. And setting this
seems to be required to get the standalone build to work on my Mac.

Reviewed By: #lld-macho, MaskRay, Ericson2314, smeenai

Differential Revision: https://reviews.llvm.org/D120269
2022-02-22 18:15:29 -05:00
Ben Barham ed4f0cb878 [VFS] Use generic_category for errors generated from the VFS
Errors are generally checked in clients by comparing to the portable
error condition in `std::errc`, which will have the `generic_category`
(eg. `std::errc::no_such_file_or_directory`). While in practice these
are usually equivalent for the standard errno's, they are not in *all*
implementations. One such example is CentOS 7.

Differential Revision: https://reviews.llvm.org/D120299
2022-02-22 15:05:58 -08:00
Nico Weber 2df019ab5a [gn build] bump fmsc-version to 1926
This is needed to pick up the workaround in fb1aa286c1
when building with a modern MSVC (like LLVM now requires).
2022-02-22 17:47:27 -05:00
Brendon Cahoon 3cc15e2cb6 [SLP] Fix assert from non-constant index in insertelement
A call to getInsertIndex() in getTreeCost() is returning None,
which causes an assert because a non-constant index value for
insertelement was not expected. This case occurs when the
insertelement index value is defined with a PHI.

Differential Revision: https://reviews.llvm.org/D120223
2022-02-22 15:57:14 -06:00
Alexey Bataev b3f4535a03 [SLP][NFC]Add a test for bottom to top reordering. 2022-02-22 13:46:34 -08:00
Michael Kruse d7851685a3 [polly] Remove trailing whitespace from tests. NFC. 2022-02-22 15:41:13 -06:00
Okwan Kwon f79f430d4b Fold Tensor.extract_slice into a constant splat.
Fold arith.extract_slice into arith.constant when the source is a constant
splat and the result type is statically shaped.
2022-02-22 21:39:57 +00:00
Alexander Yermolovich 210bb04e23 [BOLT][DWARF] Remove patchLowHigh unused function.
Cleanup after removing caching mechanims for ranges/abbrevs.

Reviewed By: rafauler, yota9

Differential Revision: https://reviews.llvm.org/D120174
2022-02-22 13:28:15 -08:00
Nico Weber 746bd89000 fix comment typo to cycle bots 2022-02-22 16:25:51 -05:00
Björn Schäpers 923c3755ea [clang-format] Don't break semi after requires clause ...
..regardless of the chosen style.

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

Differential Revision: https://reviews.llvm.org/D120278
2022-02-22 22:08:03 +01:00
Björn Schäpers 7ebb00a22e [clang-format][NFC] Simplify if in ContinuationIndenter::addTokenOCL
Setting a boolean within an if and only using it in the very next if is
a bit confusing. Merge it into one if.

Differential Revision: https://reviews.llvm.org/D120237
2022-02-22 22:08:02 +01:00
Reid Kleckner 9b1ae9f67f Revert "Remove dead code."
This reverts commit a23f7c0cb6.

Breaks the build.
2022-02-22 12:56:45 -08:00