Scott Egerton [Thu, 9 Apr 2020 16:51:26 +0000 (17:51 +0100)]
[RISCV] Add Clang frontend support for Bitmanip extension
This adds the __riscv_bitmanip macro and the 'b' target feature to enable it.
Differential Revision: https://reviews.llvm.org/D71553
Simon Cook [Thu, 9 Apr 2020 16:51:16 +0000 (17:51 +0100)]
[RISCV] Support experimental/unratified extensions
This adds support for enabling experimental/unratified RISC-V ISA
extensions in the -march string in the case where an explicit version
number has been declared, and the -menable-experimental-extensions flag
has been provided.
This follows the design as discussed on the mailing lists in the
following RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-January/138364.html
Since the RISC-V toolchain definition currently rejects any extension
with an explicit version number, the parsing logic has been tweaked to
support this, and to allow standard extensions to have their versions
checked in future patches.
The bitmanip 'b' extension has been added as a first use of this support,
it should easily extend to other as yet unratified extensions (such as
the vector 'v' extension).
Differential Revision: https://reviews.llvm.org/D73891
Paolo Savini [Thu, 9 Apr 2020 16:51:10 +0000 (17:51 +0100)]
[RISCV] Add MC layer support for proposed Bit Manipulation extension (version 0.92)
This adds the instruction encoding and mnenomics for the proposed
RISC-V Bit Manipulation extension (version 0.92). It is implemented with
each category of instruction as its own target feature, with the 'b'
extension feature enabling all options. Since this extension is not yet
ratified, all target features are prefixed with 'experimental-' to note
their status.
Differential Revision: https://reviews.llvm.org/D65649
Louis Dionne [Wed, 8 Apr 2020 19:26:31 +0000 (15:26 -0400)]
[libc++/abi] Add scripts for building libc++ and libc++abi on Apple platforms
These scripts allow creating dylibs that are very close to the dylibs
shipped on Apple platforms.
jasonliu [Thu, 9 Apr 2020 15:52:57 +0000 (15:52 +0000)]
[PPC][AIX] Implement variadic function handling in LowerFormalArguments_AIX
Summary:
This patch adds support for handling of variadic functions for AIX.
This includes ensuring that use and consume correct type of
va_list (char *va_list) for AIX.
Authored by: ZarkoCA
Reviewers: cebowleratibm, sfertile, jasonliu
Reviewed by: jasonliu
Differential Revision: https://reviews.llvm.org/D76130
Stefan Pintilie [Thu, 9 Apr 2020 16:17:23 +0000 (11:17 -0500)]
[PowerPC][Future] Initial support for PCRel addressing for constant pool loads
Add initial support for PC Relative addressing for constant pool loads.
This includes adding a new relocation for @pcrel and adding a new PowerPC flag
to identify PC relative addressing.
Differential Revision: https://reviews.llvm.org/D74486
Kazushi (Jam) Marukawa [Thu, 9 Apr 2020 16:08:04 +0000 (18:08 +0200)]
[VE] Support (m)0 and (m)1 operands
Summary:
VE has special operands to represent 0b000...000111...111 (`(m)0`) and
0b111...111000...000 (`(m)1`) bit sequences. This patch supports those
operands not only in machine instructions but also in DAG lowering.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D77769
Craig Topper [Thu, 9 Apr 2020 15:33:51 +0000 (08:33 -0700)]
[X86] Remove redundant VMOVDDUPZ128rmk/VMOVDDUPZ128rmkz isel patterns.
These patterns are identical to the pattern for the instruction.
Gil Rapaport [Mon, 6 Apr 2020 11:02:34 +0000 (14:02 +0300)]
[LV] Add VPValue operands to VPBlendRecipe (NFCI)
InnerLoopVectorizer's code called during VPlan execution still relies on
original IR's def-use relations to decide which vector code to generate,
limiting VPlan transformations ability to modify def-use relations and still
have ILV generate the vector code.
This commit introduces VPValues for VPBlendRecipe to use as the values to
blend. The recipe is generated with VPValues wrapping the phi's incoming values
of the scalar phi. This reduces ingredient def-use usage by ILV as a step
towards full VPlan-based def-use relations.
Differential Revision: https://reviews.llvm.org/D77539
David Truby [Thu, 9 Apr 2020 15:39:18 +0000 (16:39 +0100)]
[flang] Add dependency on libSemantics to libEvaluate.
When building flang with LLVM HEAD, the unittests fail to link with ld.bfd or
ld.gold due to a linker ordering issue. Adding libSemantics as a dependency to
libEvaluate seems to fix that issue.
Reviewed at: https://github.com/flang-compiler/f18/pull/1104
Florian Hahn [Thu, 9 Apr 2020 15:36:51 +0000 (16:36 +0100)]
[SCCP] Add tests with AND/OR branch conditions.
Alexey Bataev [Thu, 9 Apr 2020 15:28:02 +0000 (11:28 -0400)]
[OPENMP]Fix the test to pacify buildbots, NFC.
Mircea Trofin [Wed, 8 Apr 2020 21:54:33 +0000 (14:54 -0700)]
[llvm][nfc] InstructionCostDetail encapsulation
Ensured initialized fields; encapsulad delta calulations and evaluation
of threshold having had changed; assertion for CostThresholdMap
dereference, to indicate design intent.
Differential Revision: https://reviews.llvm.org/D77762
Eric Schweitz [Thu, 9 Apr 2020 15:13:11 +0000 (16:13 +0100)]
[Flang] add flang as a new subproject in cmake
Summary: This patch is some minor prep work for merging the flang(f18) project into the monorepo. This patch adds "flang" as a supported target for the LLVM_ENABLE_PROJECTS option.
Reviewers: fhahn, tstellar, jdoerfert, beanz, DavidTruby
Reviewed By: DavidTruby
Subscribers: hfinkel, DavidTruby, aartbik, mgorny, llvm-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D72416
David Truby [Thu, 9 Apr 2020 15:11:58 +0000 (16:11 +0100)]
[flang] Merge flang-compiler/f18
This is the initial merge of flang-compiler, which is done in this way
principally to preserve the history and git-blame, without generating a large
number of commits on the first-parent history of LLVM.
If you don't care about the flang history during a bisect remember that you can
supply paths to git-bisect, e.g. `git bisect start clang llvm`.
The history of f18 was rewritten to:
* Put the code under /flang/.
* Linearize the history.
* Rewrite commit messages so that issue and PR numbers point to the old repository.
Credit to Peter Waller for writing the flatten and merge script.
Updates: flang-compiler/f18#876 (submission into llvm-project)
Mailing-list: http://lists.llvm.org/pipermail/llvm-dev/2020-January/137989.html ([llvm-dev] Flang landing in the monorepo - next Monday!)
Mailing-list: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137661.html ([llvm-dev] Flang landing in the monorepo)
Co-authored-by: Peter Waller <peter.waller@arm.com>
Andrew Ng [Wed, 8 Apr 2020 19:21:16 +0000 (20:21 +0100)]
[ELF][test] Improve reproduce tests and enable for Windows
This patch changes the reproduce tests so that they no longer extract
the "long" paths of the generated reproduce tar archives. This
extraction prevented them from being run on Windows due to potential
issues relating to the Windows path length limit.
This patch also reduces the use of diff in these tests, as this was
raised as a performance concern in review D77659 and deemed unnecessary.
Differential Revision: https://reviews.llvm.org/D77750
David Truby [Mon, 6 Apr 2020 13:38:50 +0000 (14:38 +0100)]
[flang] Remove flatten and merge upstreaming script.
Original-commit: flang-compiler/f18@
21f3c455e842e0dab4a92db7ed8282f08eac930d
David Truby [Mon, 6 Apr 2020 13:38:20 +0000 (14:38 +0100)]
[flang] Adjust README.md for upstreaming to LLVM.
Original-commit: flang-compiler/f18@
24d23963b879d6586a7e19b89a905341627fe5b1
Ayal Zaks [Mon, 6 Apr 2020 22:53:59 +0000 (01:53 +0300)]
[LV] FoldTail w/o Primary Induction
Introduce a new VPWidenCanonicalIVRecipe to generate a canonical vector
induction for use in fold-tail-with-masking, if a primary induction is absent.
The canonical scalar IV having start = 0 and step = VF*UF, created during code
-gen to control the vector loop, is widened into a canonical vector IV having
start = {<Part*VF, Part*VF+1, ..., Part*VF+VF-1> for 0 <= Part < UF} and
step = <VF*UF, VF*UF, ..., VF*UF>.
Differential Revision: https://reviews.llvm.org/D77635
Kirstóf Umann [Sun, 1 Mar 2020 16:49:44 +0000 (17:49 +0100)]
[analyzer][AnalysisOrderChecker] Display the CallEvent type in preCall/postCall
Exactly what it says on the tin! The included testfile demonstrates why this is
important -- for C++ dynamic memory operators, we don't always recognize custom,
or even standard-specified new/delete operators as CXXAllocatorCall or
CXXDeallocatorCall.
Differential Revision: https://reviews.llvm.org/D77391
Alexey Bataev [Wed, 8 Apr 2020 13:49:10 +0000 (09:49 -0400)]
[OPENMP]Fix capturing of global variables in OpenMP regions.
Summary:
The global variable should be captured in the region only if it was
privitized in the region or in any of the outer regions. Otherwise, it
should not be captured.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77731
Sanjay Patel [Thu, 9 Apr 2020 14:33:27 +0000 (10:33 -0400)]
[InstCombine] remove stale FIXME comment; NFC
Sean Fertile [Fri, 3 Apr 2020 19:18:15 +0000 (15:18 -0400)]
[PowerPC][NFC] Add more check directives in only cxx_fast_tlscc lit test.
Use utils/update_llc_test_checks.py to add full CHECK directives to the
test for cxx_fast_tls calling convention. The calling convention is
arguably dead on PowerPC since dropping Darwin subtarget support in the PowerPC
backend. This test change helps show the atrocious code generation for
this lit test which was hidden by having few CHECK directives.
Kirstóf Umann [Fri, 20 Mar 2020 15:45:53 +0000 (16:45 +0100)]
[analyzer] Display the checker name in the text output
Exactly what it says on the tin! There is no reason I think not to have this.
Also, I added test files for checkers that emit warning under the wrong name.
Differential Revision: https://reviews.llvm.org/D76605
Simon Cook [Thu, 9 Apr 2020 14:11:55 +0000 (15:11 +0100)]
[RISCV] Implement evaluateBranch
This implements the instruction analysis required to print branch
targets as part of llvm-objdump's disassembly.
Note, this only handles those branches which can be analyzed in a single
instruction, a future patch will handle multiple-instruction patterns,
such as AUIPC/LUI+JALR instruction pairs.
Differential Revision: https://reviews.llvm.org/D77567
Nathan James [Mon, 6 Apr 2020 19:08:21 +0000 (20:08 +0100)]
[ASTMatchers] Fixed CastKind being parsed incorrectly for dynamic matchers
Summary: Requires hasCastKind arguments to have `CK_` prefixed to bring it in line with the documentation and other matchers that take enumerations.
Reviewers: klimek, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77503
Balazs Benics [Thu, 9 Apr 2020 14:06:32 +0000 (16:06 +0200)]
[analyzer] NFCi: Refactor CStringChecker: use strongly typed internal API
Summary:
I wanted to extend the diagnostics of the CStringChecker with taintedness.
This requires the CStringChecker to be refactored to support a more flexible
reporting mechanism.
This patch does only refactorings, such:
- eliminates always false parameters (like WarnAboutSize)
- reduces the number of parameters
- makes strong types differentiating *source* and *destination* buffers
(same with size expressions)
- binds the argument expression and the index, making diagnostics accurate
and easy to emit
- removes a bunch of default parameters to make it more readable
- remove random const char* warning message parameters, making clear where
and what is going to be emitted
Note that:
- CheckBufferAccess now checks *only* one buffer, this removed about 100 LOC
code duplication
- not every function was refactored to use the /new/ strongly typed API, since
the CString related functions are really closely coupled monolithic beasts,
I will refactor them separately
- all tests are preserved and passing; only the message changed at some places.
In my opinion, these messages are holding the same information.
I would also highlight that this refactoring caught a bug in
clang/test/Analysis/string.c:454 where the diagnostic did not reflect reality.
This catch backs my effort on simplifying this monolithic CStringChecker.
Reviewers: NoQ, baloghadamsoftware, Szelethus, rengolin, Charusso
Reviewed By: NoQ
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin,
mikhail.ramalho, donat.nagy, dkrupp, Charusso, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74806
Alexey Bataev [Wed, 8 Apr 2020 19:19:54 +0000 (15:19 -0400)]
[OPENMP50] Fix PR45469: Consider variable-category of defaultmap clause as optional.
Summary:
According to the standard, variable-category is the optional part of the
defaultmap clause while the compiler always requires it. Turned it into
optional part.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77751
Pavel Labath [Thu, 9 Apr 2020 13:36:51 +0000 (15:36 +0200)]
Add a missing dependency to DebugInfoDWARF unit tests
BinaryFormat was already being used for various constants, but as of
b761a648 it is alse used for code.
This should fix the shared library build.
Sid Manning [Thu, 9 Apr 2020 13:32:35 +0000 (08:32 -0500)]
[Hexagon] Default linker tests can fail if CLANG_DEFAULT_LINKER is used.
These values are not always known since there is a configuration
option to set the default linker, CLANG_DEFAULT_LINKER.
Differential Revision: https://reviews.llvm.org/D77684
Nathan James [Thu, 9 Apr 2020 11:43:33 +0000 (12:43 +0100)]
[ASTMatchers] Add support for dynamic matching of ofKind narrowing matcher
Summary: Adds support for using the ofKind in clang-query and other dynamic matcher use cases
Reviewers: klimek, aaron.ballman, jdoerfert
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77791
Shengchen Kan [Thu, 9 Apr 2020 05:56:04 +0000 (13:56 +0800)]
[NFC][X86] Refine code in X86AsmBackend
Summary: Move code to a better place, rename function, etc
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77778
Pavel Labath [Thu, 9 Apr 2020 13:19:24 +0000 (15:19 +0200)]
[lldb] Disable the new Communication test on windows
The ConnectionFileDescriptor class on windows does not support
interruption (see the BytesAvailable method). Therefore this test makes
no sense there.
Pavel Labath [Thu, 9 Apr 2020 12:41:51 +0000 (14:41 +0200)]
[lldb] Add parts accidentally left out of 769d704: Recommit "[lldb/Core] Fix a race in the Communication class"
I went to a great length to explain the reason why these changes were
needed, but I did not actually ammend the patch to include them. :(
Florian Hahn [Thu, 9 Apr 2020 12:38:43 +0000 (13:38 +0100)]
[SCCP] Add test case for binary ops with constant expressions.
Sanjay Patel [Thu, 9 Apr 2020 11:55:55 +0000 (07:55 -0400)]
[InstCombine] replace undef in vector constant for safe shift transform (PR45447)
As noted in PR45447, we have a vector-constant-with-undef-element transform bug:
https://bugs.llvm.org/show_bug.cgi?id=45447
We replace undefs with a safe constant (0 or -1) based on the (non-)negative
predicate constraint.
So this is correct:
http://volta.cs.utah.edu:8080/z/WZE36H
...but this is not:
http://volta.cs.utah.edu:8080/z/boj8gJ
Previously, we were relying on getSafeVectorConstantForBinop() in the related fold (D76800).
But that's making an assumption about what qualifies as "safe", and that assumption may
not always hold.
Differential Revision: https://reviews.llvm.org/D77739
Marek Kurdej [Thu, 9 Apr 2020 11:53:03 +0000 (13:53 +0200)]
[libFuzzer] Fix typo in seed_inputs flag description. NFC.
Anton Bikineev [Sat, 4 Apr 2020 19:55:10 +0000 (21:55 +0200)]
tsan: don't instrument __attribute__((naked)) functions
Naked functions are required to not have compiler generated
prologues/epilogues, hence no instrumentation is needed for them.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45400
Differential Revision: https://reviews.llvm.org/D77477
Pavel Labath [Thu, 2 Apr 2020 13:09:08 +0000 (15:09 +0200)]
[DWARF] Detect extraction errors in DWARFFormValue::extractValue
Summary:
Although the function had a bool return value, it was always returning
true. Presumably this is because the main type of errors one can
encounter here is running off the end of the stream, and until very
recently, the DataExtractor class made it very difficult to detect that.
The situation has changed now, and we can easily detect errors here,
which this patch does.
Reviewers: dblaikie, aprantl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77308
Pavel Labath [Thu, 2 Apr 2020 11:54:54 +0000 (13:54 +0200)]
Recommit "[lldb/Core] Fix a race in the Communication class"
The synchronization logic in the previous had a subtle bug. Moving of
the "m_read_thread_did_exit = true" into the critical section made it
possible for some threads calling SynchronizeWithReadThread call to get
stuck. This could happen if there were already past the point where they
checked this variable. In that case, they would block on waiting for the
eBroadcastBitNoMorePendingInput event, which would never come as the
read thread was blocked on getting the synchronization mutex.
The new version moves that line out of the critical section and before
the sending of the eBroadcastBitNoMorePendingInput event, and also adds
some comments to explain why the things need to be in this sequence:
- m_read_thread_did_exit = true: prevents new threads for waiting on
events
- eBroadcastBitNoMorePendingInput: unblock any current thread waiting
for the event
- Disconnect(): close the connection. This is the only bit that needs to
be in the critical section, and this is to ensure that we don't close
the connection while the synchronizing thread is mucking with it.
Original commit message follows:
Communication::SynchronizeWithReadThread is called whenever a process
stops to ensure that we process all of its stdout before we report the
stop. If the process exits, we first call this method, and then close
the connection.
However, when the child process exits, the thread reading its stdout
will usually (but not always) read an EOF because the other end of the
pty has been closed. In response to an EOF, the Communication read
thread closes it's end of the connection too.
This can result in a race where the read thread is closing the
connection while the synchronizing thread is attempting to get its
attention via Connection::InterruptRead.
The fix is to hold the synchronization mutex while closing the
connection.
I've found this issue while tracking down a rare flake in some of the
vscode tests. I am not sure this is the cause of those failures (as I
would have expected this issue to manifest itself differently), but it
is an issue nonetheless.
The attached test demonstrates the steps needed to reproduce the race.
It will fail under tsan without this patch.
Reviewers: clayborg, JDevlieghere
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77295
Shengchen Kan [Tue, 7 Apr 2020 04:25:03 +0000 (12:25 +0800)]
[Driver][X86] Add -mpad-max-prefix-size
Summary:
The option `-mpad-max-prefix-size` performs some checking and delegate to MC option `-x86-pad-max-prefix-size`. This option is designed for eliminate NOPs when we need to align something by adding redundant prefixes to instructions, e.g. it can be used along with `-malign-branch`, `-malign-branch-boundary` to prefix padding branch.
It has similar (but slightly different) effect as GAS's option `-malign-branch-prefix-size`, e.g. `-mpad-max-prefix-size` can also elminate NOPs emitted by align directive, so we use a different name here. I remove the option `-malign-branch-prefix-size` since is unimplemented and not needed. If we need to be compatible with GAS, we can make `-malign-branch-prefix-size` an alias for this option later.
Reviewers: jyknight, reames, MaskRay, craig.topper, LuoYuanke
Reviewed By: MaskRay, LuoYuanke
Subscribers: annita.zhang, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77628
LLVM GN Syncbot [Thu, 9 Apr 2020 11:26:04 +0000 (11:26 +0000)]
[gn build] Port
44f0d7f1364
Serguei Katkov [Thu, 9 Apr 2020 11:24:47 +0000 (18:24 +0700)]
Revert "[Codegen/Statepoint] Allow usage of registers for non gc deopt values."
This reverts commit
a0275705bb5aa938119c3e7c8bc957a823450b17.
It causes buildbot failures building LLVM with BUILD_SHARED_LIBS due to a linker error.
Georgii Rymar [Wed, 8 Apr 2020 10:10:01 +0000 (13:10 +0300)]
[obj2yaml] - Do not dump the segment's "Align" field when it is equal to 1.
yaml2obj sets the `Align` to 1 by default, hence we can stop
dumping it to reduce the output.
Differential revision: https://reviews.llvm.org/D77716
Balazs Benics [Thu, 26 Mar 2020 11:30:27 +0000 (12:30 +0100)]
[NFC] Fix Z3 version detection regexp
Summary:
We use the `major.minor.build` version format in this file, except when we try
to parse the result of the test binary.
In that regular expression, we expect the `major.minor.build.rev` format, which
is never fulfilled.
Reviewers: NoQ, george.karpenkov, alexandre.isoard, serge-sans-paille
Reviewed By: NoQ
Subscribers: mgorny, mikhail.ramalho, Charusso, martong, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76837
Pavel Labath [Thu, 9 Apr 2020 10:49:56 +0000 (12:49 +0200)]
Revert "[lldb/Core] Fix a race in the Communication class"
This reverts commit
ebb071345cdae2509c55f9eec76090926fee86a2 -- it seems
to introduce a deadlock in some circumstances.
Florian Hahn [Thu, 9 Apr 2020 10:30:02 +0000 (11:30 +0100)]
[LV] Assert no DbgInfoIntrinsic calls are passed to widening (NFC).
When building a VPlan, BasicBlock::instructionsWithoutDebug() is used to
iterate over the instructions in a block. This means that no recipes
should be created for debug info intrinsics already and we can turn the
early exit into an assertion.
Reviewers: Ayal, gilr, rengolin, aprantl
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D77636
LLVM GN Syncbot [Thu, 9 Apr 2020 10:13:53 +0000 (10:13 +0000)]
[gn build] Port
a0275705bb5
Florian Hahn [Thu, 9 Apr 2020 10:07:36 +0000 (11:07 +0100)]
Temporarily revert "[Attributor] Unify testing (=updates,...)"
This patch reverts the 2 patches below, as on most systems the disabled
tests actually pass and that causes most bots to be red, including
http://green.lab.llvm.org/green/job/clang-stage1-RA/8541/
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/15646/
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/23690
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/16751
* [Attributor] Disable three tests until the SCC update bug was fixed
commit
2ae1a76c27295370d552f57352508b7af4dba791.
* [Attributor] Unify testing (=updates,prefixes,run configurations,...)
2bcf5793e14577ed3c9f15a77a35179ae544fff4.
Pavel Labath [Thu, 2 Apr 2020 11:54:54 +0000 (13:54 +0200)]
[lldb/Core] Fix a race in the Communication class
Summary:
Communication::SynchronizeWithReadThread is called whenever a process
stops to ensure that we process all of its stdout before we report the
stop. If the process exits, we first call this method, and then close
the connection.
However, when the child process exits, the thread reading its stdout
will usually (but not always) read an EOF because the other end of the
pty has been closed. In response to an EOF, the Communication read
thread closes it's end of the connection too.
This can result in a race where the read thread is closing the
connection while the synchronizing thread is attempting to get its
attention via Connection::InterruptRead.
The fix is to hold the synchronization mutex while closing the
connection.
I've found this issue while tracking down a rare flake in some of the
vscode tests. I am not sure this is the cause of those failures (as I
would have expected this issue to manifest itself differently), but it
is an issue nonetheless.
The attached test demonstrates the steps needed to reproduce the race.
It will fail under tsan without this patch.
Reviewers: clayborg, JDevlieghere
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77295
Serguei Katkov [Tue, 7 Apr 2020 04:29:25 +0000 (11:29 +0700)]
[Codegen/Statepoint] Allow usage of registers for non gc deopt values.
The change introduces the usage of physical registers for non-gc deopt values.
This require runtime support to know how to take a value from register.
By default usage is off and can be switched on by option.
The change also introduces additional fix-up patch which forces the spilling
of caller saved registers (clobbered after the call) and re-writes statepoint
to use spill slots instead of caller saved registers.
Reviewers: reames, dantrushin
Reviewed By: reames, dantrushin
Subscribers: mgorny, hiraditya, mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D77371
Jay Foad [Thu, 9 Apr 2020 09:42:16 +0000 (10:42 +0100)]
[CodeGen] Fix a simple FIXME. NFC.
Pratyai Mazumder [Thu, 9 Apr 2020 09:33:36 +0000 (02:33 -0700)]
[SanitizerCoverage] Add -fsanitize-coverage=inline-bool-flag
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77637
Jay Foad [Thu, 9 Apr 2020 09:15:07 +0000 (10:15 +0100)]
Fix typo in comment
Jay Foad [Thu, 9 Apr 2020 09:13:53 +0000 (10:13 +0100)]
[AMDGPU] Remove outdated comment
Peter Smith [Thu, 9 Apr 2020 08:53:00 +0000 (09:53 +0100)]
[LLD][ELF][ARM] Fix 32-bit Arm builders, by making test case smaller
Use AT(address) to force the creation of 3 small segments rather than
a single giant one, causing the Arm v8 builder to run out of memory.
Raul Tambre [Thu, 9 Apr 2020 09:18:42 +0000 (02:18 -0700)]
[compiler-rt] Don't print warning about missing testingsupport if not including tests
Reviewers: samsonov, vitalybuka
Reviewed By: vitalybuka
Subscribers: dberris, mgorny, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D77375
Florian Hahn [Thu, 9 Apr 2020 09:23:21 +0000 (10:23 +0100)]
[VPlan] Add & use VPValue operands for VPWidenCallRecipe (NFC).
This patch adds VPValue versions for the arguments of the call to
VPWidenCallRecipe and uses them during code-generation.
Similar to D76373 this reduces ingredient def-use usage by ILV as
a step towards full VPlan-based def-use relations.
Reviewers: Ayal, gilr, rengolin
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D77655
Qiu Chaofan [Thu, 9 Apr 2020 09:13:01 +0000 (17:13 +0800)]
[Docs] Add more FP option description for llc
This patch adds missing description of enable-no-signed-zeros-fp-math
and enable-no-trapping-fp-math options of llc.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D77713
Jay Foad [Wed, 5 Feb 2020 16:15:53 +0000 (16:15 +0000)]
[KnownBits] Move AND, OR and XOR logic into KnownBits
Summary:
There are at least three clients for KnownBits calculations:
ValueTracking, SelectionDAG and GlobalISel. To reduce duplication the
common logic should be moved out of these clients and into KnownBits
itself.
This patch does this for AND, OR and XOR calculations by implementing
and using appropriate operator overloads KnownBits::operator& etc.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74060
Marek Kurdej [Thu, 9 Apr 2020 08:42:04 +0000 (10:42 +0200)]
[clang-tidy] [doc] Fix hicpp-noexcept-move alias links.
Jay Foad [Thu, 9 Apr 2020 07:52:45 +0000 (08:52 +0100)]
[ValueTracking] Simplify KnownBits construction
Use the simpler BitWidth constructor instead of the copy constructor to
make it clear when we don't actually need to copy an existing KnownBits
value. Split out from D74539. NFC.
Nikita Popov [Thu, 9 Apr 2020 07:47:15 +0000 (09:47 +0200)]
[RDA] Avoid negative shift UB
Avoid "left shift of negative value -1" ubsan errors by casting
to uintptr_t before performing the shift, rather than after.
Shu Anzai [Thu, 9 Apr 2020 06:11:55 +0000 (08:11 +0200)]
[lldb] Fixing the bug that the "log timer" has no tab completion
I fixed the bug that the "log timer" has no tab command.
Original code has the only CommandObjectLogTimer class, but it is not
sufficient. Thus I divided the content of CommandObjectLog class into
CommandObjectLogEnable class, CommandObjectLogDisable class,
CommandObjectLogDump class, CommandObjectLogReset class,
CommandObjectLogIncrement class.
Reviewed by: teemperor
Differential Revision: https://reviews.llvm.org/D76906
Serge Pavlov [Thu, 26 Mar 2020 07:51:09 +0000 (14:51 +0700)]
[FPEnv] Use single enum to represent rounding mode
Now compiler defines 5 sets of constants to represent rounding mode.
These are:
1. `llvm::APFloatBase::roundingMode`. It specifies all 5 rounding modes
defined by IEEE-754 and is used in `APFloat` implementation.
2. `clang::LangOptions::FPRoundingModeKind`. It specifies 4 of 5 IEEE-754
rounding modes and a special value for dynamic rounding mode. It is used
in clang frontend.
3. `llvm::fp::RoundingMode`. Defines the same values as
`clang::LangOptions::FPRoundingModeKind` but in different order. It is
used to specify rounding mode in in IR and functions that operate IR.
4. Rounding mode representation used by `FLT_ROUNDS` (C11, 5.2.4.2.2p7).
Besides constants for rounding mode it also uses a special value to
indicate error. It is convenient to use in intrinsic functions, as it
represents platform-independent representation for rounding mode. In this
role it is used in some pending patches.
5. Values like `FE_DOWNWARD` and other, which specify rounding mode in
library calls `fesetround` and `fegetround`. Often they represent bits
of some control register, so they are target-dependent. The same names
(not values) and a special name `FE_DYNAMIC` are used in
`#pragma STDC FENV_ROUND`.
The first 4 sets of constants are target independent and could have the
same numerical representation. It would simplify conversion between the
representations. Also now `clang::LangOptions::FPRoundingModeKind` and
`llvm::fp::RoundingMode` do not contain the value for IEEE-754 rounding
direction `roundTiesToAway`, although it is supported natively on
some targets.
This change defines all the rounding mode type via one `llvm::RoundingMode`,
which also contains rounding mode for IEEE rounding direction `roundTiesToAway`.
Differential Revision: https://reviews.llvm.org/D77379
Pratyai Mazumder [Thu, 9 Apr 2020 05:02:41 +0000 (22:02 -0700)]
[SanitizerCoverage] sancov/inline-bool-flag instrumentation.
Summary:
New SanitizerCoverage feature `inline-bool-flag` which inserts an
atomic store of `1` to a boolean (which is an 8bit integer in
practice) flag on every instrumented edge.
Implementation-wise it's very similar to `inline-8bit-counters`
features. So, much of wiring and test just follows the same pattern.
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, hiraditya, jfb, cfe-commits, #sanitizers
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D77244
Vitaly Buka [Thu, 9 Apr 2020 05:13:19 +0000 (22:13 -0700)]
[NFC][SanitizerCoverage] Simplify alignment calculation
This reverts commit
e42f2a0cd8b8007c816d0e63f5000c444e29105e.
Johannes Doerfert [Thu, 9 Apr 2020 05:31:41 +0000 (00:31 -0500)]
[Attributor] Disable three tests until the SCC update bug was fixed
D76588 exposed an SCC update bug in three tests which manifests
sometimes, e.g., on this bot that runs expensive checks:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23032/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Afp80.ll
We disable the tests temporarily to investigate.
LLVM GN Syncbot [Thu, 9 Apr 2020 05:18:49 +0000 (05:18 +0000)]
[gn build] Port
a3dc9490004
WangTianQing [Thu, 9 Apr 2020 05:15:42 +0000 (13:15 +0800)]
[X86] Add TSXLDTRK instructions.
Summary: For more details about these instructions, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference
Reviewers: craig.topper, RKSimon, LuoYuanke
Reviewed By: craig.topper
Subscribers: mgorny, hiraditya, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77205
Johannes Doerfert [Thu, 9 Apr 2020 00:04:57 +0000 (19:04 -0500)]
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
Johannes Doerfert [Mon, 23 Mar 2020 06:09:49 +0000 (01:09 -0500)]
[CallGraphUpdater] Remove dead constants before replacing a function
Dead constants might be left when a function is replaced, we can
gracefully handle this case and avoid complexity for the users who would
see an assertion otherwise.
Lang Hames [Thu, 9 Apr 2020 02:23:02 +0000 (19:23 -0700)]
[ORC] Make mangling convenience methods part of the public API of LLJIT.
This saves clients from having to manually construct a MangleAndInterner.
Uday Bondhugula [Wed, 8 Apr 2020 07:01:48 +0000 (12:31 +0530)]
[MLIR] ShapedType accessor minor fixes + add isDynamicDim accessor
Minor fixes and cleanup for ShapedType accessors, use
ShapedType::kDynamicSize, add ShapedType::isDynamicDim.
Differential Revision: https://reviews.llvm.org/D77710
Jonas Devlieghere [Thu, 9 Apr 2020 00:35:05 +0000 (17:35 -0700)]
[lldb/Docs] Elaborate on reproducer testing
Matt Arsenault [Wed, 8 Apr 2020 21:25:21 +0000 (17:25 -0400)]
MIR: Use Register
River Riddle [Thu, 9 Apr 2020 01:33:24 +0000 (18:33 -0700)]
[mlir][NFC] Wrap the cl::opts in JitRunner within a struct to avoid global initializers.
Summary: This avoids the need for having global static initializers within the JITRunner support library, and only constructs the options when the runner is invoked.
Differential Revision: https://reviews.llvm.org/D77760
Sam Clegg [Tue, 7 Apr 2020 21:02:20 +0000 (14:02 -0700)]
[WebAssembly][MC] Use StringRef over std::string pointer
This is followup based on feedback on
5be42f36f56.
See: https://reviews.llvm.org/D77627.
Differential Revision: https://reviews.llvm.org/D77674
Craig Topper [Thu, 9 Apr 2020 01:04:28 +0000 (18:04 -0700)]
[LoopVectorize] Move testing for SVML vectorization of exp2f_finite/exp2_finite from svml-calls.ll to svml-calls-finite.ll where the finite versions of log, pow, and exp already were.
Craig Topper [Wed, 8 Apr 2020 23:59:36 +0000 (16:59 -0700)]
[InstCombine] Avoid a call to deprecated version of CreateCall.
Passing a Value * to CreateCall has to call getPointerElementType
to find the type of the pointer.
In this case we can rely on the fact that Intrinsic::getDeclaration
returns a Function * and use that version of CreateCall.
Johannes Doerfert [Wed, 8 Apr 2020 22:24:24 +0000 (17:24 -0500)]
[Attributor][NFC] Split AbstractAttributes out of Attributor.cpp
Attributor.cpp became quite big and we need to start provide structure.
The Attributor code is now in Attributor.cpp and the classes derived
from AbstractAttribute are in AttributorAttributes.cpp. Minor changes
were required but no intended functional changes.
We also minimized includes as part of this.
Reviewed By: baziotis
Differential Revision: https://reviews.llvm.org/D76873
River Riddle [Wed, 8 Apr 2020 23:51:26 +0000 (16:51 -0700)]
[mlir] Mark ClassID::getID as LLVM_EXTERNAL_VISIBILITY to ensure only one version exists
Summary: ClassID is used as a type id and must be unique in the face of shared libraries to ensure correctness. This fixes failures related to BUILD_SHARED_LIBs on macos.
Differential Revision: https://reviews.llvm.org/D77764
Christopher Tetreault [Wed, 8 Apr 2020 23:17:08 +0000 (16:17 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: espindola, efriedma, sdesmalen
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77275
Christopher Tetreault [Wed, 8 Apr 2020 22:27:41 +0000 (15:27 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: hfinkel, efriedma, sdesmalen
Reviewed By: efriedma
Subscribers: wuzish, nemanjai, hiraditya, kbarton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77266
Jonas Devlieghere [Wed, 8 Apr 2020 22:34:13 +0000 (15:34 -0700)]
[lldb/Python] Add lldbconfig module to make the lldb module configurable
Using the approach suggested by Pavel in D77588, this patch introduces a
new lldbconfig module that lives next to the lldb module. It makes it
possible to make the lldb module configurable before importing it. More
specifically it makes it possible to delay initializing the debugger,
which is needed for testing the reproducer.
Differential revision: https://reviews.llvm.org/D77661
Jonathan Roelofs [Sun, 5 Apr 2020 20:42:16 +0000 (14:42 -0600)]
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
Eric Fiselier [Wed, 8 Apr 2020 22:25:01 +0000 (18:25 -0400)]
[libc++] Fix failing concepts tests
Christopher Tetreault [Wed, 8 Apr 2020 17:42:22 +0000 (10:42 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: sdesmalen, rriddle, efriedma
Reviewed By: sdesmalen
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77263
Eric Christopher [Wed, 8 Apr 2020 22:12:53 +0000 (15:12 -0700)]
Fix -Wdeprecated-copy warning in XcodeSDK.
Eric Fiselier [Wed, 8 Apr 2020 22:00:13 +0000 (18:00 -0400)]
[libcxx] Adds [concept.same]
Patch from Christopher Di Bella (cjdb@google.com)
Reviewed as https://reviews.llvm.org/D74291
Adds `std::same_as` to libc++. Since there aren't clang-format rules for
//requires-expressions//, I'll need to disable the formatter in certain areas.
Amara Emerson [Wed, 8 Apr 2020 21:15:25 +0000 (14:15 -0700)]
GlobalISel: Add a setInstrAndDebugLoc(MachineInstr&) convenience helper to MachineIRBuilder. NFC.
This saves doing two separate calls to set the Instr and DebugLoc from an existing MI.
River Riddle [Wed, 8 Apr 2020 21:18:15 +0000 (14:18 -0700)]
[mlir][NFC] Wrap static DenseMap inside of a function to avoid the need for a global static initializer
This also helps to abstract away the exact implementation details of the loopup method if we wish to change it in the future.
Matt Arsenault [Wed, 8 Apr 2020 20:37:44 +0000 (16:37 -0400)]
CodeGen: Use Register in MachineInstrBuilder
Nicolas Vasilache [Wed, 8 Apr 2020 18:53:37 +0000 (14:53 -0400)]
[mlir][Linalg] Add a test for a fused Linalg pass based on DRR to go from matmul to vectors
This revision builds a simple "fused pass" consisting of 2 levels of tiling, memory promotion and vectorization using linalg transformations written as composable pattern rewrites.
River Riddle [Wed, 8 Apr 2020 20:23:13 +0000 (13:23 -0700)]
[mlir][NFC] Remove cl::opts for LoopUnroll now that the pass uses PassOptions
instead.
These were missed when the opts were replaced, and are unused.
Erich Keane [Wed, 8 Apr 2020 20:14:33 +0000 (13:14 -0700)]
Make target features check work with ctor and dtor-
The problem was reported in PR45468, applying target features to an
always_inline constructor/destructor runs afoul of GlobalDecl
construction assert when checking for target-feature compatibility.
The core problem is fixed by using the version of the check that takes a
FunctionDecl rather than the GlobalDecl. However, while writing the
test, I discovered that source locations weren't properly set for this
check on ctors/dtors. This patch also fixes constructors and CALLED destructors.
Unfortunately, it doesn't seem too possible to get a meaningful source
location for a 'cleanup' destructor, so those are still 'frontend' level
errors unfortunately. A fixme was added to the test to cover that
situation.
Louis Dionne [Wed, 8 Apr 2020 20:05:02 +0000 (16:05 -0400)]
[libc++] CI: Always build for both i386 and x86_64 in the back-deployment script
River Riddle [Wed, 8 Apr 2020 19:57:02 +0000 (12:57 -0700)]
[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.
Summary: Pass options are a better choice for various reasons and avoid the need for static constructors.
Differential Revision: https://reviews.llvm.org/D77707
LLVM GN Syncbot [Wed, 8 Apr 2020 20:00:26 +0000 (20:00 +0000)]
[gn build] Port
8b67853a83c
Kirill Naumov [Tue, 31 Mar 2020 18:43:25 +0000 (18:43 +0000)]
[CFGPrinter] Adding heat coloring to CFGPrinter
This patch introduces the heat coloring of the Control Flow Graph which is based
on the relative "hotness" of each BB. The patch is a part of sequence of three
patches, related to graphs Heat Coloring.
Reviewers: rcorcs, apilipenko, davidxl, sfertile, fedor.sergeev, eraman, bollu
Differential Revision: https://reviews.llvm.org/D77161