Jessica Paquette [Thu, 5 Mar 2020 18:57:52 +0000 (10:57 -0800)]
[AArch64][GlobalISel] Avoid copies to target register bank for subregister copies
Previously for any copy from a register bigger than the destination:
Copied to a same-sized register in the destination register bank.
Subregister copy of that to the destination.
This fails for copies from 128-bit FPRs to GPRs because the GPR register bank
can't accomodate 128-bit values.
Instead of special-casing such copies to perform the truncation beforehand in
the source register bank, generalize this:
a) Perform a subregister copy straight from source register whenever possible.
This results in shorter MIR and fixes the above problem.
b) Perform a full copy to target bank and then do a subregister copy only if
source bank can't support target's size. E.g. GPR to 8-bit FPR copy.
Patch by Raul Tambre (tambre)!
Differential Revision: https://reviews.llvm.org/D75421
Fangrui Song [Tue, 3 Mar 2020 00:52:17 +0000 (16:52 -0800)]
[PowerPC] Delete PPCMachObjectWriter and powerpc{,64}-apple-darwin
Reviewed By: #powerpc, sfertile
Differential Revision: https://reviews.llvm.org/D75494
MaheshRavishankar [Thu, 5 Mar 2020 19:01:24 +0000 (11:01 -0800)]
[mlir][GPU] Expose the functionality to create a GPUFuncOp from a LaunchOp
The current setup of the GPU dialect is to model both the host and
device side codegen. For cases (like IREE) the host side modeling
might not directly fit its use case, but device-side codegen is still
valuable. First step in accessing just the device-side functionality
of the GPU dialect is to allow just creating a gpu.func operation from
a gpu.launch operation. In addition this change also "inlines"
operations into the gpu.func op at time of creation instead of this
being a later step.
Differential Revision: https://reviews.llvm.org/D75287
Fangrui Song [Fri, 21 Feb 2020 19:32:33 +0000 (11:32 -0800)]
[ARM] Rewrite ARMAttributeParser
* Delete boilerplate
* Change functions to return `Error`
* Test parsing errors
* Update callers of ARMAttributeParser::parse() to check the `Error` return value.
Since this patch touches nearly everything in the file, I apply
http://llvm.org/docs/Proposals/VariableNames.html and change variable
names to lower case.
Reviewed By: compnerd
Differential Revision: https://reviews.llvm.org/D75015
Aaron Puchert [Thu, 5 Mar 2020 18:24:28 +0000 (19:24 +0100)]
Comment parsing: Treat \ref as inline command
Summary:
It's basically Doxygen's version of a link and can happen anywhere
inside of a paragraph. Fixes a bogus warning about empty paragraphs when
a parameter description starts with a link.
Reviewers: gribozavr2
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D75632
Mitch Phillips [Thu, 5 Mar 2020 18:27:08 +0000 (10:27 -0800)]
[GWP-ASan] Fix thread ID.
Summary:
GWP-ASan currently reports <unknown> thread ID, as the crash handler
merge dropped the include. Oops.
Reviewers: morehouse
Reviewed By: morehouse
Subscribers: eugenis, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D75693
Fangrui Song [Thu, 5 Mar 2020 01:19:18 +0000 (17:19 -0800)]
[llvm-objdump] --syms: make flags closer to GNU objdump
This fixes several issues. The behavior changes are:
A SHN_COMMON symbol does not have the 'g' flag.
An undefined symbol does not have 'g' or 'l' flag.
A STB_GLOBAL SymbolRef::ST_Unknown symbol has the 'g' flag.
A STB_LOCAL SymbolRef::ST_Unknown symbol has the 'l' flag.
Reviewed By: rupprecht
Differential Revision: https://reviews.llvm.org/D75659
Adrian Prantl [Wed, 4 Mar 2020 16:34:20 +0000 (08:34 -0800)]
Revert "[CGBlocks] Improve line info in backtraces containing *_helper_block"
Block copy/destroy helpers are now linkonce_odr functions, meant to be uniqued, and thus attaching debug information from one translation unit (or even just from one instance of many inside one translation unit) would be misleading and wrong in the general case.
This effectively reverts commit
9c6b6826ce3720ca8bb9bd15f3abf71261e6b911.
<rdar://problem/
59137040>
Differential Revision: https://reviews.llvm.org/D75615
Hiroshi Yamauchi [Tue, 3 Mar 2020 17:53:07 +0000 (09:53 -0800)]
[PGO][PGSO] Use IsColdXNthPercentile for sample PGO.
Summary:
This performs better for sample PGO.
NFC as PGSOColdCodeOnlyForSamplePGO is still true.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75550
Jordan Rupprecht [Wed, 4 Mar 2020 22:20:48 +0000 (14:20 -0800)]
[llvm-readobj] Include section name of notes.
This changes the output of `llvm-readelf -n` from:
```
Displaying notes found at file offset 0x<...> with length 0x<...>:
```
to:
```
Displaying notes found in: .note.foo
```
And similarly, adds a `Name:` field to the `llvm-readobj -n` output for notes.
This change not only increases GNU compatibility, it also makes it much easier to read notes. Note that we still fall back to printing the file offset/length in cases where we don't have a section name, such as when printing notes in program headers or printing notes in a partially stripped file (GNU readelf does the same).
Fixes llvm.org/PR41339.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D75647
Philip Reames [Thu, 5 Mar 2020 17:43:20 +0000 (09:43 -0800)]
[X86/MC] Factor out common code [NFC]
Pablo Barrio [Thu, 5 Mar 2020 16:27:25 +0000 (16:27 +0000)]
Fix MemTagSanitizer docs to point at Armv8.5-A MTE
The Memory Tagging Extension was introduced in Armv8.5-A.
Benjamin Kramer [Thu, 5 Mar 2020 17:20:14 +0000 (18:20 +0100)]
Fix pessimizing move. NFC.
Rodrigo Dominguez [Thu, 27 Feb 2020 20:02:34 +0000 (15:02 -0500)]
AMDGPU: Add/Fix tests for image atomic intrinsic.
Summary:
Add tests for 64-bit image atomic swap and cmpswap.
Fix tests for 32-bit image atomic add.
Change-Id: Ibb7619749c1ad504b24aa1c5f3185417a3013f3c
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, jfb, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75295
David Stuttard [Thu, 5 Mar 2020 14:09:27 +0000 (14:09 +0000)]
AMDGPU: Fix SMRD test in trivially disjoint mem access code
Summary:
This seems like an obvious error - cut and paste issue?
The change does make a change to one of the lit tests - it stops s_buffer_load
re-ordering past an MUBUF instruction (which is not surprising).
Change-Id: I80be99de5b62af4f42e91af2591b76a52ac9efa6
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75686
Jon Chesterfield [Thu, 5 Mar 2020 17:05:56 +0000 (17:05 +0000)]
[libomptarget][nfc] Move GetWarp/LaneId functions into per arch code
Summary:
[libomptarget][nfc] Move GetWarp/LaneId functions into per arch code
No code change for nvptx. Amdgcn currently has two implementations of GetLaneId,
this patch keeps the one a colleague considered to be superior for our ISA.
GetWarpId is currently the same function for amdgcn and nvptx, but I think it's
cleaner to keep it grouped with all the others than to keep it in support.cu.
Reviewers: jdoerfert, grokos, ABataev
Reviewed By: jdoerfert
Subscribers: jvesely, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D75587
Sterling Augustine [Wed, 4 Mar 2020 20:41:54 +0000 (12:41 -0800)]
Promote nameless lambda used by dl_iterate_phdr to named function.
Summary:
This cleans up control flow inside findUnwindSections, and will make
it easier to replace this code in a following patch. Also, expose the
data structure to allow use by a future replacment function.
Reviewers: mstorsjo, miyuki
Subscribers: krytarowski, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D75637
Chris Bowler [Thu, 5 Mar 2020 16:34:11 +0000 (11:34 -0500)]
[AIX] Extend int arguments to register width when passed in stack memory.
This is a follow up to the previous patch: [AIX] Implement caller
arguments passed in stack memory.
This corrects a defect in AIX 64-bit where an i32 is written to the
stack with stw (4 bytes) rather than the expected std (8 bytes.) Integer
arguments pass on the stack as images of their register representation.
I also took the opportunity to tidy up some of the calling convention
AIX tests I added in my last commit. This patch adds the missed assembly
expected output for the stack arg int case, which would have caught this
problem.
Differential Revision: https://reviews.llvm.org/D75126
Luís Marques [Thu, 5 Mar 2020 16:43:03 +0000 (16:43 +0000)]
[compiler-rt][builtins][RISCV] Port __clear_cache to RISC-V Linux
Implements `__clear_cache` for RISC-V Linux. We can't just use `fence.i` on
Linux, because the Linux thread might be scheduled on another hart, and the
`fence.i` instruction only flushes the icache of the current hart.
Chris Lattner [Thu, 5 Mar 2020 06:06:54 +0000 (22:06 -0800)]
Fix a warning about an unreachable default in a switch statement.
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75663
Juneyoung Lee [Thu, 5 Mar 2020 15:56:07 +0000 (00:56 +0900)]
[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions of dominating blocks' terminators
Summary:
```
br i1 c, BB1, BB2:
BB1:
use1(c)
BB2:
use2(c)
```
In BB1 and BB2, c is never undef or poison because otherwise the branch would have triggered UB.
This is a resubmission of 952ad47 with crash fix of llvm/test/Transforms/LoopRotate/freeze-crash.ll.
Checked with Alive2
Reviewers: xbolva00, spatel, lebedev.ri, reames, jdoerfert, nlopes, sanjoy
Reviewed By: reames
Subscribers: jdoerfert, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75401
Sanjay Patel [Thu, 5 Mar 2020 13:06:05 +0000 (08:06 -0500)]
[VectorCombine] add tests for different extract indexes; NFC
Simon Pilgrim [Thu, 5 Mar 2020 15:28:43 +0000 (15:28 +0000)]
Replace getAs with castAs to fix null dereference static analyzer warning.
Use castAs as we know the cast should succeed and we're dereferencing in the mangleBareFunctionType call.
Florian Hahn [Thu, 5 Mar 2020 14:55:08 +0000 (14:55 +0000)]
[VPlan] Use consecutive numbers to print VPValues instead of addresses.
Currently when printing VPValues we use the object address, which makes
it hard to distinguish VPValues as they usually are large numbers with
varying distance between them.
This patch adds a simple slot tracker, similar to the ModuleSlotTracker
used for IR values. In order to dump a VPValue or anything containing a
VPValue, a slot tracker for the enclosing VPlan needs to be created. The
existing VPlanPrinter can take care of that for the existing code. We
assign consecutive numbers to each VPValue we encounter in a reverse
post order traversal of the VPlan.
Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D73078
Daniel Kiss [Thu, 5 Mar 2020 14:01:54 +0000 (15:01 +0100)]
[AArch64] Harmonize print format of hint instructions.
Summary:
Hint instructions printed as "hint\t#hintnum" except
in case of ARM v8.3a instruction only "hint #hintnum" is printed.
This patch changes all format to the fist one.
Reviewers: pbarrio, LukeCheeseman, vsk
Reviewed By: vsk
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75625
Simon Pilgrim [Thu, 5 Mar 2020 14:22:11 +0000 (14:22 +0000)]
Fix use-after-move warning. NFCI.
Simon Pilgrim [Thu, 5 Mar 2020 13:58:49 +0000 (13:58 +0000)]
Fix "Value stored to 'RegForm' is never read" static analyzer warnings. NFC.
Simon Pilgrim [Thu, 5 Mar 2020 12:42:50 +0000 (12:42 +0000)]
Fix static analyzer uninitialized variable warning. NFCI.
Pavel Labath [Thu, 5 Mar 2020 12:03:26 +0000 (13:03 +0100)]
[lldb] s/ExecutionContext/Target in Disassembler
Some functions in this file only use the "target" component of an
execution context. Adjust the argument lists to reflect that.
This avoids some defensive null checks and simplifies most of the
callers.
Krasimir Georgiev [Thu, 5 Mar 2020 13:40:16 +0000 (14:40 +0100)]
Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks"
This reverts commit
8975aa6ea8172963d6532caa8ed2a6f6e0074a02.
Causes a compilation warning:
llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1037:43: warning: 'llvm::BlockFrequencyInfoImpl<llvm::BasicBlock>::BFICallbackVH' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class BlockFrequencyInfoImpl<BasicBlock>::BFICallbackVH : public CallbackVH {
^
1 warning generated.
Krasimir Georgiev [Thu, 5 Mar 2020 13:16:52 +0000 (14:16 +0100)]
[clang-format] do not insert spaces around inline asm symbolic names
Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=45108.
The `[` in such cases was mis-annotated as an `TT_ArrayInitializerLSquare`.
Reviewers: hans
Reviewed By: hans
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75675
Benjamin Kramer [Thu, 5 Mar 2020 12:52:05 +0000 (13:52 +0100)]
Revert "Fix regression in bdad0a1: force rebuilding of StmtExpr nodes in", "PR45083: Mark statement expressions as being dependent if they appear in"
This reverts commit
f545ede91c9d9f271e7504282cab7bf509607ead.
This reverts commit
bdad0a1b79273733df9acc1be4e992fa5d70ec56.
This crashes clang. I'll follow up with reproduction instructions.
Igor Kudrin [Thu, 5 Mar 2020 12:30:25 +0000 (19:30 +0700)]
Fix typos in comment marks.
Sanjay Patel [Wed, 4 Mar 2020 22:23:55 +0000 (17:23 -0500)]
[VectorCombine] add x86 AVX run to test for better coverage; NFC
Alexey Lapshin [Wed, 4 Mar 2020 19:56:52 +0000 (22:56 +0300)]
[LLD][NFC] Remove getOffsetInFile() workaround.
Summary:
LLD has workaround for the times when SectionIndex was not passed properly:
LT->getFileLineInfoForAddress(
S->getOffsetInFile() + Offset, nullptr,
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info));
S->getOffsetInFile() was added to differentiate offsets between
various sections. Now SectionIndex is properly specified.
Thus it is not necessary to use getOffsetInFile() workaround.
See https://reviews.llvm.org/D58194, https://reviews.llvm.org/D58357.
This patch removes getOffsetInFile() workaround.
Reviewers: ruiu, grimar, MaskRay, espindola
Reviewed By: grimar, MaskRay
Subscribers: emaste, arichardson, llvm-commits
Tags: #llvm, #lld
Differential Revision: https://reviews.llvm.org/D75636
Kiran Chandramohan [Wed, 4 Mar 2020 23:36:21 +0000 (23:36 +0000)]
[MLIR, OpenMP] Translation of OpenMP barrier construct to LLVM IR
Summary:
This patch adds support for translation of the OpenMP barrier construct to LLVM
IR. The OpenMP IRBuilder is used for this translation. In this patch the code
for translation is added to the existing LLVM dialect translation to LLVM IR.
The patch includes code changes and a testcase.
Reviewers: jdoerfert, nicolasvasilache, ftynse, rriddle, mehdi_amini
Reviewed By: ftynse, rriddle, mehdi_amini
Differential Revision: https://reviews.llvm.org/D72962
Daniil Suchkov [Thu, 5 Mar 2020 11:32:50 +0000 (18:32 +0700)]
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
With AssertingVHs instead of bare pointers in
BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
tests ran by make check fail. It means that there are users of BFI that
delete basic blocks while keeping BFI. Some of those transformations add
new basic blocks, so if a new basic block happens to be allocated at
address where an already deleted block was and we don't explicitly set
block frequency for that new block, BFI will report some non-default
frequency for the block even though frequency for the block was never
set. Inliner is an example of a transformation that adds and removes BBs
while querying and updating BFI.
With this patch, thanks to updates via CallbackVH, BFI won't keep stale
pointers in its Nodes map.
This is a resubmission of
408349a25d0f5a012003f84c95b49bcc7782fa70 with
fixed MSVC compilation errors.
Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
Reviewed-By: asbirlea, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75341
Jon Chesterfield [Thu, 5 Mar 2020 11:50:30 +0000 (11:50 +0000)]
[libomptarget][nfc][amdgcn] Replace magic number with named intrinsic
Utkarsh Saxena [Wed, 4 Mar 2020 12:25:02 +0000 (13:25 +0100)]
[clangd] Add instrumentation mode in clangd for metrics collection.
Summary:
This patch adds an instrumentation mode for clangd (enabled by
corresponding option in cc_opts).
If this mode is enabled then user can specify callbacks to run on the
final code completion result.
Moreover the CodeCompletion::Score will contain the detailed Quality and
Relevance signals used to compute the score when this mode is enabled.
These are required because we do not any place in which the final
candidates (scored and sorted) are available along with the above
signals. The signals are temporary structures in `addCandidate`.
The callback is needed as it gives access to many data structures that
are internal to CodeCompleteFlow and are available once Sema has run. Eg:
ScopeDistnace and FileDistance.
If this mode is disabled (as in default) then Score would just contain 2
shared pointers (null). Thus cost(memory/time) increase for the default
mode would be fairly cheap and insignificant.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75603
Tatyana Krasnukha [Thu, 5 Mar 2020 11:37:39 +0000 (14:37 +0300)]
[lldb][test] Temporarily X-fail TestPtrRefs.py and TestPtrRefsObjC.py
Bugzilla issue: llvm.org/pr45112
Daniil Suchkov [Thu, 5 Mar 2020 11:27:42 +0000 (18:27 +0700)]
Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks"
Reverting the patch because it causes compilation failure on MSVC.
This reverts commit
408349a25d0f5a012003f84c95b49bcc7782fa70.
Daniil Suchkov [Tue, 25 Feb 2020 09:21:01 +0000 (16:21 +0700)]
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
With AssertingVHs instead of bare pointers in
BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
tests ran by make check fail. It means that there are users of BFI that
delete basic blocks while keeping BFI. Some of those transformations add
new basic blocks, so if a new basic block happens to be allocated at
address where an already deleted block was and we don't explicitly set
block frequency for that new block, BFI will report some non-default
frequency for the block even though frequency for the block was never
set. Inliner is an example of a transformation that adds and removes BBs
while querying and updating BFI.
With this patch, thanks to updates via CallbackVH, BFI won't keep stale
pointers in its Nodes map.
Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
Reviewed-By: asbirlea, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75341
Pavel Labath [Thu, 5 Mar 2020 10:47:39 +0000 (11:47 +0100)]
[lldb] Make Disassembler::PrintInstructions a method
the previously static member function took a Disassembler* argument
anyway. This renames the argument to "this". The function also always
succeeds (returns true), so I change the return type to void.
Sam Parker [Thu, 5 Mar 2020 09:54:11 +0000 (09:54 +0000)]
[ARM][MVE] Enable *SHRN* for tail predication
These instructions don't swap lanes so make them valid.
Differential Revision: https://reviews.llvm.org/D75667
LLVM GN Syncbot [Thu, 5 Mar 2020 10:56:10 +0000 (10:56 +0000)]
[gn build] Port
cada5b881b6
Jeremy Morse [Thu, 5 Mar 2020 10:45:52 +0000 (10:45 +0000)]
Revert "clang: Treat ieee mode as the default for denormal-fp-math"
This reverts commit
c64ca93053af235bac0ca4dcdcd21c8882478310.
This patch tripped a few build bots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/24703/
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/13465/
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15994/
Reverting to clear the bots.
Igor Kudrin [Tue, 28 Jan 2020 07:11:54 +0000 (14:11 +0700)]
[DebugInfo] Do not truncate 64-bit values when dumping CIEs and FDEs.
This fixes printing long values that might reside in CIE and FDE,
including offsets, lengths, and addresses.
Differential Revision: https://reviews.llvm.org/D73887
Igor Kudrin [Mon, 3 Feb 2020 11:00:56 +0000 (18:00 +0700)]
[DebugInfo] Refine the condition to detect CIEs.
The condition was not accurate enough and could interpret some FDEs in
.eh_frame or 64-bit DWARF .debug_frame sections as CIEs. Even though
such FDEs are unlikely in a normal situation, the wrong interpretation
could hide an issue in a buggy generator.
Differential Revision: https://reviews.llvm.org/D73886
Mikael Holmen [Thu, 5 Mar 2020 08:29:55 +0000 (09:29 +0100)]
[AST] Replace assert with llvm_unreachable to silence compiler warning
New code added in
ec3060c72de6 looked like
+ case TemplateName::NameKind::OverloadedTemplate:
+ assert(false && "overloaded templates shouldn't survive to here.");
+ default:
If compiling without asserts we then got a warning about unannotated
fallthrough from the case into the default.
Change the assert into an llvm_unreachable to silence the warning.
Pavel Labath [Wed, 4 Mar 2020 13:17:50 +0000 (14:17 +0100)]
[lldb] Delete two overloads of Disassembler::Disassemble
by "inlining" them into their single caller (CommandObjectDisassemble).
The functions mainly consist of long argument lists and defensive
checks. These become unnecessary after inlining, so the end result is
less code. Additionally, this makes the implementation of
CommandObjectDisassemble more uniform (first figure out what you're
going to disassemble, then actually do it), which enables further
cleanups.
Georgii Rymar [Thu, 5 Mar 2020 09:41:42 +0000 (12:41 +0300)]
[Object/ELF] - Fix a position calculation expression in ELFFile<ELFT>::getEntry().
It fixes now what
1c991f907a43d7a56e82dd67a76514843841ed9a tried to fix.
(A test case failture on 32-bit Arch Linux)
On 32-bit hosts it still fails (because it truncates the `Pos` value to 32 bits).
It seems happens because of `sizeof` that returns `size_t`, which has a
different size on 32/64 bits hosts.
I've tested on a 32-bit host and verified that relocation-errors.test test and
other LLVM tools tests pass now.
Tatyana Krasnukha [Thu, 5 Mar 2020 09:35:32 +0000 (12:35 +0300)]
[lldb][test] Replace HandleCommand with runCmd to check that a command succeeded
Tatyana Krasnukha [Thu, 5 Mar 2020 09:25:38 +0000 (12:25 +0300)]
[lldb][test] These tests don't fail on Windows anymore
Daniil Suchkov [Thu, 5 Mar 2020 09:27:19 +0000 (16:27 +0700)]
[Test] Add a regression test for failure introduced by
952ad4701cf0d8da79789f6b83ddaa386c60d535
Daniil Suchkov [Thu, 5 Mar 2020 09:24:53 +0000 (16:24 +0700)]
Revert "[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions of dominating blocks' terminators"
That commit causes SIGSEGV on some simple tests.
This reverts commit
952ad4701cf0d8da79789f6b83ddaa386c60d535.
Sam McCall [Thu, 5 Mar 2020 09:11:44 +0000 (10:11 +0100)]
[clangd] Fix test (it worked by coincidence before)
Tatyana Krasnukha [Thu, 5 Mar 2020 08:32:13 +0000 (11:32 +0300)]
[lldb][test] TestFileHandle: flush the output after write
serge-sans-paille [Wed, 26 Feb 2020 07:08:47 +0000 (08:08 +0100)]
Avoid dangling reference on SectionList
Bug spotted by https://cookieplmonster.github.io/2020/02/01/emulator-bug-llvm-bug/
Basically, holding references to object inside a resized vector is a bad idea.
Differential Revision: https://reviews.llvm.org/D75110
Dvorskiy, Mikhail [Wed, 4 Mar 2020 10:41:20 +0000 (13:41 +0300)]
[pstl] A cleanup fix for sort parallel algorithm.
When one of sub-ranges has not been move constructed into a raw buffer, we should not call clean up for that sub-range. Instead of store detailed info about raw buffer history, the fix does the cleanup a sub-range after each moving the sub-range back.
https://reviews.llvm.org/D73779
Tatyana Krasnukha [Thu, 5 Mar 2020 07:31:07 +0000 (10:31 +0300)]
[lldb][test] Enable fix-its for the test case that expects them enabled
Fix-its were intentionally disabled by TestBase.setUp so that incorrect expressions in tests
don't pass just because Clang thinks it has a fix-it.
Tatyana Krasnukha [Thu, 5 Mar 2020 07:12:54 +0000 (10:12 +0300)]
[lldb][testsuite] Create a SBDebugger instance for each test
Some tests set settings and don't clean them up, this leads to side effects in other tests.
The patch removes a global debugger instance with a per-test debugger to avoid such effects.
From what I see, lldb.DBG was needed to determine the platform before a test is run,
lldb.selected_platform is used for this purpose now. Though, this required adding a new function
to the SBPlatform interface.
Differential Revision: https://reviews.llvm.org/D74903
Jun Ma [Mon, 2 Mar 2020 09:35:34 +0000 (17:35 +0800)]
[Coroutines] Optimized coroutine elision based on reachability
Differential Revision: https://reviews.llvm.org/D75440
David Blaikie [Thu, 5 Mar 2020 06:36:24 +0000 (22:36 -0800)]
X86AsmBackend.cpp: #ifndef NDEBUG some only-used-in-asserts variables to fix the -Werror non-asserts build
Lang Hames [Thu, 5 Mar 2020 05:23:51 +0000 (21:23 -0800)]
[ORC] Remove hard dependency on libobjc when using MachOPlatform with LLJIT.
The LLJIT::MachOPlatformSupport class used to unconditionally attempt to
register __objc_selrefs and __objc_classlist sections. If libobjc had not
been loaded this resulted in an assertion, even if no objc sections were
actually present. This patch replaces this unconditional registration with
a check that no objce sections are present if libobjc has not been loaded.
This will allow clients to use MachOPlatform with LLJIT without requiring
libobjc for non-objc code.
Sameer Sahasrabuddhe [Thu, 5 Mar 2020 03:39:46 +0000 (09:09 +0530)]
StructurizeCFG: simplify phi nodes when possible
After structurization, some phi nodes can have a single incoming edge
and can be simplified away. This change runs a simplify query on all
phis that are either modified or added by the structurizer. This also
moves some phis closer to their use as a side benefit.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D75500
Craig Topper [Thu, 5 Mar 2020 04:38:44 +0000 (20:38 -0800)]
[X86] Simplify the code at the end of lowerShuffleAsBroadcast.
The original code could create a bitcast from f64 to i64 and back
on 32-bit targets. This was only working because getBitcast was
able to fold the casts away to avoid leaving the illegal i64 type.
Now we handle the scalar case directly by broadcasting using the
scalar type as the element type. Then bitcasting to the final VT.
This works since we ensure the scalar type is the same size as
the final VT element type. No more casts to i64.
For the vector case, we cast to VT or subvector of VT. And then
do the broadcast.
I think this all matches what we generated before, just in a more
readable way.
Matt Arsenault [Wed, 6 Nov 2019 04:48:18 +0000 (20:48 -0800)]
clang: Treat ieee mode as the default for denormal-fp-math
The IR hasn't switched the default yet, so explicitly add the ieee
attributes.
I'm still not really sure how the target default denormal mode should
interact with -fno-unsafe-math-optimizations. The target may have
selected the default mode to be non-IEEE based on the flags or based
on its true behavior, but we don't know which is the case. Since the
only users of a non-IEEE mode without a flag still support IEEE mode,
just reset to IEEE.
Philip Reames [Thu, 5 Mar 2020 03:59:12 +0000 (19:59 -0800)]
Consistently capitalize a variable [NFC]
One instance in a copy paste was pointed out in a review, fix all instances at once.
Michael Trent [Wed, 4 Mar 2020 17:10:38 +0000 (09:10 -0800)]
Fix dyld opcode *_ADD_ADDR_IMM_SCALED error detection.
Summary:
Move the check for malformed REBASE_OPCODE_ADD_ADDR_IMM_SCALED and
BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED opcodes after the immediate
has been applied to the SegmentOffset. This fixes specious errors
where SegmentOffset is pointing between two sections when trying to
correct the SegmentOffset value.
Update the regression tests to verify the proper error message.
Reviewers: pete, ab, lhames, steven_wu, jhenderson
Reviewed By: pete
Subscribers: hiraditya, dexonsmith, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75629
Igor Kudrin [Wed, 4 Mar 2020 13:53:05 +0000 (20:53 +0700)]
[DebugInfo] Avoid crashing on an invalid section identifier.
A DWARFSectionKind is read from input. It is not validated on parsing,
so an unexpected value may result in reaching llvm_unreachable() in
DWARFUnitIndex::getColumnHeader() when dumping the index section.
Differential Revision: https://reviews.llvm.org/D75609
QingShan Zhang [Thu, 5 Mar 2020 03:42:50 +0000 (03:42 +0000)]
[DAGCombine] Check the uses of negated floating constant and remove the hack
PowerPC hits an assertion due to somewhat the same reason as https://reviews.llvm.org/D70975.
Though there are already some hack, it still failed with some case, when the operand 0 is NOT
a const fp, it is another fma that with const fp. And that const fp is negated which result in multi-uses.
A better fix is to check the uses of the negated const fp. If there are already use of its negated
value, we will have benefit as no extra Node is added.
Differential revision: https://reviews.llvm.org/D75501
Jim Lin [Thu, 5 Mar 2020 02:00:23 +0000 (10:00 +0800)]
[AVR][NFC] Use Register instead of unsigned
Summary: Use Register type for variables instead of unsigned type.
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75595
Greg Clayton [Thu, 5 Mar 2020 03:28:24 +0000 (19:28 -0800)]
Fix buildbots with merge that didn't happen for
4050b01ba9ece02721ec496383baee219ca8cc2b.
Greg Clayton [Thu, 5 Mar 2020 03:12:08 +0000 (19:12 -0800)]
Fix GSYM tests to run the yaml files and fix test failures on some machines.
YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Fixed memory sanitizer bot bugs as well.
Differential Revision: https://reviews.llvm.org/D75390
hsmahesha [Thu, 5 Mar 2020 02:45:55 +0000 (08:15 +0530)]
AMDGPU/GlobalISel: Support llvm.trap and llvm.debugtrap intrinsics
Summary: Lower trap and debugtrap intrinsics to AMDGPU machine instruction(s).
Reviewers: arsenm, nhaehnle, kerbowa, cdevadas, t-tye, kzhuravl
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, yaxunl, rovka, dstuttard, tpr, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74688
Shengchen Kan [Sun, 1 Mar 2020 08:02:41 +0000 (16:02 +0800)]
[X86] Add a private member function determinePaddingPrefix for X86AsmBackend
Summary: X86 can reduce the bytes of NOP by padding instructions with prefixes to get a better peformance in some cases. So a private member function `determinePaddingPrefix` is added to determine which prefix is the most suitable.
Reviewers: annita.zhang, reames, MaskRay, craig.topper, LuoYuanke, jyknight
Reviewed By: reames
Subscribers: llvm-commits, dexonsmith, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75357
MaheshRavishankar [Thu, 5 Mar 2020 01:03:07 +0000 (17:03 -0800)]
[mlir][Linalg] Fix load/store operations generated while lower loops when
output has zero rank.
While lowering to loops, no indices should be used in the load/store
operation if the buffer is zero-rank.
Differential Revision: https://reviews.llvm.org/D75391
Philip Reames [Thu, 5 Mar 2020 00:49:15 +0000 (16:49 -0800)]
[X86] Relax existing instructions to reduce the number of nops needed for alignment purposes
If we have an explicit align directive, we currently default to emitting nops to fill the space. As discussed in the context of the prefix padding work for branch alignment (D72225), we're allowed to play other tricks such as extending the size of previous instructions instead.
This patch will convert near jumps to far jumps if doing so decreases the number of bytes of nops needed for a following align. It does so as a post-pass after relaxation is complete. It intentionally works without moving any labels or doing anything which might require another round of relaxation.
The point of this patch is mainly to mock out the approach. The optimization implemented is real, and possibly useful, but the main point is to demonstrate an approach for implementing such "pad previous instruction" approaches. The key notion in this patch is to treat padding previous instructions as an optional optimization, not as a core part of relaxation. The benefit to this is that we avoid the potential concern about increasing the distance between two labels and thus causing further potentially non-local code grown due to relaxation. The downside is that we may miss some opportunities to avoid nops.
For the moment, this patch only implements a small set of existing relaxations.. Assuming the approach is satisfactory, I plan to extend this to a broader set of instructions where there are obvious "relaxations" which are roughly performance equivalent.
Note that this patch *doesn't* change which instructions are relaxable. We may wish to explore that separately to increase optimization opportunity, but I figured that deserved it's own separate discussion.
There are possible downsides to this optimization (and all "pad previous instruction" variants). The major two are potentially increasing instruction fetch and perturbing uop caching. (i.e. the usual alignment risks) Specifically:
* If we pad an instruction such that it crosses a fetch window (16 bytes on modern X86-64), we may cause the decoder to have to trigger a fetch it wouldn't have otherwise. This can effect both decode speed, and icache pressure.
* Intel's uop caching have particular restrictions on instruction combinations which can fit in a particular way. By moving around instructions, we can both cause misses an change misses into hits. Many of the most painful cases are around branch density, so I don't expect this to be too bad on the whole.
On the whole, I expect to see small swings (i.e. the typical alignment change problem), but nothing major or systematic in either direction.
Differential Revision: https://reviews.llvm.org/D75203
Louis Dionne [Thu, 5 Mar 2020 00:32:10 +0000 (19:32 -0500)]
[libc++] Mark deprecation test as UNSUPPORTED on Clang 6
Sam McCall [Tue, 3 Mar 2020 23:33:29 +0000 (00:33 +0100)]
[clangd] Track document versions, include them with diags, enhance logs
Summary:
This ties to an LSP feature (diagnostic versioning) but really a lot
of the value is in being able to log what's happening with file versions
and queues more descriptively and clearly.
As such it's fairly invasive, for a logging patch :-\
Key decisions:
- at the LSP layer, we don't reqire the client to provide versions (LSP
makes it mandatory but we never enforced it). If not provided,
versions start at 0 and increment. DraftStore handles this.
- don't propagate magically using contexts, but rather manually:
addDocument -> ParseInputs -> (ParsedAST, Preamble, various callbacks)
Context-propagation would hide the versions from ClangdServer, which
would make producing good log messages hard
- within ClangdServer, treat versions as opaque and unordered.
std::string is a convenient type for this, and allows richer versions
for embedders. They're "mandatory" but "null" is a reasonable default.
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75582
Sam McCall [Thu, 5 Mar 2020 00:04:44 +0000 (01:04 +0100)]
[clangd] Remove unused+broken InvalidationError class.
Petr Hosek [Wed, 4 Mar 2020 23:59:59 +0000 (15:59 -0800)]
Revert "[clang-doc] Improving Markdown Output"
This reverts commit
45499f3801d8a00919deaf38c801885d8e75b942, it's
still failing on Windows bots.
Matt Arsenault [Wed, 4 Mar 2020 23:05:48 +0000 (18:05 -0500)]
Add constexpr to DenormalMode constructors
This will allow their use in member initializers in a future commit.
Matt Arsenault [Wed, 12 Feb 2020 22:50:52 +0000 (17:50 -0500)]
X86: Generate mir checks in sqrt test
Stefan Gränitz [Wed, 4 Mar 2020 22:52:51 +0000 (23:52 +0100)]
[ORC] Decompose LazyCallThroughManager::callThroughToSymbol()
Summary: Decompose callThroughToSymbol() into findReexport(), resolveSymbol(), notifyResolved() and reportCallThroughError(). This allows derived classes to reuse the functionality while adding their own code in between.
Reviewers: lhames
Reviewed By: lhames
Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75084
Sam McCall [Wed, 4 Mar 2020 13:04:17 +0000 (14:04 +0100)]
[clangd] Cancel certain operations if the file changes before we start.
Summary:
Otherwise they can force us to build lots of snapshots that we don't need.
Particularly, try to do this for operations that are frequently
generated by editors without explicit user interaction, and where
editing the file makes the result less useful. (Code action
enumeration is a good example).
https://github.com/clangd/clangd/issues/298
This doesn't return the "right" LSP error code (ContentModified) to the client,
we need to teach the cancellation API to distinguish between different causes.
Reviewers: kadircet
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75602
Craig Topper [Wed, 4 Mar 2020 22:57:58 +0000 (14:57 -0800)]
[X86] Convert vXi1 vectors to xmm/ymm/zmm types via getRegisterTypeForCallingConv rather than using CCPromoteToType in the td file
Previously we tried to promote these to xmm/ymm/zmm by promoting
in the X86CallingConv.td file. But this breaks when we run out
of xmm/ymm/zmm registers and need to fall back to memory. We end
up trying to create a non-sensical scalar to vector. This lead
to an assertion. The new tests in avx512-calling-conv.ll all
trigger this assertion.
Since we really want to treat these types like we do on avx2,
it seems better to promote them before the calling convention
code gets involved. Except when the calling convention is one
that passes the vXi1 type in a k register.
The changes in avx512-regcall-Mask.ll are because we indicated
that xmm/ymm/zmm types should be passed indirectly for the
Win64 ABI before we go to the common lines that promoted the
vXi1 types. This caused the promoted types to be picked up by
the default calling convention code. Now we promote them earlier
so they get passed indirectly as though they were xmm/ymm/zmm.
Differential Revision: https://reviews.llvm.org/D75154
Sam McCall [Mon, 2 Mar 2020 15:54:56 +0000 (16:54 +0100)]
[clangd] Fix isInsideMainFile to be aware of preamble.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75460
shafik [Wed, 4 Mar 2020 22:52:31 +0000 (14:52 -0800)]
[dsymutil] Fix template stripping in getDIENames(...) to account for overloaded operators
Currently dsymutil when generating accelerator tables will attempt to strip the template parameters from names for subroutines.
For some overload operators which contain < in their names e.g. operator< the current method ends up stripping the operator name as well,
we just end up with the name operator in the table for each case.
Differential Revision: https://reviews.llvm.org/D75545
Martijn Vels [Wed, 4 Mar 2020 22:52:46 +0000 (17:52 -0500)]
Partially inline basic_string copy constructor in UNSTABLE
Summary:
This is a recommit of https://reviews.llvm.org/D73223 where the added function accidentally ended up inside an idef block.
This change splits the copy constructor up inlining short initialization, and explicitly outlining long initialization into __init_copy_ctor_external() which is the externally instantiated slow path.
For unstable ABI, this has the following changes:
remove basic_string(const basic_string&)
remove basic_string(const basic_string&, const Allocator&)
add __init_copy_ctor_external(const value_type*, size_type)
Quick local benchmark for Copy:
Master
```
---------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------
BM_StringCopy_Empty 3.50 ns 3.51 ns
199326720
BM_StringCopy_Small 3.50 ns 3.51 ns
199510016
BM_StringCopy_Large 15.7 ns 15.7 ns
45230080
BM_StringCopy_Huge 1503 ns 1503 ns 464896
```
With this change
```
---------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------
BM_StringCopy_Empty 1.99 ns 2.00 ns
356471808
BM_StringCopy_Small 3.29 ns 3.30 ns
203425792
BM_StringCopy_Large 13.3 ns 13.3 ns
52948992
BM_StringCopy_Huge 1472 ns 1472 ns 475136
```
Subscribers: libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D75639
Petr Hosek [Sat, 29 Feb 2020 20:22:02 +0000 (12:22 -0800)]
[clang-doc] Improving Markdown Output
This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.
The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.
Patch By: Clayton
Differential Revision: https://reviews.llvm.org/D72954
Craig Topper [Wed, 4 Mar 2020 22:33:26 +0000 (14:33 -0800)]
[X86] Disable commuting for the first source operand of zero masked scalar fma intrinsic instructions.
I believe this is the correct fix for D75506 rather than disabling all commuting. We can still commute the remaining two sources.
Differential Revision:m https://reviews.llvm.org/D75526
Kostya Kortchinsky [Tue, 3 Mar 2020 19:16:31 +0000 (11:16 -0800)]
[scudo][standalone] Do not fill 32b regions at once
Summary:
For the 32b primary, whenever we created a region, we would fill it
all at once (eg: create all the transfer batches for all the blocks
in that region). This wasn't ideal as all the potential blocks in
a newly created region might not be consummed right away, and it was
using extra memory (and release cycles) to keep all those free
blocks.
So now we keep track of the current region for a given class, and
how filled it is, carving out at most `MaxNumBatches` worth of
blocks at a time.
Additionally, lower `MaxNumBatches` on Android from 8 to 4. This
lowers the randomness of blocks, which isn't ideal for security, but
keeps things more clumped up for PSS/RSS accounting purposes.
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D75551
Matt Arsenault [Wed, 4 Mar 2020 19:24:09 +0000 (14:24 -0500)]
AMDGPU: Remove VOP3OpSelMods0 complex pattern
Use default operand of 0 instead.
Frank Laub [Wed, 4 Mar 2020 22:16:41 +0000 (14:16 -0800)]
[MLIR][Affine][NFC] Expose expandAffineMap
Summary:
Expose expandAffineMap so that it can be used by lowerings defined outside of
MLIR core.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D75589
Nikita Popov [Sat, 29 Feb 2020 10:41:47 +0000 (11:41 +0100)]
[InstSimplify] Constant fold icmp of gep
InstSimplify can fold icmps of gep where the base pointers are the
same and the offsets are constant. It does so by constructing a
constant expression icmp and assumes that it gets folded -- but
this doesn't actually happen, because GEP expressions can usually
only be folded by the target-dependent constant folding layer.
As such, we need to explicitly invoke it here.
Differential Revision: https://reviews.llvm.org/D75407
Lei Zhang [Tue, 3 Mar 2020 16:25:10 +0000 (11:25 -0500)]
[mlir][vulkan-runner] Add basic timing for compute pipeline
This commit adds timestamp query commands in Vulkan runner's
compute pipeline to gain insights into how long it takes to
run the compute shader. This commit also adds timing from CPU
side for VkQueueSubmit and vkQueueWaitIdle.
Differential Revision: https://reviews.llvm.org/D75531
Muhammad Omair Javaid [Wed, 4 Mar 2020 22:12:28 +0000 (03:12 +0500)]
Revert "[GlobalISel][Localizer] Enable intra-block localization of already-local uses."
This reverts commit
e91e1df6ab74006e96b0cca94192e935542705a4.
Eric Fiselier [Wed, 4 Mar 2020 22:09:29 +0000 (17:09 -0500)]
[libc++] Un-xfail GCC test for new version
Matt Arsenault [Tue, 25 Feb 2020 19:45:07 +0000 (14:45 -0500)]
AMDGPU/GlobalISel: Don't use vector G_EXTRACT in arg lowering
Create a wider source vector, and unmerge with dead defs like the
legalizer. The legalization handling for G_EXTRACT is incomplete, and
it's preferrable to keep everything in 32-bit pieces.
We should probably start moving these functions into utils, since we
have a growing number of places that do almost the same thing.