Joseph Huber [Wed, 23 Feb 2022 13:09:53 +0000 (08:09 -0500)]
[Libomptarget][NFC} Fix missing newline in error message
Simon Atanasyan [Wed, 23 Feb 2022 12:53:41 +0000 (15:53 +0300)]
[MIPS] Recognize DT_MIPS_XHASH dynamic table tag
LLVM tools do not emit `DT_MIPS_XHASH` dynamic table tag. But now
`llvm-objdump` and `llvm-readelf` recognize this tag and print it.
Fixes https://github.com/llvm/llvm-project/issues/53996
Anton Afanasyev [Wed, 23 Feb 2022 12:55:06 +0000 (15:55 +0300)]
Revert "[AggressiveInstCombine] Add `phi` nodes support to `TruncInstCombine`"
This reverts commit
f84d732f8c1737940afab71824134f41f37a048b.
Breakage of "sanitizer-x86_64-linux-fast"
Tim Northover [Wed, 23 Feb 2022 11:49:43 +0000 (11:49 +0000)]
AArch64: clamp UBFX high-bit to 32-bits
We were producing invalid instructions like "ubfx w0, w0, #20, #16".
Sven van Haastregt [Wed, 23 Feb 2022 12:22:09 +0000 (12:22 +0000)]
[OpenCL] Align subgroup builtin guards
Until now, subgroup builtins are available with `opencl-c.h` when at
least one of `cl_intel_subgroups`, `cl_khr_subgroups`, or
`__opencl_c_subgroups` is defined. With `-fdeclare-opencl-builtins`,
subgroup builtins are conditionalized on `cl_khr_subgroups` only.
Align `-fdeclare-opencl-builtins` to `opencl-c.h` by introducing the
internal `__opencl_subgroup_builtins` macro.
Differential Revision: https://reviews.llvm.org/D120254
Nikita Popov [Wed, 23 Feb 2022 12:16:01 +0000 (13:16 +0100)]
[InstCombine] Remove unused visitUDivOperand() argument (NFC)
This function only works on the RHS operand.
Balazs Benics [Wed, 23 Feb 2022 11:55:31 +0000 (12:55 +0100)]
Revert "Revert "[analyzer] Fix taint rule of fgets and setproctitle_init""
This reverts commit
2acead35c1289d2b3593a992b0639ca6427e481f.
Let's try `REQUIRES: asserts`.
Balazs Benics [Wed, 23 Feb 2022 11:53:07 +0000 (12:53 +0100)]
Revert "Revert "[analyzer] Fix taint propagation by remembering to the location context""
This reverts commit
d16c5f4192c30d53468a472c6820163a81192825.
Let's try `REQUIRES: asserts`.
Dawid Jurczak [Tue, 22 Feb 2022 11:46:56 +0000 (12:46 +0100)]
[NFC][Lexer] Make access to LangOpts more consistent
Before this change without any good reason Lexer::LangOpts is sometimes accessed by getter and another time read directly in Lexer functions.
Since getLangOpts is a bit more verbose prefer direct access to LangOpts member when possible.
Differential Revision: https://reviews.llvm.org/D120333
Nikita Popov [Wed, 23 Feb 2022 11:40:31 +0000 (12:40 +0100)]
[ValueTracking] Support signed intrinsic clamp
This is the same special logic we apply for SPF signed clamps
when computing the number of sign bits, just for intrinsics.
This just uses the same logic as the select case, but there's
multiple directions this could be improved in: We could also use
the num sign bits from the clamped value, we could do this during
constant range calculation, and there's probably unsigned analogues
for the constant range case at least.
Nikita Popov [Wed, 23 Feb 2022 11:21:42 +0000 (12:21 +0100)]
[InstCombine] Add tests for add of clamp pattern (NFC)
Add intrinsic versions of existing SPF tests.
iains [Tue, 22 Feb 2022 20:58:26 +0000 (20:58 +0000)]
[C++20][Modules] Rework testcase to use split file [NFC].
This switches the testcase committed for initial C++20 modules import tracking to
use split-file rather than preprocessor directives.
Differential Revision: https://reviews.llvm.org/D120352
Alex Bradbury [Wed, 23 Feb 2022 11:05:46 +0000 (11:05 +0000)]
[RISCV] Avoid infinite loop between DAGCombiner::visitMUL and RISCVISelLowering::transformAddImmMulImm
See https://github.com/llvm/llvm-project/issues/53831 for a full discussion.
The basic issue is that DAGCombiner::visitMUL and
RISCVISelLowering;:transformAddImmMullImm get stuck in a loop, as the
current checks in transformAddImmMulImm aren't sufficient to avoid all
cases where DAGCombiner::isMulAddWithConstProfitable might trigger a
transformation. This patch makes transformAddImmMulImm bail out if C0
(the constant used for multiplication) has more than one use.
Differential Revision: https://reviews.llvm.org/D120332
Anton Afanasyev [Wed, 15 Sep 2021 06:19:53 +0000 (09:19 +0300)]
[AggressiveInstCombine] Add `phi` nodes support to `TruncInstCombine`
Expand `TruncInstCombine` to handle loops by adding `phi` nodes
to expression graph.
Reviewed by: RKSimon, lebedev.ri
Differential Revision: https://reviews.llvm.org/D109817
Nikita Popov [Wed, 23 Feb 2022 10:56:34 +0000 (11:56 +0100)]
[InstCombine] Fold sub of umin to usub.sat
We were handling sub of umax, but not the conjugated umin case.
https://alive2.llvm.org/ce/z/4fdZfy
https://alive2.llvm.org/ce/z/BhUQBM
Nikita Popov [Wed, 23 Feb 2022 10:49:18 +0000 (11:49 +0100)]
[InstCombine] Add tests for sub of umin intrinsic (NFC)
We should be converting these into usub.sat.
Valery Pykhtin [Tue, 22 Feb 2022 07:36:26 +0000 (10:36 +0300)]
[ArgPromotion] Regenerate test checks for crash.ll – restored ALL_OLDPM prefix,
add –allow-unused-prefixes.
This test has two runs that differ in what functions are left after the inliner,
for example: barney exists on OLDPM path but don’t exist on NEWPM path.
I restored prefixes this test had had after automatic checks were introduced
for this test.
For now there are no checks left for ALL_NEWPM path, but the behavior seem to
change over time so I added –allow-unused-prefixes to ease following check updates.
Renamed %tmp => %temp IR values to avoid update warning.
Differential revision: https://reviews.llvm.org/D120207
Stanislav Gatev [Wed, 23 Feb 2022 10:32:17 +0000 (10:32 +0000)]
Revert "[clang][dataflow] Add support for global storage values"
This reverts commit
7ea103de140b59a64fc884fa90afd2213619384d.
Iain Sandoe [Sat, 12 Feb 2022 13:43:32 +0000 (13:43 +0000)]
[Modules] Add module structure output to -module-file-info.
It is useful to be able to visualise the C++20 modules content of a PCM file
both for inspection and for testing. In particular, when adding more module
types to support C++20 Partitions and Header Units, we would like to be able
to confirm that the output PCM has the intended structure.
The existing scheme for dumping data is restricted to the content of the AST
file control block, which does not include structural data beyond imports.
The change here makes use of the AST unit that is set up by BeginSourceFile
to query for the information on the primary and sub-modules. We can then
inspect each of these in turn, accounting for Global, Private, Imported and
Exported modules/fragments and then showing the sub-stucture of the main
module(s).
The disadvantage of this mechanism is that it has no easy method to control
the granularity of the output. Perhaps more detailed inspection would be
better handled by a stand-alone module inspection tool.
Differential Revision: https://reviews.llvm.org/D119823
LLVM GN Syncbot [Wed, 23 Feb 2022 10:12:15 +0000 (10:12 +0000)]
[gn build] Port
25d7b4fb446b
Simon Pilgrim [Wed, 23 Feb 2022 10:09:40 +0000 (10:09 +0000)]
[clang] CIndex.cpp - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointers are used immediately, so assert the cast is correct instead of returning nullptr
Andrzej Warzynski [Thu, 17 Feb 2022 13:32:32 +0000 (13:32 +0000)]
[flang][driver] Make `flang-new` always generate run-time type info
Currently, the driver generates the tables with "run-time type
information for derived types" only when specific actions are run.
However, the corresponding data might be required by the subsequent
compilation stages (e.g. lowering, code-gen) and should be generated
unconditionally. Note that this is only possible once the semantic
checks have been run.
Note that when generating these tables, extra semantic errors might be
generated. The driver will always report these and in most cases such
semantic errors will cause the driver to exit immediately. The only
exception are actions inheriting from `PrescanAndSemaDebugAction`.
Currently, there's only one such action: `DebugDumpAllAction`
(corresponds to `-fdebug-dump-all` command-line flag). I've updated the
comments for this action to clarify this.
This change will mostly affect lowering, which currently is only
available for most basic examples (e.g. empty programs). I wasn't able
to find a working case that would demonstrate the new behaviour. I
hope that this change is straightforward enough and am submitting it
without a test.
Differential Revision: https://reviews.llvm.org/D120051
Alexey Lapshin [Tue, 22 Feb 2022 19:56:22 +0000 (22:56 +0300)]
[objcopy][NFC] Rename files to avoid clashing of archive members.
libtool uses file names to name members of an static library.
Files, located in different directories and having matching name,
would have the same name inside an archive. This is not a problem
for ld, but may be a problem for ar. This patch renames files
from ObjCopy library to avoid names clashing.
See https://reviews.llvm.org/D88827#3335814
Differential Revision: https://reviews.llvm.org/D120345
Adrian Kuegel [Wed, 23 Feb 2022 09:52:24 +0000 (10:52 +0100)]
[mlir][Bazel] Fix wrong dependency for GPUBaseIncGen.
Anton Afanasyev [Wed, 15 Sep 2021 06:18:51 +0000 (09:18 +0300)]
[Test][AggressiveInstCombine] Add test for `phi` instruction
Balazs Benics [Wed, 23 Feb 2022 09:37:03 +0000 (10:37 +0100)]
Revert "Revert "[analyzer] Add failing test case demonstrating buggy taint propagation""
This reverts commit
b8ae323cca61dc1edcd36e9ae18c7e4c3d76d52e.
Let's try `REQUIRES: asserts`.
Simon Moll [Wed, 23 Feb 2022 09:07:50 +0000 (10:07 +0100)]
[VE][NFC] Move functions to VVP module
Separate vector isel functions to the module they belong to. Keep scalar
stuff and calls into vector isel in the VEISelLowering.
serge-sans-paille [Sat, 19 Feb 2022 23:03:20 +0000 (00:03 +0100)]
Cleanup llvm/DebugInfo/PDB headers
accumulated preprocessed size:
before:
1065515095
after:
1065629059
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120195
Bill Wendling [Wed, 23 Feb 2022 09:26:53 +0000 (01:26 -0800)]
[NFC] Add #include for constants
Bill Wendling [Wed, 23 Feb 2022 09:23:21 +0000 (01:23 -0800)]
[NFC] Add #include for constants
Tobias Hieta [Tue, 22 Feb 2022 08:52:09 +0000 (09:52 +0100)]
[compiler-rt][builtins] Fix CMake builtin target flag
clang-cl doesn't support -target <target>, instead it only supports
--target=<target> so building a RUNTIME configuration for clang-cl
ended up in never building builtins. Which in turn lead to clang-cl
not being able to find the runtime libraries because we depend
on the compiler_rt.builtins.lib being in the runtime dir for the
Driver to add it as a candidate.
I don't think this should have any downsides since most the code
these days are using --target=<target> instead of the old syntax.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D120308
Bill Wendling [Wed, 23 Feb 2022 09:20:48 +0000 (01:20 -0800)]
[NFC] Remove unnecessary "#include"s from header files
David Green [Wed, 23 Feb 2022 08:55:54 +0000 (08:55 +0000)]
[ARM] Recognize SSAT and USAT from SMIN/SMAX
We have some recognition of SSAT and USAT from SELECT_CC at the moment.
This extends the matching to SMIN/SMAX which can help catch more cases,
either from min/max being the canonical form in instcombine or from some
expanded nodes like fp_to_si_sat.
Differential Revision: https://reviews.llvm.org/D119819
Nikita Popov [Tue, 22 Feb 2022 16:53:14 +0000 (17:53 +0100)]
[InstCombine] Remove one-use limitation from X-Y==0 fold
This one-use limitation is artificial, we do not increase
instruction count if we perform the fold with multiple uses. The
motivating case is shown in @sub_eq_zero_select, where the one-use
limitation causes us to miss a subsequent select fold.
I believe the backend is pretty good about reusing flag-producing
subs for cmps with same operands, so I think doing this is fine.
Differential Revision: https://reviews.llvm.org/D120337
Nathan James [Wed, 23 Feb 2022 08:35:30 +0000 (08:35 +0000)]
[clang-tidy][NFC] Remove Tristate from CachedGlobList
The tristate is a little redundant as we can determine if the item was already in the cache based on the return from try_emplace.
Reviewed By: salman-javed-nz
Differential Revision: https://reviews.llvm.org/D120196
Nathan James [Wed, 23 Feb 2022 08:33:58 +0000 (08:33 +0000)]
[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
Chuanqi Xu [Wed, 23 Feb 2022 08:22:55 +0000 (16:22 +0800)]
[NFC] Add unittest for Decl::isInExportDeclContext
Stanislav Gatev [Fri, 18 Feb 2022 18:51:42 +0000 (18:51 +0000)]
[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
LLVM GN Syncbot [Wed, 23 Feb 2022 08:21:48 +0000 (08:21 +0000)]
[gn build] Port
a2fab82f33bb
Haojian Wu [Fri, 11 Feb 2022 13:09:15 +0000 (14:09 +0100)]
[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
Lian Wang [Wed, 23 Feb 2022 08:01:51 +0000 (08:01 +0000)]
[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
Valentin Clement [Wed, 23 Feb 2022 07:27:10 +0000 (08:27 +0100)]
[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>
Lian Wang [Wed, 23 Feb 2022 06:14:58 +0000 (06:14 +0000)]
[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
minglotus-6 [Tue, 22 Feb 2022 03:17:06 +0000 (19:17 -0800)]
[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
Fangrui Song [Wed, 23 Feb 2022 05:42:15 +0000 (21:42 -0800)]
[ELF][test] Fix CU address_size in some gdb-index tests
Revert
251640ab575634256de6d6fde5c5359fe21efe91 which fixed the wrong thing.
While here, add `2>&1 | count 0` to assert no warning from lib/DebugInfo/DWARF.
Fangrui Song [Wed, 23 Feb 2022 04:29:08 +0000 (20:29 -0800)]
[ProfileData] Remove unused and racy FunctionSamples::Format after D51643
The write may be racy if ThinLTO creates multiple `InProcessThinBackend` instances.
Alex Lorenz [Mon, 14 Feb 2022 22:20:28 +0000 (14:20 -0800)]
[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
Fangrui Song [Wed, 23 Feb 2022 03:20:55 +0000 (19:20 -0800)]
[ELF][test] Terminate .debug_info with a null entry to fix warnings
Arthur Eubanks [Wed, 23 Feb 2022 02:28:32 +0000 (18:28 -0800)]
[clang] Remove Address::deprecated() calls in CodeGenFunction.cpp
Joseph Huber [Wed, 23 Feb 2022 02:21:33 +0000 (21:21 -0500)]
[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.
Joseph Huber [Wed, 23 Feb 2022 02:13:03 +0000 (21:13 -0500)]
[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.
David Blaikie [Wed, 23 Feb 2022 01:49:38 +0000 (17:49 -0800)]
Remove redundant word word in AsmParser DIFlag parsing
Philip Reames [Wed, 23 Feb 2022 01:25:06 +0000 (17:25 -0800)]
[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.
Amara Emerson [Wed, 23 Feb 2022 00:33:18 +0000 (16:33 -0800)]
Revert "Revert "[AArch64][GlobalISel] Optimize conjunctions of compares to conditional compares.""
This reverts commit
55c181a6c786cfbfa8b7aabe0a8ba721a65b1445.
The original commit I made was an old patch, mea culpa. Committing the right
implementation with test case for the reported crash.
Arthur Eubanks [Wed, 23 Feb 2022 00:54:09 +0000 (16:54 -0800)]
[clang] Remove Address::deprecated() calls in CGVTables.cpp
Alina Sbirlea [Wed, 23 Feb 2022 00:43:33 +0000 (16:43 -0800)]
[Docs] Add self to credits
Alina Sbirlea [Wed, 23 Feb 2022 00:38:57 +0000 (16:38 -0800)]
[Docs]Add office hours.
Philip Reames [Wed, 23 Feb 2022 00:36:08 +0000 (16:36 -0800)]
[NFC] Add a bit more coverage for an upcoming patch
Fangrui Song [Wed, 23 Feb 2022 00:30:02 +0000 (16:30 -0800)]
[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`
Stanislav Mekhanoshin [Wed, 23 Feb 2022 00:20:09 +0000 (16:20 -0800)]
[AMDGPU] Pre-commit load/store combine tests. NFC.
Fangrui Song [Wed, 23 Feb 2022 00:25:57 +0000 (16:25 -0800)]
[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.
Aart Bik [Tue, 22 Feb 2022 20:21:07 +0000 (12:21 -0800)]
[mlir][sparse] refactor sparse compiler pipeline to single place
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D120347
Philip Reames [Wed, 23 Feb 2022 00:18:39 +0000 (16:18 -0800)]
[instcombine] Add coverage for consistent use of unescaped malloc case
Fangrui Song [Wed, 23 Feb 2022 00:20:40 +0000 (16:20 -0800)]
[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
Arthur Eubanks [Wed, 23 Feb 2022 00:19:06 +0000 (16:19 -0800)]
[clang] Remove an Address::deprecated() call in CGClass.cpp
Arthur Eubanks [Wed, 23 Feb 2022 00:11:49 +0000 (16:11 -0800)]
[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
a23f7c0cb6b42a06bc9707fdf46ce2a90080f61f.
Wouter van Oortmerssen [Tue, 22 Feb 2022 23:45:49 +0000 (15:45 -0800)]
[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
Philip Reames [Wed, 23 Feb 2022 00:02:27 +0000 (16:02 -0800)]
[instcombine] Autogen a test for ease of update
Philip Reames [Wed, 23 Feb 2022 00:01:39 +0000 (16:01 -0800)]
[instcombine] Extend test coverage for a tricky bit of reasoning about unescaped mallocs
Philip Reames [Tue, 22 Feb 2022 23:52:10 +0000 (15:52 -0800)]
[instcombine] Add test coverage for a tricky bit of reasoning about unescaped mallocs
Owen Anderson [Tue, 28 Dec 2021 19:44:49 +0000 (11:44 -0800)]
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
Rahman Lavaee [Tue, 22 Feb 2022 22:39:08 +0000 (14:39 -0800)]
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
David Green [Tue, 22 Feb 2022 23:37:22 +0000 (23:37 +0000)]
[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
Jez Ng [Tue, 22 Feb 2022 23:14:47 +0000 (18:14 -0500)]
[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
Ben Barham [Tue, 22 Feb 2022 05:13:38 +0000 (21:13 -0800)]
[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
Nico Weber [Tue, 22 Feb 2022 22:47:26 +0000 (17:47 -0500)]
[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).
Brendon Cahoon [Mon, 21 Feb 2022 00:18:26 +0000 (18:18 -0600)]
[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
Alexey Bataev [Tue, 22 Feb 2022 21:46:02 +0000 (13:46 -0800)]
[SLP][NFC]Add a test for bottom to top reordering.
Michael Kruse [Tue, 22 Feb 2022 21:37:50 +0000 (15:37 -0600)]
[polly] Remove trailing whitespace from tests. NFC.
Okwan Kwon [Fri, 18 Feb 2022 18:07:36 +0000 (18:07 +0000)]
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.
Alexander Yermolovich [Tue, 22 Feb 2022 21:26:38 +0000 (13:26 -0800)]
[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
Nico Weber [Tue, 22 Feb 2022 21:25:51 +0000 (16:25 -0500)]
fix comment typo to cycle bots
Björn Schäpers [Mon, 21 Feb 2022 21:03:55 +0000 (22:03 +0100)]
[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
Björn Schäpers [Sun, 2 Jan 2022 20:53:02 +0000 (21:53 +0100)]
[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
Reid Kleckner [Tue, 22 Feb 2022 20:56:45 +0000 (12:56 -0800)]
Revert "Remove dead code."
This reverts commit
a23f7c0cb6b42a06bc9707fdf46ce2a90080f61f.
Breaks the build.
Adrian Prantl [Tue, 22 Feb 2022 20:47:39 +0000 (12:47 -0800)]
Disable test on big endian machines. Yaml2obj has problems there.
Adrian Prantl [Tue, 22 Feb 2022 20:47:29 +0000 (12:47 -0800)]
Remove dead code.
Dmitry Vassiliev [Tue, 22 Feb 2022 20:11:20 +0000 (00:11 +0400)]
[Transforms] Enhance CorrelatedValuePropagation to handle both values of select
The "Correlated Value Propagation" pass was missing a case when handling select instructions. It was only handling the "false" constant value, while in NVPTX the select may have the condition (and thus the branches) inverted, for example:
```
loop:
%phi = phi i32* [ %sel, %loop ], [ %x, %entry ]
%f = tail call i32* @f(i32* %phi)
%cmp1 = icmp ne i32* %f, %y
%sel = select i1 %cmp1, i32* %f, i32* null
%cmp2 = icmp eq i32* %sel, null
br i1 %cmp2, label %return, label %loop
```
But the select condition can be inverted:
```
%cmp1 = icmp eq i32* %f, %y
%sel = select i1 %cmp1, i32* null, i32* %f
```
The fix is to enhance "Correlated Value Propagation" to handle both branches of the select instruction.
Reviewed By: nikic, lebedev.ri
Differential Revision: https://reviews.llvm.org/D119643
Dmitry Vassiliev [Tue, 22 Feb 2022 20:10:05 +0000 (00:10 +0400)]
[Transforms] Pre-commit test cases for CorrelatedValuePropagation to handle both values of select
This is a pre-commit of test cases relevant for D119643.
CorrelatedValuePropagation should handle inverted select condition, but it does not yet.
Kai Nacke [Tue, 22 Feb 2022 18:54:16 +0000 (13:54 -0500)]
[SystemZ/z/OS] Add va intrinsics for XPLINK
Add support for va intrinsics for the XPLINK ABI.
Only the extended vararg variant, which uses a pointer to next
argument, is supported. The standard variant will build on this.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D120148
Zarko Todorovski [Tue, 22 Feb 2022 19:34:10 +0000 (14:34 -0500)]
[libc++][AIX] Add AIX error message as expected output
AIX's libc generates "Error -1 occurred" instead of the "Unknown Error"
expected by these test cases. Add this as expected output for AIX only.
Reviewed By: daltenty, #powerpc, #libc, zibi, Quuxplusone
Differential Revision: https://reviews.llvm.org/D119982
Rainer Orth [Tue, 22 Feb 2022 19:18:22 +0000 (20:18 +0100)]
[sanitizer_common] Use GetStaticTlsBoundary on Solaris 11.4
This is a restricted alternative to D91605
<https://reviews.llvm.org/D91605> which only works on Solaris 11.4 SRU 10+,
but would break the build on Solaris 11.3 and Illumos which lack
`dlpi_tls_modid`.
Apart from that, the patch is trivial. One caveat is that the
`sanitizer_common` and `asan` tests need to be linked explicitly with `ld
-z relax=transtls` on Solaris/amd64 since the archives with calls to
`__tls_get_addr` are linked in directly.
Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D120048
Rainer Orth [Tue, 22 Feb 2022 19:14:33 +0000 (20:14 +0100)]
[Driver] Support Solaris/amd64 GetTls
This is the driver part of D91605 <https://reviews.llvm.org/D91605>, a
workaround to allow direct calls to `__tls_get_addr` on Solaris/amd64.
Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D119829
Adrian Prantl [Thu, 11 Nov 2021 00:25:26 +0000 (16:25 -0800)]
Add support for chained fixup load commands to MachOObjectFile
This is part of a series of patches to upstream support for Mach-O chained fixups.
This patch adds support for parsing the chained fixup load command and
parsing the chained fixups header. It also puts into place the
abstract interface that will be used to iterate over the fixups.
Differential Revision: https://reviews.llvm.org/D113630
Adrian Prantl [Wed, 10 Nov 2021 00:00:29 +0000 (16:00 -0800)]
Add a (nonfunctional) -dyld_info flag to llvm-objdump.
Darwin otool implements this flag as a one-stop solution for
displaying bind and rebase info. As I am working on upstreaming
chained fixup support this command will be useful to write testcases.
Differential Revision: https://reviews.llvm.org/D113573
Reid Kleckner [Tue, 22 Feb 2022 18:48:25 +0000 (10:48 -0800)]
Reland "[mlir][pdl] NFC re-add NoSideEffect to Result and Results Op"
This reverts commit
9865c3f28aa812364584b55629eef9b52bb1230e.
Looks like our commits raced and Jeff fixed the build issue.
Mogball [Tue, 22 Feb 2022 18:47:07 +0000 (18:47 +0000)]
[mlir][pdl] NFC fix missing include
Reid Kleckner [Tue, 22 Feb 2022 18:46:49 +0000 (10:46 -0800)]
Revert "[mlir][pdl] NFC re-add NoSideEffect to Result and Results Op"
This reverts commit
63eb963e58663541d6feb58f53a1bd4903e3dabf.
Breaks MLIR build.
Reid Kleckner [Tue, 22 Feb 2022 18:31:09 +0000 (10:31 -0800)]
Revert "[AArch64] Alter mull shuffle(ext(..)) combine to work on buildvectors"
This reverts commit
9fc1a0dcb79afb31470751651c30e843c12e9ca5.
We have bisected a compiler crash to this revision and will provide a
test case soon.
Mogball [Tue, 22 Feb 2022 18:26:52 +0000 (18:26 +0000)]
[mlir][pdl] NFC re-add NoSideEffect to Result and Results Op