Sanjay Patel [Wed, 27 Nov 2019 18:33:11 +0000 (13:33 -0500)]
[x86] make SLM extract vector element more expensive than default
I'm not sure what the effect of this change will be on all of the affected
tests or a larger benchmark, but it fixes the horizontal add/sub problems
noted here:
https://reviews.llvm.org/D59710?vs=227972&id=228095&whitespace=ignore-most#toc
The costs are based on reciprocal throughput numbers in Agner's tables for
PEXTR*; these appear to be very slow ops on Silvermont.
This is a small step towards the larger motivation discussed in PR43605:
https://bugs.llvm.org/show_bug.cgi?id=43605
Also, it seems likely that insert/extract is the source of perf regressions on
other CPUs (up to 30%) that were cited as part of the reason to revert D59710,
so maybe we'll extend the table-based approach to other subtargets.
Differential Revision: https://reviews.llvm.org/D70607
Gabor Horvath [Wed, 27 Nov 2019 18:56:36 +0000 (10:56 -0800)]
[clang-tidy] Fix PR35824
Differential Revision: https://reviews.llvm.org/D46027
Roman Lebedev [Wed, 27 Nov 2019 14:07:06 +0000 (17:07 +0300)]
[clang][CodeGen] Implicit Conversion Sanitizer: handle increment/decrement (PR44054)(take 2)
Summary:
Implicit Conversion Sanitizer is *almost* feature complete.
There aren't *that* much unsanitized things left,
two major ones are increment/decrement (this patch) and bit fields.
As it was discussed in
[[ https://bugs.llvm.org/show_bug.cgi?id=39519 | PR39519 ]],
unlike `CompoundAssignOperator` (which is promoted internally),
or `BinaryOperator` (for which we always have promotion/demotion in AST)
or parts of `UnaryOperator` (we have promotion/demotion but only for
certain operations), for inc/dec, clang omits promotion/demotion
altogether, under as-if rule.
This is technically correct: https://rise4fun.com/Alive/zPgD
As it can be seen in `InstCombineCasts.cpp` `canEvaluateTruncated()`,
`add`/`sub`/`mul`/`and`/`or`/`xor` operators can all arbitrarily
be extended or truncated:
https://github.com/llvm/llvm-project/blob/
901cd3b3f62d0c700e5d2c3f97eff97d634bec5e/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp#L1320-L1334
But that has serious implications:
1. Since we no longer model implicit casts, do we pessimise
their AST representation and everything that uses it?
2. There is no demotion, so lossy demotion sanitizer does not trigger :]
Now, i'm not going to argue about the first problem here,
but the second one **needs** to be addressed. As it was stated
in the report, this is done intentionally, so changing
this in all modes would be considered a penalization/regression.
Which means, the sanitization-less codegen must not be altered.
It was also suggested to not change the sanitized codegen
to the one with demotion, but i quite strongly believe
that will not be the wise choice here:
1. One will need to re-engineer the check that the inc/dec was lossy
in terms of `@llvm.{u,s}{add,sub}.with.overflow` builtins
2. We will still need to compute the result we would lossily demote.
(i.e. the result of wide `add`ition/`sub`traction)
3. I suspect it would need to be done right here, in sanitization.
Which kinda defeats the point of
using `@llvm.{u,s}{add,sub}.with.overflow` builtins:
we'd have two `add`s with basically the same arguments,
one of which is used for check+error-less codepath and other one
for the error reporting. That seems worse than a single wide op+check.
4. OR, we would need to do that in the compiler-rt handler.
Which means we'll need a whole new handler.
But then what about the `CompoundAssignOperator`,
it would also be applicable for it.
So this also doesn't really seem like the right path to me.
5. At least X86 (but likely others) pessimizes all sub-`i32` operations
(due to partial register stalls), so even if we avoid promotion+demotion,
the computations will //likely// be performed in `i32` anyways.
So i'm not really seeing much benefit of
not doing the straight-forward thing.
While looking into this, i have noticed a few more LLVM middle-end
missed canonicalizations, and filed
[[ https://bugs.llvm.org/show_bug.cgi?id=44100 | PR44100 ]],
[[ https://bugs.llvm.org/show_bug.cgi?id=44102 | PR44102 ]].
Those are not specific to inc/dec, we also have them for
`CompoundAssignOperator`, and it can happen for normal arithmetics, too.
But if we take some other path in the patch, it will not be applicable
here, and we will have most likely played ourselves.
TLDR: front-end should emit canonical, easy-to-optimize yet
un-optimized code. It is middle-end's job to make it optimal.
I'm really hoping reviewers agree with my personal assessment
of the path this patch should take..
This originally landed in
9872ea4ed1de4c49300430e4f1f4dfc110a79ab9
but got immediately reverted in
cbfa237892e55b7129a1178c9b03f26683d643af
because the assertion was faulty. That fault ended up being caused
by the enum - while there will be promotion, both types are unsigned,
with same width. So we still don't need to sanitize non-signed cases.
So far. Maybe the assert will tell us this isn't so.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44054 | PR44054 ]].
Refs. https://github.com/google/sanitizers/issues/940
Reviewers: rjmccall, erichkeane, rsmith, vsk
Reviewed By: erichkeane
Subscribers: mehdi_amini, dexonsmith, cfe-commits, #sanitizers, llvm-commits, aaron.ballman, t.p.northover, efriedma, regehr
Tags: #llvm, #clang, #sanitizers
Differential Revision: https://reviews.llvm.org/D70539
Craig Topper [Wed, 27 Nov 2019 00:57:26 +0000 (16:57 -0800)]
[LegalizeTypes][FPEnv][X86] Add initial support for softening strict fp nodes
This is based on what's required for softening fp128 operations on 32-bit X86 assuming f32/f64/f80 are legal. So there could be some things missing.
Differential Revision: https://reviews.llvm.org/D70654
Taewook Oh [Wed, 27 Nov 2019 18:18:01 +0000 (10:18 -0800)]
[BPI] Improve unreachable/ColdCall heurstics to handle loops.
Summary:
While updatePostDominatedByUnreachable attemps to find basic blocks that are post-domianted by unreachable blocks, it currently cannot handle loops precisely, because it doesn't use the actual post dominator tree analysis but relies on heuristics of visiting basic blocks in post-order. More precisely, when the entire loop is post-dominated by the unreachable block, current algorithm fails to detect the entire loop as post-dominated by the unreachable because when the algorithm reaches to the loop latch it fails to tell all its successors (including the loop header) will "eventually" be post-domianted by the unreachable block, because the algorithm hasn't visited the loop header yet. This makes BPI for the loop latch to assume that loop backedges are taken with 100% of probability. And because of this, block frequency info sometimes marks virtually dead loops (which are post dominated by unreachable blocks) super hot, because 100% backedge-taken probability makes the loop iteration count the max value. updatePostDominatedByColdCall has the exact same problem as well.
To address this problem, this patch makes PostDominatedByUnreachable/PostDominatedByColdCall to be computed with the actual post-dominator tree.
Reviewers: skatkov, chandlerc, manmanren
Reviewed By: skatkov
Subscribers: manmanren, vsk, apilipenko, Carrot, qcolombet, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70104
Peter Collingbourne [Wed, 27 Nov 2019 02:18:14 +0000 (18:18 -0800)]
scudo: Limit the number of bytes tested in a realloc test.
This test was previously effectively doing:
P = malloc(X); write X bytes to P; P = realloc(P, X - Y); P = realloc(P, X)
and expecting that all X bytes stored to P would still be identical after
the final realloc.
This happens to be true for the current scudo implementation of realloc,
but is not guaranteed to be true by the C standard ("Any bytes in the new
object beyond the size of the old object have indeterminate values.").
This implementation detail will change with the new memory tagging support,
which unconditionally zeros newly allocated granules when memory tagging
is enabled. Fix this by limiting the number of bytes that we test to the
minimum size that we realloc the allocation to.
Differential Revision: https://reviews.llvm.org/D70761
Peter Collingbourne [Wed, 27 Nov 2019 17:35:47 +0000 (09:35 -0800)]
scudo: Replace a couple of macros with their expansions.
The macros INLINE and COMPILER_CHECK always expand to the same thing (inline
and static_assert respectively). Both expansions are standards compliant C++
and are used consistently in the rest of LLVM, so let's improve consistency
with the rest of LLVM by replacing them with the expansions.
Differential Revision: https://reviews.llvm.org/D70793
Peter Collingbourne [Wed, 27 Nov 2019 03:17:10 +0000 (19:17 -0800)]
scudo: Call setCurrentTSD(nullptr) when bringing down the TSD registry in tests.
Otherwise, we will hit a use-after-free when testing multiple instances of
the same allocator on the same thread. This only recently became a problem
with D70552 which caused us to run both ScudoCombinedTest.BasicCombined and
ScudoCombinedTest.ReleaseToOS on the unit tests' main thread.
Differential Revision: https://reviews.llvm.org/D70760
Martin Liska [Tue, 26 Nov 2019 09:24:38 +0000 (10:24 +0100)]
Make memory dump same as the one in asan.
Shadow memory (and short granules) are not prepended with memory
address and arrow at the end of line is removed.
Differential Revision: https://reviews.llvm.org/D70707
Kostya Kortchinsky [Mon, 25 Nov 2019 18:28:57 +0000 (10:28 -0800)]
[scudo][standalone] Make tests work on Fuchsia
Summary:
This CL makes unit tests compatible with Fuchsia's zxtest. This
required a few changes here and there, but also unearthed some
incompatibilities that had to be addressed.
A header is introduced to allow to account for the zxtest/gtest
differences, some `#if SCUDO_FUCHSIA` are used to disable incompatible
code (the 32-bit primary, or the exclusive TSD).
It also brought to my attention that I was using
`__scudo_default_options` in different tests, which ended up in a
single binary, and I am not sure how that ever worked. So move
this to the main cpp.
Additionally fully disable the secondary freelist on Fuchsia as we do
not track VMOs for secondary allocations, so no release possible.
With some modifications to Scudo's BUILD.gn in Fuchsia:
```
[==========] 79 tests from 23 test cases ran (10280 ms total).
[ PASSED ] 79 tests
```
Reviewers: mcgrathr, phosek, hctim, pcc, eugenis, cferris
Subscribers: srhines, jfb, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D70682
Gabor Horvath [Wed, 27 Nov 2019 17:08:51 +0000 (09:08 -0800)]
[LifetimeAnalysis] Fix PR44150
References need somewhat special treatment. While copying a gsl::Pointer
will propagate the points-to set, creating an object from a reference
often behaves more like a dereference operation.
Differential Revision: https://reviews.llvm.org/D70755
Fangrui Song [Mon, 25 Nov 2019 19:02:56 +0000 (11:02 -0800)]
[ELF][ARM] Add getPCBias()
ThunkCreator::getThunk and ThunkCreator::normalizeExistingThunk
currently assume that the implicit addends are -8 for ARM and -4 for
Thumb. In D70637, ThunkCreator::getThunk will need to take care of the
relocation addend explicitly.
Add the utility function getPCBias() as a prerequisite so that the getThunk change in D70637
can be more general.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D70690
Mark Murray [Fri, 15 Nov 2019 11:30:15 +0000 (11:30 +0000)]
[ARM][MVE][Intrinsics] Add MVE VAND/VORR/VORN/VEOR/VBIC intrinsics. Add unit tests.
Summary: Add MVE VAND/VORR/VORN/VEOR/VBIC intrinsics. Add unit tests.
Reviewers: simon_tatham, ostannard, dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D70547
Mark Murray [Mon, 25 Nov 2019 14:10:59 +0000 (14:10 +0000)]
[ARM][MVE][Intrinsics] Add MVE VMUL intrinsics. Remove annoying "t1" from VMUL* instructions. Add unit tests.
Summary: Add MVE VMUL intrinsics. Remove annoying "t1" from VMUL* instructions. Add unit tests.
Reviewers: simon_tatham, ostannard, dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D70546
Mark Murray [Wed, 13 Nov 2019 16:57:28 +0000 (16:57 +0000)]
[ARM][MVE][Intrinsics] Add MVE VABD intrinsics. Add unit tests.
Summary: Add MVE VABD intrinsics. Add unit tests.
Reviewers: simon_tatham, ostannard, dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D70545
Sanjay Patel [Wed, 27 Nov 2019 16:11:28 +0000 (11:11 -0500)]
[InstCombine] add tests for copysign; NFC
Jay Foad [Wed, 27 Nov 2019 16:04:15 +0000 (16:04 +0000)]
Remove a comment obsoleted by r227345.
Haojian Wu [Wed, 27 Nov 2019 15:22:16 +0000 (16:22 +0100)]
[clangd] Handle the missing call expr in targetDecl.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: merge_guards_bot, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70773
marshall [Wed, 27 Nov 2019 15:13:00 +0000 (07:13 -0800)]
Optimize and fix basic_string move assignment operator. Reviewed as https://reviews.llvm.org/D68623. Thanks to mvels for the patch.
Alexey Bataev [Thu, 21 Nov 2019 15:00:56 +0000 (10:00 -0500)]
[OPENMP50]Add if clause in parallel for simd directive.
According to OpenMP 5.0, if clause can be used in parallel for simd directive. If condition in the if clause if false, the non-vectorized version of the
loop must be executed.
Hans Wennborg [Wed, 27 Nov 2019 14:47:44 +0000 (15:47 +0100)]
[profile] Fix file contention causing dropped counts on Windows under -fprofile-generate
See PR43425:
https://bugs.llvm.org/show_bug.cgi?id=43425
When writing profile data on Windows we were opening profile file with
exclusive read/write access.
In case we are trying to write to the file from multiple processes
simultaneously, subsequent calls to CreateFileA would return
INVALID_HANDLE_VALUE.
To fix this, I changed to open without exclusive access and then take a
lock.
Patch by Michael Holman!
Differential revision: https://reviews.llvm.org/D70330
Hideto Ueno [Wed, 27 Nov 2019 14:41:12 +0000 (14:41 +0000)]
[Attributor] Handle special case when offset equals zero in nonnull deduction
Roman Lebedev [Wed, 27 Nov 2019 14:02:01 +0000 (17:02 +0300)]
Revert "[clang][CodeGen] Implicit Conversion Sanitizer: handle increment/decrement (PR44054)"
The asssertion that was added does not hold,
breaks on test-suite/MultiSource/Applications/SPASS/analyze.c
Will reduce the testcase and revisit.
This reverts commit
9872ea4ed1de4c49300430e4f1f4dfc110a79ab9,
870f3542d3e0d06d208442bdca6482866b59171b.
David Green [Wed, 27 Nov 2019 11:01:27 +0000 (11:01 +0000)]
[ARM] Replace arm_neon_vqadds with sadd_sat
This replaces the A32 NEON vqadds, vqaddu, vqsubs and vqsubu intrinsics
with the target independent sadd_sat, uadd_sat, ssub_sat and usub_sat.
This helps generate vqadds from standard IR nodes, which might be
produced from the vectoriser. The old variants are removed in the
process.
Differential Revision: https://reviews.llvm.org/D69350
John Brawn [Wed, 27 Nov 2019 12:57:29 +0000 (12:57 +0000)]
[ARM] Add constrained FP intrinsics test
Currently XFAILed, as there are various things that need fixing.
Differential Revision: https://reviews.llvm.org/D70599
Roman Lebedev [Wed, 27 Nov 2019 13:05:02 +0000 (16:05 +0300)]
[CodeGen][UBSan] Relax newly-added verbose sanitization tests for inc/dec
In particular, don't hardcode the signature of the handler:
it takes src filepath so the length of buffers will not match,
Anastasia Stulova [Wed, 27 Nov 2019 11:03:11 +0000 (11:03 +0000)]
[OpenCL] Move addr space deduction to Sema.
In order to simplify implementation we are moving add space
deduction into Sema while constructing variable declaration
and on template instantiation. Pointee are deduced to generic
addr space during creation of types.
This commit also
- fixed addr space dedution for auto type;
- factors out in a separate helper function OpenCL specific
logic from type diagnostics in var decl.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65744
Sam McCall [Wed, 27 Nov 2019 12:44:06 +0000 (13:44 +0100)]
[Frontend] Clean up some dead code in PrecompiledPreamble. NFC
Roman Lebedev [Wed, 27 Nov 2019 10:04:38 +0000 (13:04 +0300)]
[clang][CodeGen] Implicit Conversion Sanitizer: handle increment/decrement (PR44054)
Summary:
Implicit Conversion Sanitizer is *almost* feature complete.
There aren't *that* much unsanitized things left,
two major ones are increment/decrement (this patch) and bit fields.
As it was discussed in
[[ https://bugs.llvm.org/show_bug.cgi?id=39519 | PR39519 ]],
unlike `CompoundAssignOperator` (which is promoted internally),
or `BinaryOperator` (for which we always have promotion/demotion in AST)
or parts of `UnaryOperator` (we have promotion/demotion but only for
certain operations), for inc/dec, clang omits promotion/demotion
altogether, under as-if rule.
This is technically correct: https://rise4fun.com/Alive/zPgD
As it can be seen in `InstCombineCasts.cpp` `canEvaluateTruncated()`,
`add`/`sub`/`mul`/`and`/`or`/`xor` operators can all arbitrarily
be extended or truncated:
https://github.com/llvm/llvm-project/blob/
901cd3b3f62d0c700e5d2c3f97eff97d634bec5e/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp#L1320-L1334
But that has serious implications:
1. Since we no longer model implicit casts, do we pessimise
their AST representation and everything that uses it?
2. There is no demotion, so lossy demotion sanitizer does not trigger :]
Now, i'm not going to argue about the first problem here,
but the second one **needs** to be addressed. As it was stated
in the report, this is done intentionally, so changing
this in all modes would be considered a penalization/regression.
Which means, the sanitization-less codegen must not be altered.
It was also suggested to not change the sanitized codegen
to the one with demotion, but i quite strongly believe
that will not be the wise choice here:
1. One will need to re-engineer the check that the inc/dec was lossy
in terms of `@llvm.{u,s}{add,sub}.with.overflow` builtins
2. We will still need to compute the result we would lossily demote.
(i.e. the result of wide `add`ition/`sub`traction)
3. I suspect it would need to be done right here, in sanitization.
Which kinda defeats the point of
using `@llvm.{u,s}{add,sub}.with.overflow` builtins:
we'd have two `add`s with basically the same arguments,
one of which is used for check+error-less codepath and other one
for the error reporting. That seems worse than a single wide op+check.
4. OR, we would need to do that in the compiler-rt handler.
Which means we'll need a whole new handler.
But then what about the `CompoundAssignOperator`,
it would also be applicable for it.
So this also doesn't really seem like the right path to me.
5. At least X86 (but likely others) pessimizes all sub-`i32` operations
(due to partial register stalls), so even if we avoid promotion+demotion,
the computations will //likely// be performed in `i32` anyways.
So i'm not really seeing much benefit of
not doing the straight-forward thing.
While looking into this, i have noticed a few more LLVM middle-end
missed canonicalizations, and filed
[[ https://bugs.llvm.org/show_bug.cgi?id=44100 | PR44100 ]],
[[ https://bugs.llvm.org/show_bug.cgi?id=44102 | PR44102 ]].
Those are not specific to inc/dec, we also have them for
`CompoundAssignOperator`, and it can happen for normal arithmetics, too.
But if we take some other path in the patch, it will not be applicable
here, and we will have most likely played ourselves.
TLDR: front-end should emit canonical, easy-to-optimize yet
un-optimized code. It is middle-end's job to make it optimal.
I'm really hoping reviewers agree with my personal assessment
of the path this patch should take..
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44054 | PR44054 ]].
Reviewers: rjmccall, erichkeane, rsmith, vsk
Reviewed By: erichkeane
Subscribers: mehdi_amini, dexonsmith, cfe-commits, #sanitizers, llvm-commits, aaron.ballman, t.p.northover, efriedma, regehr
Tags: #llvm, #clang, #sanitizers
Differential Revision: https://reviews.llvm.org/D70539
AndreyChurbanov [Wed, 27 Nov 2019 12:26:51 +0000 (15:26 +0300)]
[openmp] Fixed nonmonotonic schedule when #threads > #chunks in a loop.
Differential Revision: https://reviews.llvm.org/D70713
LLVM GN Syncbot [Wed, 27 Nov 2019 11:45:24 +0000 (11:45 +0000)]
gn build: Merge
19ac0eaf07e
Sam McCall [Mon, 25 Nov 2019 18:51:07 +0000 (19:51 +0100)]
[clangd] Shutdown cleanly on signals.
Summary:
This avoids leaking PCH files if editors don't use the LSP shutdown protocol.
This is one fix for https://github.com/clangd/clangd/issues/209
(Though I think we should *also* be unlinking the files)
Reviewers: kadircet, jfb
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70684
Tim Northover [Wed, 27 Nov 2019 10:50:16 +0000 (10:50 +0000)]
AArch64: support the Apple NEON syntax for v8.2 crypto instructions.
Very simple change, just adding the extra syntax variant.
Georgii Rymar [Tue, 26 Nov 2019 14:47:34 +0000 (17:47 +0300)]
[llvm-readobj] - Always print "Predecessors" for version definition sections.
This is a follow-up discussed in D70495 thread.
The current logic is unusual for llvm-readobj. It doesn't print predecessors
list when it is empty. This is not good for machine parsers.
D70495 had to add this condition during refactoring to reduce amount of changes,
in tests, because the original code also had a similar logic.
Now seems it is time to get rid of it. This patch does it.
Differential revision: https://reviews.llvm.org/D70717
Raphael Isemann [Wed, 27 Nov 2019 09:27:25 +0000 (10:27 +0100)]
[lldb][NFC] Move TypeSystem RTTI to static variable to remove swift reference
Hans Wennborg [Wed, 27 Nov 2019 08:57:32 +0000 (09:57 +0100)]
clang-format-vs : Fix Unicode formatting
Use UTF-8 for communication with clang-format and convert the
replacements offset/length to characters position/count.
Internally VisualStudio.Text.Editor.IWpfTextView use sequence of Unicode
characters encoded using UTF-16 and use characters position/count for
manipulating text.
Resolved "Error while running clang-format: Specified argument was out
of the range of valid values. Parameter name: replaceSpan".
Patch by empty2fill!
Differential revision: https://reviews.llvm.org/D70633
Raphael Isemann [Wed, 27 Nov 2019 08:46:56 +0000 (09:46 +0100)]
[lldb][NFC] Remove unused CompilerType memory functions
Summary:
All these functions are unused from what I can see. Unless I'm missing something here, this code
can go the way of the Dodo.
Reviewers: labath
Reviewed By: labath
Subscribers: abidh, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70770
Martin Storsjö [Mon, 25 Nov 2019 11:59:08 +0000 (13:59 +0200)]
[llvm-objcopy] [COFF] Fix a typo in a comment. NFC.
Martin Storsjö [Fri, 22 Nov 2019 22:46:24 +0000 (00:46 +0200)]
[MC] Produce proper section relative relocations for COFF in .debug_frame
The third parameter to Streamer.EmitSymbolValue() is "bool
IsSectionRelative = false".
For ELF, these debug sections are mapped to address zero, so a normal,
absolute address relocation works just fine, but COFF needs a section
relative relocation, and COFF is the only target where
needsDwarfSectionOffsetDirective() returns true. This matches how
EmitSymbolValue is called elsewhere in the same source file.
Differential Revision: https://reviews.llvm.org/D70661
Martin Storsjö [Tue, 26 Nov 2019 20:41:40 +0000 (22:41 +0200)]
[X86] [Win64] Avoid truncating large (> 32 bit) stack allocations
This fixes PR44129, which was broken in
a7adc3185b (in 7.0.0
and newer).
Differential Revision: https://reviews.llvm.org/D70741
Martin Storsjö [Wed, 16 Oct 2019 08:41:59 +0000 (11:41 +0300)]
[LLDB] Avoid using InitializeContext for zero-initializing a CONTEXT. NFC.
InitializeContext is useful for allocating a (potentially variable
size) CONTEXT struct in an unaligned byte buffer. In this case, we
already have a fixed size CONTEXT we want to initialize, and we only
used this as a very roundabout way of zero initializing it.
Instead just memset the CONTEXT we have, and set the ContextFlags field
manually.
This matches how it is done in NativeRegisterContextWindows_*.cpp.
This also makes LLDB run successfully in Wine (for a trivial tested
case at least), as Wine hasn't implemented the InitializeContext
function.
Differential Revision: https://reviews.llvm.org/D70742
Raphael Isemann [Wed, 27 Nov 2019 07:09:52 +0000 (08:09 +0100)]
[lldb][NFC] Early exit in DWARFASTParserClang::ParseArrayType
Hans Wennborg [Wed, 27 Nov 2019 08:04:04 +0000 (09:04 +0100)]
Update build_llvm_package.bat to build from the monorepo
czhengsz [Tue, 26 Nov 2019 02:18:32 +0000 (21:18 -0500)]
[PowerPC] [NFC] change PPCLoopPreIncPrep class name after D67088.
Afer https://reviews.llvm.org/D67088, PPCLoopPreIncPrep pass can prepare more instruction forms except pre inc form, like DS/DQ forms.
This patch is a follow-up of https://reviews.llvm.org/D67088 to rename the pass name.
Reviewed by: jsji
Differential Revision: https://reviews.llvm.org/D70371
Eric Christopher [Wed, 27 Nov 2019 04:28:52 +0000 (20:28 -0800)]
Revert "Revert "As a follow-up to my initial mail to llvm-dev here's a first pass at the O1 described there.""
This reapplies:
8ff85ed905a7306977d07a5cd67ab4d5a56fafb4
Original commit message:
As a follow-up to my initial mail to llvm-dev here's a first pass at the O1 described there.
This change doesn't include any change to move from selection dag to fast isel
and that will come with other numbers that should help inform that decision.
There also haven't been any real debuggability studies with this pipeline yet,
this is just the initial start done so that people could see it and we could start
tweaking after.
Test updates: Outside of the newpm tests most of the updates are coming from either
optimization passes not run anymore (and without a compelling argument at the moment)
that were largely used for canonicalization in clang.
Original post:
http://lists.llvm.org/pipermail/llvm-dev/2019-April/131494.html
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65410
This reverts commit
c9ddb02659e3ece7a0d9d6b4dac7ceea4ae46e6d.
Fangrui Song [Wed, 27 Nov 2019 03:52:15 +0000 (19:52 -0800)]
XFAIL a test on Windows
http://45.33.8.238/win/3052/step_6.txt
C:\src\llvm-project\clang\test\Preprocessor\file_test.c:9:11: error: CHECK: expected string not found in input
// CHECK: filename: "/UNLIKELY_PATH/empty{{/|\\\\}}file_test.c"
^
<stdin>:1:1: note: scanning from here
^
<stdin>:1:28: note: possible intended match here
^
Petr Hosek [Tue, 26 Nov 2019 22:56:31 +0000 (14:56 -0800)]
[Fuchsia] Don't fail for unknown architectures
When selecting the set of default sanitizers, don't fail for unknown
architectures. This may be the case e.g. with x86_64-unknown-fuchsia
-m32 target that's used to build the bootloader.
Differential Revision: https://reviews.llvm.org/D70747
Yaxun (Sam) Liu [Tue, 26 Nov 2019 18:13:47 +0000 (13:13 -0500)]
Workaround for EvalInfo ctor for MSVC 2017
Current EvalInfo ctor causes EnableNewConstInterp to be true even though
it is supposed to be false on MSVC 2017. This is because a virtual function
getLangOpts() is called in member initializer lists, whereas on MSVC
member ctors are called before function virtual function pointers are
initialized.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D70729
Craig Topper [Wed, 27 Nov 2019 01:37:51 +0000 (17:37 -0800)]
[LegalizeTypes] Add SoftenFloatOp_Unary to reduce some duplication for softening LRINT/LLRINT/LROUND/LLROUND
Summary: This will be enhanced in a follow up to add strict fp support
Reviewers: efriedma
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70751
Fangrui Song [Wed, 27 Nov 2019 01:27:16 +0000 (17:27 -0800)]
[Preprocessor] Fix backslash tests on Windows after D49466
See http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/29442/steps/test-check-all/logs/stdio
Shoaib Meenai [Wed, 27 Nov 2019 01:17:21 +0000 (17:17 -0800)]
[ELF] Adjust test to work for zlib 1.2.8
The previous data had the same length with compression levels 1 and 6
for zlib 1.2.8. Adjust the test to work for this library version. I've
also tested this with zlib 1.2.7 and zlib 1.2.11.
Jinsong Ji [Wed, 27 Nov 2019 00:30:29 +0000 (00:30 +0000)]
[PowerPC] [NFC] rename PPCLoopPreIncPrep.cpp to PPCLoopInstrFormPrep.cpp after D67088
Summary:
This is NFC code clean work after D67088. In that patch, we extend loop instructions prep for ds/dq form.
This patch only changes the file name PPCLoopPreIncPrep.cpp to PPCLoopInstrFormPrep.cpp for better reviewing of the content change of file PPCLoopInstrFormPrep.cpp.
Reviewers: #powerpc, nemanjai, steven.zhang, shchenz
Reviewed By: #powerpc, shchenz
Subscribers: wuzish, mgorny, hiraditya, kbarton, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70716
Vitaly Buka [Wed, 27 Nov 2019 00:21:07 +0000 (16:21 -0800)]
[CodeMoverUtils] clang-format the test
Vitaly Buka [Wed, 27 Nov 2019 00:18:29 +0000 (16:18 -0800)]
[CodeMoverUtils] Don't dereference nullptr in test
Fangrui Song [Wed, 27 Nov 2019 00:09:22 +0000 (16:09 -0800)]
Fix tests on Windows after D49466
It is tricky to use replace_path_prefix correctly on Windows which uses
backslashes as native path separators. Switch back to the old approach
(startswith is not ideal) to appease build bots for now.
Craig Topper [Tue, 26 Nov 2019 23:39:33 +0000 (15:39 -0800)]
[X86] Add test cases for constrained lrint/llrint/lround/llround to fp128-libcalls-strict. NFC
Fangrui Song [Tue, 26 Nov 2019 23:34:48 +0000 (15:34 -0800)]
[unittest] Fix unittests/Support/Path.cpp after D49466
Dan McGregor [Tue, 26 Nov 2019 22:23:07 +0000 (14:23 -0800)]
Initial implementation of -fmacro-prefix-map and -ffile-prefix-map
GCC 8 implements -fmacro-prefix-map. Like -fdebug-prefix-map, it replaces a string prefix for the __FILE__ macro.
-ffile-prefix-map is the union of -fdebug-prefix-map and -fmacro-prefix-map
Reviewed By: rnk, Lekensteyn, maskray
Differential Revision: https://reviews.llvm.org/D49466
Sanjay Patel [Tue, 26 Nov 2019 22:35:10 +0000 (17:35 -0500)]
[InstSimplify] fold copysign with same args to the arg
This is correct for any value including NaN/inf.
We don't have this fold directly in the backend either,
but x86 manages to get it after converting things to bitops.
Sanjay Patel [Tue, 26 Nov 2019 22:23:30 +0000 (17:23 -0500)]
[InstSimplify] add tests for copysign; NFC
Sanjay Patel [Tue, 26 Nov 2019 21:52:18 +0000 (16:52 -0500)]
[ConstFolding] move tests for copysign; NFC
InstCombine doesn't have any transforms for copysign currently.
Simon Atanasyan [Thu, 21 Nov 2019 22:33:46 +0000 (01:33 +0300)]
[mips] Fix sc, scs, ll, lld instructions expanding
There are a couple of bugs with the sc, scs, ll, lld instructions expanding:
1. On R6 these instruction pack immediate offset into a 9-bit field. Now
if an immediate exceeds 9-bits assembler does not perform expansion and
just rejects such instruction.
2. On 64-bit non-PIC code if an operand is a symbol assembler generates
incorrect sequence of instructions. It uses R_MIPS_HI16 and R_MIPS_LO16
relocations and skips R_MIPS_HIGHEST and R_MIPS_HIGHER ones.
To solve these problems this patch:
- Introduces `mem_simm9_exp` to mark 9-bit memory immediate operands
which require expansion. Probably later all `mem_simm9` operands will be
able to migrate on `mem_simm9_exp` and we rename it to `mem_simm9`.
- Adds new `OPERAND_MEM_SIMM9` operand type and assigns it to the
`mem_simm9_exp`. That allows to know operand size in the `processInstruction`
method and decide whether we need to expand instruction.
- Adds `expandMem9Inst` method to expand instructions with 9-bit memory
immediate operand. This method just load immediate into a "base"
register used by origibal instruction:
sc $2, 256($sp) => addiu $1, $sp, 256
sc $2, 0($1)
- Fix `expandMem16Inst` to support a correct set of relocations for
symbol loading in case of 64-bit non-PIC code.
ll $12, symbol => lui $12, 0
R_MIPS_HIGHEST symbol
daddiu $12, $12, 0
R_MIPS_HIGHER symbol
dsll $12, $12, 16
daddiu $12, $12, 0
R_MIPS_HI16 symbol
dsll $12, $12, 16
ll $12, 0($12)
R_MIPS_LO16 symbol
- Fix `expandMem16Inst` to unify handling of 3 and 4 operands
instructions.
- Delete unused now `MipsTargetStreamer::emitSCWithSymOffset` method.
Task for next patches - implement expanding for other instructions use
`mem_simm9` operand and other `mem_simm##` operands.
Differential Revision: https://reviews.llvm.org/D70648
Craig Topper [Tue, 26 Nov 2019 20:52:17 +0000 (12:52 -0800)]
[LegalizeTypes] Add SoftenFloatRes_Unary and SoftenFloatRes_Binary functions to factor repeated patterns out of many of the SoftenFloatRes_* functions
This has been factored out of D70654 which will add strict FP support to these functions. By making the helpers we avoid repeating even more code.
Differential Revision: https://reviews.llvm.org/D70736
David Tenty [Tue, 26 Nov 2019 20:29:49 +0000 (15:29 -0500)]
[AIX] Disable clang python binding tests
Summary:
The Python ctypes FFI interface is broken on AIX, it cannot properly pass
structures containing arrays ( https://bugs.python.org/issue38628). So
disable the clang python binding tests on AIX till this is resolved.
Reviewers: stevewan, jasonliu, hubert.reinterpretcast, mgorny
Reviewed By: jasonliu, hubert.reinterpretcast
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70675
Craig Topper [Tue, 26 Nov 2019 19:57:45 +0000 (11:57 -0800)]
[LegalizeDAG] Use getOperationAction instead of getStrictFPOperationAction for STRICT_LRINT/LROUND/LLRINT/LLROUND.
Fangrui Song [Tue, 26 Nov 2019 19:20:57 +0000 (11:20 -0800)]
TargetPassConfig: const char * -> const char []
The latter has better codegen in non-optimized builds, which do not run
ipsccp.
Craig Topper [Tue, 26 Nov 2019 18:59:18 +0000 (10:59 -0800)]
[X86] Add strict fp support for operations of X87 instructions
This is the following patch of D68854.
This patch adds basic operations of X87 instructions, including +, -, *, / , fp extensions and fp truncations.
Patch by Chen Liu(LiuChen3)
Differential Revision: https://reviews.llvm.org/D68857
Craig Topper [Tue, 26 Nov 2019 18:32:40 +0000 (10:32 -0800)]
[X86] Pre-commit test modifications for D68857. NFC
Patch by Chen Liu(LiuChen3)
Differential Revision: https://reviews.llvm.org/D70706
Fangrui Song [Fri, 22 Nov 2019 01:05:27 +0000 (17:05 -0800)]
[Object][RISCV][test] Improve DebugInfo/RISCV/relax-debug-frame.ll
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D70578
Fangrui Song [Wed, 20 Nov 2019 18:55:04 +0000 (10:55 -0800)]
[ELF] Add a corrector for case mismatch problems
Reviewed By: grimar, peter.smith
Differential Revision: https://reviews.llvm.org/D70506
Fangrui Song [Wed, 20 Nov 2019 19:16:15 +0000 (11:16 -0800)]
[ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols()
D62381 introduced forEachSymbol(). It seems that many call sites cannot
be parallelized because the body shared some states. Replace
forEachSymbol with iterator_range<filter_iterator<...>> symbols() to
simplify code and improve debuggability (std::function calls take some
frames).
It also allows us to use early return to simplify code added in D69650.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D70505
Alexey Bataev [Tue, 26 Nov 2019 16:37:36 +0000 (11:37 -0500)]
[OPENMP]Remove tab in message, NFC.
Alexey Bataev [Tue, 26 Nov 2019 16:10:58 +0000 (11:10 -0500)]
[OPENMP]Simplify printing of declare variant attribute, NFC.
David Green [Tue, 26 Nov 2019 16:18:58 +0000 (16:18 +0000)]
[ARM] Clean up the load and store code. NFC
Some of these patterns have grown quite organically. I've tried to
organise them a little here, moving all the PatFlags together and giving
them a more consistent naming scheme, to allow some of the later
patterns to be merged into a single multiclass.
Differential Revision: https://reviews.llvm.org/D70178
David Green [Thu, 21 Nov 2019 14:56:37 +0000 (14:56 +0000)]
[Codegen][ARM] Add addressing modes from masked loads and stores
MVE has a basic symmetry between it's normal loads/store operations and
the masked variants. This means that masked loads and stores can use
pre-inc and post-inc addressing modes, just like the standard loads and
stores already do.
To enable that, this patch adds all the relevant infrastructure for
treating masked loads/stores addressing modes in the same way as normal
loads/stores.
This involves:
- Adding an AddressingMode to MaskedLoadStoreSDNode, along with an extra
Offset operand that is added after the PtrBase.
- Extending the IndexedModeActions from 8bits to 16bits to store the
legality of masked operations as well as normal ones. This array is
fairly small, so doubling the size still won't make it very large.
Offset masked loads can then be controlled with
setIndexedMaskedLoadAction, similar to standard loads.
- The same methods that combine to indexed loads, such as
CombineToPostIndexedLoadStore, are adjusted to handle masked loads in
the same way.
- The ARM backend is then adjusted to make use of these indexed masked
loads/stores.
- The X86 backend is adjusted to hopefully be no functional changes.
Differential Revision: https://reviews.llvm.org/D70176
David Green [Thu, 21 Nov 2019 14:06:54 +0000 (14:06 +0000)]
[ARM] Lots of MVE offset masked load and store tests. NFC
stozer [Fri, 22 Nov 2019 16:40:32 +0000 (16:40 +0000)]
[DebugInfo] Disallow fragmenting DIExpressions with shift operators
DIExpressions with shift operators should not be fragmented for the same
reason as arithmetic operators: carry over cannot be expressed from one
fragment to the other, so an invalid result would be produced.
Differential Revision: https://reviews.llvm.org/D70601
jasonliu [Tue, 26 Nov 2019 16:05:26 +0000 (16:05 +0000)]
[XCOFF][AIX] Check linkage on the function, and two fixes for comments
This is a follow up commit to address post-commit comment in D70443
Differential revision: https://reviews.llvm.org/D70443
vpykhtin [Mon, 18 Nov 2019 17:06:48 +0000 (20:06 +0300)]
[AMDGPU] Fix emitIfBreak CF lowering: use temp reg to make register coalescer life easier.
Differential revision: https://reviews.llvm.org/D70405
Alexey Bataev [Mon, 25 Nov 2019 21:25:27 +0000 (16:25 -0500)]
[OPENMP]Fix PR44133: crash on lambda reductions in templates.
Need to perform the instantiation of the combiner/initializer even if
the resulting type is not dependent, if the construct is defined in
templates in some cases.
Michał Górny [Tue, 26 Nov 2019 15:45:43 +0000 (16:45 +0100)]
[lldb] [test] Un-XFAIL lldb-server tests fixed on NetBSD
Alexander Kornienko [Fri, 22 Nov 2019 11:22:40 +0000 (12:22 +0100)]
[clang-tidy] Use range-for for check registration. NFC
Actually, just testing GitHub commit rights.
Luís Marques [Sun, 24 Nov 2019 15:23:29 +0000 (15:23 +0000)]
[LegalizeTypes][RISCV] Soften FCOPYSIGN operand
Summary: Adds support for softening FCOPYSIGN operands.
Adds RISC-V tests that exercise the new softening code.
Reviewers: asb, lenary, efriedma
Reviewed By: efriedma
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70679
Luís Marques [Tue, 26 Nov 2019 14:24:59 +0000 (14:24 +0000)]
[RISCV] Handle fcopysign(f32, f64) and fcopysign(f64, f32)
Summary: Adds tablegen patterns to explicitly handle fcopysign where the
magnitude and sign arguments have different types, due to the sign value casts
being removed the by DAGCombiner. Support for RV32IF follows in a separate
commit. Adds tests for all relevant scenarios except RV32IF.
Reviewers: lenary
Reviewed By: lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70678
Georgii Rymar [Wed, 20 Nov 2019 14:37:56 +0000 (17:37 +0300)]
[llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verdef section.
Currently we have following issues:
1) We have 2 different implementations with a different behaviors for GNU/LLVM styles.
2) Errors are either not handled at all or we call report_fatal_error with not helpfull messages.
3) There is no test coverage even for those errors that are reported.
This patch reimplements parsing of the SHT_GNU_verdef section entries
in a single place, adds a few error messages and test coverage.
Differential revision: https://reviews.llvm.org/D70495
Pavel Labath [Tue, 26 Nov 2019 14:11:16 +0000 (15:11 +0100)]
[lldb] Avoid snprintf in PlatformRemoteDarwinDevice
This quashes a -Wformat-truncation warning.
Sanjay Patel [Tue, 26 Nov 2019 14:07:17 +0000 (09:07 -0500)]
[InferFuncAttributes][Attributor] add tests for 'dereferenceable'; NFC
Pulling a couple of extra tests out of
D64258
before abandoning in favor of
D70714
Raphael Isemann [Tue, 26 Nov 2019 13:23:32 +0000 (14:23 +0100)]
[lldb][NFC] Modernize string handling in DWARFASTParserClang::ParseTypeModifier
Pavel Labath [Tue, 26 Nov 2019 14:00:15 +0000 (15:00 +0100)]
[lldb] Use llvm::format in AppleObjCRuntimeV2.cpp
Crushing a "sprintf" buffer is null warning.
Georgii Rymar [Tue, 26 Nov 2019 12:29:30 +0000 (15:29 +0300)]
[llvm-readobj][test] - Cleanup the many-sections.s test case.
It removes 2 precompiled binaries used which are now
can be crafted with the use of yaml2obj.
Differential revision: https://reviews.llvm.org/D70711
Pavel Labath [Tue, 26 Nov 2019 13:48:47 +0000 (14:48 +0100)]
[lldb] fix a -Wcast-qual warning
Pavel Labath [Tue, 26 Nov 2019 13:47:28 +0000 (14:47 +0100)]
[lldb] remove a superfluous semicolon
Dávid Bolvanský [Tue, 26 Nov 2019 11:13:13 +0000 (12:13 +0100)]
Partially reland "[Diagnostics] Put "deprecated copy" warnings into -Wdeprecated-copy""
But do not enable it under -Wextra until libcxx issue is solved.
Pavel Labath [Thu, 14 Nov 2019 14:31:26 +0000 (15:31 +0100)]
[lldb] remove unsigned Stream::operator<< overloads
Summary:
I recently re-discovered that the unsinged stream operators of the
lldb_private::Stream class have a surprising behavior in that they print
the number in hex. This is all the more confusing because the "signed"
versions of those operators behave normally.
Now that, thanks to Raphael, each Stream class has a llvm::raw_ostream
wrapper, I think we should delete most of our formatting capabilities
and just delegate to that. This patch tests the water by just deleting
the operators with the most surprising behavior.
Most of the code using these operators was printing user_id_t values. It
wasn't fully consistent about prefixing them with "0x", but I've tried
to consistenly print it without that prefix, to make it more obviously
different from pointer values.
Reviewers: teemperor, JDevlieghere, jdoerfert
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70241
Pavel Labath [Mon, 25 Nov 2019 13:33:25 +0000 (14:33 +0100)]
[lldb/symbolvendorelf] Copy more sections from separate debug files
Include the fancier DWARF5 sections too.
Raphael Isemann [Tue, 26 Nov 2019 13:17:06 +0000 (14:17 +0100)]
[lldb][NFC] Remove no longer unused variable in DWARFASTParserClang::ParseTypeFromDWARF
Georgii Rymar [Tue, 26 Nov 2019 13:01:47 +0000 (16:01 +0300)]
[yaml2obj] - Fix BB after «[yaml2obj] - Teach tool to describe SHT_GNU_verdef section with a "Content" property.»
Fixed a temporary file name.
BB: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/669
Raphael Isemann [Tue, 26 Nov 2019 13:01:10 +0000 (14:01 +0100)]
[lldb][NFC] Simplify structure parsing code in DWARFASTParserClang::ParseTypeFromDWARF
This way it looks more like the code around it. The assert is also gone as it just
checks that the variables we declare directly above were not initialized by anyone.
That made more sense when this was one large function.
Pavel Labath [Tue, 26 Nov 2019 10:00:23 +0000 (11:00 +0100)]
[lldb] Add boilerplate to recognize the .debug_rnglists.dwo section
Raphael Isemann [Tue, 26 Nov 2019 12:42:16 +0000 (13:42 +0100)]
[lldb][NFC] Extract type modifier parsing from DWARFASTParserClang::ParseTypeFromDWARF
Part of the work to split up this monolithic parsing function.