Sean Fertile [Tue, 26 May 2020 17:06:50 +0000 (13:06 -0400)]
[PowerPC][NFC] Add colon to TODO's and fix indentation.
Hiroshi Yamauchi [Tue, 4 Feb 2020 23:19:33 +0000 (15:19 -0800)]
[PGO] Add memcmp/bcmp size value profiling.
Summary: This adds support for memcmp/bcmp to the existing memcpy/memset value profiling.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79751
Sanjay Patel [Tue, 26 May 2020 16:48:22 +0000 (12:48 -0400)]
[InstCombine] reassociate fsub+fadd with FMF to increase adds and throughput
The -reassociate pass tends to transform this kind of pattern into
something that is worse for vectorization and codegen. See PR43953:
https://bugs.llvm.org/show_bug.cgi?id=43953
Matt Arsenault [Tue, 26 May 2020 16:58:18 +0000 (12:58 -0400)]
Revert "[AMDGPU] NFC target dependent requiresUniformRegister refactored out"
This reverts commit
fb38b98338cc87442e3451665e82bf1c8ef9388f.
This will regress compile time.
alex-t [Tue, 26 May 2020 16:47:29 +0000 (19:47 +0300)]
[AMDGPU] NFC target dependent requiresUniformRegister refactored out
Summary: Target specific method encapsulated into the Target Lowering Info.
Reviewers: rampitec, vpykhtin
Reviewed By: rampitec
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70085
Jonas Devlieghere [Tue, 26 May 2020 16:37:14 +0000 (09:37 -0700)]
[dsymutil] Escape CFBundleIdentifier in plist.
Revision 333565 started escaping HTML special characters in the plist
written by dsymutil, but didn't include the updated CFBundleIdentifier.
Fangrui Song [Thu, 14 May 2020 20:55:20 +0000 (13:55 -0700)]
[ELF][PPC64] Synthesize _savegpr[01]_{14..31} and _restgpr[01]_{14..31}
In the 64-bit ELF V2 API Specification: Power Architecture, 2.3.3.1. GPR
Save and Restore Functions defines some special functions which may be
referenced by GCC produced assembly (LLVM does not reference them).
With GCC -Os, when the number of call-saved registers exceeds a certain
threshold, GCC generates `_savegpr0_* _restgpr0_*` calls and expects the
linker to define them. See
https://sourceware.org/pipermail/binutils/2002-February/017444.html and
https://sourceware.org/pipermail/binutils/2004-August/036765.html . This
is weird because libgcc.a would be the natural place. However, the linker
generation approach has the advantage that the linker can generate
multiple copies to avoid long branch thunks. We don't consider the
advantage significant enough to complicate our trunk implementation, so
we take a simple approach.
* Check whether `_savegpr0_{14..31}` are used
* If yes, define needed symbols and add an InputSection with the code sequence.
`_savegpr1_*` `_restgpr0_*` and `_restgpr1_*` are similar.
Reviewed By: sfertile
Differential Revision: https://reviews.llvm.org/D79977
Sean Fertile [Tue, 26 May 2020 14:37:51 +0000 (10:37 -0400)]
[PowerPC][AIX] Spill CSRs to the ABI specified stack offsets.
Extend the CSR save/restore insertion code to support both 32-bit and
64-bit AIX.
Differential Revision: https://reviews.llvm.org/D79252
Sanne Wouda [Tue, 26 May 2020 16:11:32 +0000 (17:11 +0100)]
Fix MemoryLocation.h use without Instructions.h
MemoryLocation.h was changed to only include Instruction.h. However,
cast<> still needs the full definiton, so move MemoryLocation::getOrNone
to the cpp file.
Matt Arsenault [Wed, 20 May 2020 17:26:10 +0000 (13:26 -0400)]
AMDGPU/GlobalISel: Fix assert on 16-bit G_EXTRACT results
I consider this to be a hack, since we probably should not mark any
16-bit extract as legal, and require all extracts to be done on
multiples of 32. There are quite a few more battles to fight in the
legalizer for sub-dword vectors, so just select this for now so we can
pass OpenCL conformance without crashing.
Also fix the same assert for G_INSERTs. Unlike G_EXTRACT there's not a
trivial way to select this so just fail on it.
Adrian Prantl [Tue, 26 May 2020 15:53:02 +0000 (08:53 -0700)]
Add missing forward decl to unbreak the modular build
Adrian Prantl [Sat, 23 May 2020 00:33:03 +0000 (17:33 -0700)]
Debug Info: Mark os_log helper functions as artificial
The os_log helper functions are linkonce_odr and supposed to be
uniqued across TUs, so attachine a DW_AT_decl_line on it is highly
misleading. By setting the function decl to implicit, CGDebugInfo
properly marks the functions as artificial and uses a default file /
line 0 location for the function.
rdar://problem/
63450824
Differential Revision: https://reviews.llvm.org/D80463
Matt Arsenault [Fri, 15 May 2020 22:33:01 +0000 (18:33 -0400)]
GlobalISel: Merge G_PTR_MASK with llvm.ptrmask intrinsic
Confusingly, these were unrelated and had different semantics. The
G_PTR_MASK instruction predates the llvm.ptrmask intrinsic, but has a
different format. G_PTR_MASK only allows clearing the low bits of a
pointer, and only a constant number of bits. The ptrmask intrinsic
allows an arbitrary mask. Replace G_PTR_MASK to match the intrinsic.
Only selects the cases that look like the old instruction. More work
is needed to select the general case. Also new legalization code is
still needed to deal with the case where the incoming mask size does
not match the pointer size, which has a specified behavior in the
langref.
Daniel Frampton [Thu, 21 May 2020 10:03:24 +0000 (11:03 +0100)]
Use configure depends to trigger reconfiguration when LLVMBuild files change
Summary:
The existing logic has a workaround where configure_file is used to write a single dummy file output many times.
CMake has a feature to more directly add the dependency and avoid the dummy file (it is available in the minimum version specified).
Reviewers: theraven
Reviewed By: theraven
Subscribers: theraven, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80218
Nemanja Ivanovic [Tue, 26 May 2020 14:58:25 +0000 (09:58 -0500)]
[PowerPC] Unaligned FP default should apply to scalars only
As reported in PR45186, we could be in a situation where we don't
want to handle unaligned memory accesses for FP scalars but still
have VSX (which allows unaligned access for vectors). Change the
default to only apply to scalars.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=45186
Matt Arsenault [Wed, 20 May 2020 03:03:39 +0000 (23:03 -0400)]
AMDGPU/GlobalISel: Don't select boolean phi by default
This is currently missing most of the hard parts to lower correctly,
so disable it for now. This fixes at least one OpenCL conformance test
and allows it to pass with fallback. Hide this behind an option for
now.
Christian Sigg [Mon, 25 May 2020 10:05:57 +0000 (12:05 +0200)]
[MLIR] Helper class referencing MemRefType to unify runner implementations.
Summary:
Add DynamicMemRefType which can reference one of the statically ranked StridedMemRefType or a UnrankedMemRefType so that runner utils only need to be implemented once.
There is definitely room for more clean up and unification, but I will keep that for follow-ups.
Reviewers: nicolasvasilache
Reviewed By: nicolasvasilache
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80513
Sam Parker [Tue, 26 May 2020 13:47:02 +0000 (14:47 +0100)]
[NFC][ARM][AArch64] More code size tests
Add analysis runs for icmp, fcmp and select instructions.
Nicolas Vasilache [Tue, 26 May 2020 13:16:54 +0000 (09:16 -0400)]
[mlir][Vector] Add vector contraction to outerproduct lowering
This revision adds the additional lowering and exposes the patterns at a finer granularity for better programmatic reuse. The unit test makes use of the finer grained pattern for simpler checks.
As the ContractionOpLowering is exposed programmatically, cleanup opportunities appear and static class methods are turned into free functions with static visibility.
Differential Revision: https://reviews.llvm.org/D80375
Tharindu Rusira [Tue, 26 May 2020 06:48:06 +0000 (00:48 -0600)]
Update DialectConversion.md
line 164: typo? baz.add should be bar.add.
`bar.add` -> `foo.add`
Yitzhak Mandelbaum [Tue, 19 May 2020 18:26:46 +0000 (14:26 -0400)]
[libTooling] In Transformer, allow atomic changes to span multiple files.
Summary:
Currently, all changes returned by a single application of a rule must fit in
one atomic change and therefore must apply to one file. However, there are
patterns in which a single rule will want to modify multiple files; for example,
a header and implementation to change a declaration and its definition. This
patch relaxes Transformer, libTooling's interpreter of RewriteRules, to support
multiple changes.
Reviewers: gribozavr
Subscribers: mgrang, jfb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80239
David Green [Tue, 26 May 2020 12:23:23 +0000 (13:23 +0100)]
[ARM] MVE VMINV/VMAXV test additions. NFC
John Brawn [Tue, 26 May 2020 10:30:27 +0000 (11:30 +0100)]
[Sema] Diagnose more cases of static data members in local or unnamed classes
We currently diagnose static data members directly contained in unnamed classes,
but we should also diagnose when they're in a class that is nested (directly or
indirectly) in an unnamed class. Do this by iterating up the list of parent
DeclContexts and checking if any is an unnamed class.
Similarly also check for function or method DeclContexts (which includes things
like blocks and openmp captured statements) as then the class is considered to
be a local class, which means static data members aren't allowed.
Differential Revision: https://reviews.llvm.org/D80295
Serge Pavlov [Tue, 26 May 2020 12:24:05 +0000 (19:24 +0700)]
[FPEnv] Intrinsic llvm.roundeven
This intrinsic implements IEEE-754 operation roundToIntegralTiesToEven,
and performs rounding to the nearest integer value, rounding halfway
cases to even. The intrinsic represents the missed case of IEEE-754
rounding operations and now llvm provides full support of the rounding
operations defined by the standard.
Differential Revision: https://reviews.llvm.org/D75670
Sanjay Patel [Tue, 26 May 2020 11:56:50 +0000 (07:56 -0400)]
[DAGCombiner] try to move splat after binop with splat constant
binop (splat X), (splat C) --> splat (binop X, C)
binop (splat C), (splat X) --> splat (binop C, X)
We do this in IR, and there's a similar fold for the case with 2
non-constant operands just above the code diff in this patch.
This was discussed in D79718, and the extra shuffle in the test
(llvm/test/CodeGen/X86/vector-fshl-128.ll::sink_splatvar) where it
was noticed disappears because demanded elements analysis is no
longer blocked. The large majority of the test diffs seem to be
benign code scheduling changes, but I do see another type of win:
moving the splat later allows binop narrowing in some cases.
Regressions were avoided on x86 and ARM with the INSERT_VECTOR_ELT
restriction.
Differential Revision: https://reviews.llvm.org/D79886
Yi Kong [Tue, 26 May 2020 11:13:10 +0000 (19:13 +0800)]
[Transforms] Check validity of profile reader before invoking it
Although an invalid sampling profile would fail the compilation anyway,
this avoids crashing the compiler.
Guillaume Chatelet [Wed, 20 May 2020 11:55:28 +0000 (11:55 +0000)]
[libc][NFC] Simplify memcpy implementation
Summary: This is a NFC, it aims at simplifying both the code and build files.
Reviewers: abrachet, sivachandra
Subscribers: mgorny, tschuett, ecnelises, libc-commits, courbet
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D80291
Simon Pilgrim [Tue, 26 May 2020 11:32:29 +0000 (12:32 +0100)]
MachineInstr.h - remove unnecessary MachineMemOperand forward declaration. NFC.
We already have to include MachineMemOperand.h
Sam Parker [Tue, 26 May 2020 11:17:26 +0000 (12:17 +0100)]
[CostModel] getUserCost for intrinsic throughput
Last part of recommitting 'Unify Intrinsic Costs'
259eb619ff6dcd5b6111d1686e18559b9ca004d4. This patch now uses
getUserCost from getInstructionThroughput.
Differential Revision: https://reviews.llvm.org/D80012
Kirstóf Umann [Mon, 13 Apr 2020 13:57:18 +0000 (15:57 +0200)]
[analyzer][RetainCount] Remove the CheckOSObject option
As per http://lists.llvm.org/pipermail/cfe-dev/2019-August/063215.html, lets get rid of this option.
It presents 2 issues that have bugged me for years now:
* OSObject is NOT a boolean option. It in fact has 3 states:
* osx.OSObjectRetainCount is enabled but OSObject it set to false: RetainCount
regards the option as disabled.
* sx.OSObjectRetainCount is enabled and OSObject it set to true: RetainCount
regards the option as enabled.
* osx.OSObjectRetainCount is disabled: RetainCount regards the option as
disabled.
* The hack involves directly modifying AnalyzerOptions::ConfigTable, which
shouldn't even be public in the first place.
This still isn't really ideal, because it would be better to preserve the option
and remove the checker (we want visible checkers to be associated with
diagnostics, and hidden options like this one to be associated with changing how
the modeling is done), but backwards compatibility is an issue.
Differential Revision: https://reviews.llvm.org/D78097
Sam Parker [Tue, 26 May 2020 10:27:57 +0000 (11:27 +0100)]
[CostModel] Unify getCastInstrCost
Add the remaining cast instruction opcodes to the base implementation
of getUserCost and directly return the result. This allows
getInstructionThroughput to return getUserCost for the casts. This
has required changes to PPC and SystemZ because they implement
getUserCost and/or getCastInstrCost with adjustments for vector
operations. Adjusts have also been made in the remaining backends
that implement the method so that they still produce a cost of zero
or one for cost kinds other than throughput.
Differential Revision: https://reviews.llvm.org/D79848
Eduardo Caldas [Tue, 26 May 2020 10:19:07 +0000 (12:19 +0200)]
Add support for binary operators in Syntax Trees
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80540
Nico Weber [Tue, 26 May 2020 10:23:57 +0000 (06:23 -0400)]
[build] Add LLVM_LOCAL_RPATH which can set an rpath on just unit test binaries
After D80096, bots that build clang for distribution and that can't use
system gcc / libstdc++ need to pass a working rpath so that unit test
binaries can run. The method suggested in GettingStarted.rst works fine
for local development, but it results in an absolute local rpath ending
up even in distributed binaries like clang, which is both ugly and
unnecessary.
Add an explicit toggle that can be used to add an rpath only for the
non-distributed binaries that need it.
Differential Revision: https://reviews.llvm.org/D80534
hsmahesha [Tue, 26 May 2020 10:17:03 +0000 (15:47 +0530)]
[AMDGPU/MemOpsCluster] Code clean-up around mem ops clustering logic
Summary:
Clean-up code around mem ops clustering logic. This patch cleans up code within
the function clusterNeighboringMemOps(). It is WIP, and this patch is a first cut.
Reviewers: foad, rampitec, arsenm, vpykhtin, javedabsar
Reviewed By: foad
Subscribers: MatzeB, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, javed.absar, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80119
Simon Pilgrim [Tue, 26 May 2020 09:55:43 +0000 (10:55 +0100)]
[X86] Fix fshr comment copy+paste typo. NFC.
Noticed by @foad on D80466.
Simon Pilgrim [Tue, 26 May 2020 09:12:04 +0000 (10:12 +0100)]
[X86][AVX] Add some initial movmsk combine tests
Show failure to reduce the signbit extraction for 256-bit integer vectors on AVX1 targets where the pcmpgt/ashr has to be done with split 128-bit vectors.
Georgii Rymar [Sat, 23 May 2020 15:34:08 +0000 (18:34 +0300)]
[DebugInfo/llvm-objdump] - Print "ZERO terminator" for terminator entries when dumping .eh_frame.
A CIE with the Length == 0 is a terminator:
https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
And GNU objdump recognizes them and prints the following for such entries:
"
00000000 ZERO terminator"
This patch teaches llvm-objdump to do the same. I had to update tests to use
"CHECK-NEXT" too.
(Note: it looks perhaps not right that printing is done inside the DebugInfo library,
I'd expect to see the change in the llvm-objdump's code somewhere instead,
but that is how it done atm).
Differential revision: https://reviews.llvm.org/D80476
Sam Parker [Tue, 26 May 2020 09:43:58 +0000 (10:43 +0100)]
[NFC][ARM] Fix for previous commit
Actually analyse code-size for the size runs...
Xing GUO [Tue, 26 May 2020 09:22:23 +0000 (17:22 +0800)]
[ObjectYAML][DWARF] Make variable names consistent.
Xing GUO [Tue, 26 May 2020 09:14:23 +0000 (17:14 +0800)]
[ObjectYAML][DWARF] Use .empty() to indicate if the DWARF sections are empty.
Georgii Rymar [Mon, 25 May 2020 14:30:41 +0000 (17:30 +0300)]
[yaml2obj] - Map section names to chunks for each ELFYAML::ProgramHeader early. NFCI.
Each `ELFYAML::ProgramHeader` currently contains a list of section names
included. We are trying to map them to Fill/Sections very late,
though we can create such mapping early, in `initProgramHeaders`.
The benefit is that with such change it is possible to access mapped
chunks earlier (for example during writing section content) and have
simpler code.
Differential revision: https://reviews.llvm.org/D80520
Sam Parker [Tue, 26 May 2020 09:29:42 +0000 (10:29 +0100)]
[NFC][ARM] Add code size analysis tests
Add code size runs for the cast costs.
vpykhtin [Tue, 26 May 2020 09:09:46 +0000 (12:09 +0300)]
[AMDGPU] Fix wait counts in the presence of 16bit subregisters
Differential Revision: https://reviews.llvm.org/D80033
Georgii Rymar [Wed, 20 May 2020 14:01:35 +0000 (17:01 +0300)]
[DebugInfo] - Fix multiple issues in DWARFDebugFrame::parse().
I've noticed an issue with "Data.getRelocatedValue(...)" call.
it might silently ignore an error when a content is truncated.
That leads to an infinite loop in the code (e.g. llvm-readobj hangs).
After fixing the issue I've found that actually we always tried
to read past the end of a section, even when a content was valid.
It happened because the terminator CIE (a CIE with the length == 0)
was never handled. At first I've tried just to stop adding the terminator
entry (and return), but it does not seem to be correct, because tools like
llvm-objdump might want to print something for such entries
(see comments in the code and test cases).
This patch fixes issues mentioned, provides new test cases for
both llvm-readobj and lib/DebugInfo and adds FIXMEs to existent
test cases related.
Differential revision: https://reviews.llvm.org/D80299
Lucas Prates [Tue, 5 May 2020 10:52:09 +0000 (11:52 +0100)]
[Clang][AArch64] Capturing proper pointer alignment for Neon vld1 intrinsicts
Summary:
During CodeGen for AArch64 Neon intrinsics, Clang was incorrectly
assuming all the pointers from which loads were being generated for vld1
intrinsics were aligned according to the intrinsics result type, causing
alignment faults on the code generated by the backend.
This patch updates vld1 intrinsics' CodeGen to properly capture the
correct load alignment based on the type of the pointer provided as
input for the intrinsic.
Reviewers: t.p.northover, ostannard, pcc
Reviewed By: ostannard
Subscribers: kristof.beyls, danielkiss, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79721
Sam Parker [Tue, 26 May 2020 08:23:18 +0000 (09:23 +0100)]
[CostModel] Unify Intrinsic Costs.
Recommitting most of the remaining changes from
259eb619ff6dcd5b6111d1686e18559b9ca004d4, but excluding the call to
getUserCost from getInstructionThroughput. Though there's still no
test changes, I doubt that this is an NFC...
With the two getIntrinsicInstrCosts folded into one, now fold in the
scalar/code-size orientated getIntrinsicCost. The remaining scalar
intrinsics were memcpy, cttz and ctlz which now have special handling
in the BasicTTI implementation.
This had required a change in the AMDGPU backend for fabs as it
should always be 'free'. I've also changed the X86 backend to return
the BaseT implementation when the CostKind isn't RecipThroughput.
Differential Revision: https://reviews.llvm.org/D80012
Sam Parker [Tue, 26 May 2020 08:41:04 +0000 (09:41 +0100)]
[NFC][ARM] Add intrinsic code size runs
Add code size analysis of arithmetic intrinsics.
Sam McCall [Wed, 20 May 2020 14:03:42 +0000 (16:03 +0200)]
[clangd] Don't traverse the AST within uninteresting files during indexing
Summary:
We already skip function bodies from these files while parsing, and drop symbols
found in them. However, traversing their ASTs still takes a substantial amount
of time.
Non-scientific benchmark on my machine:
background-indexing llvm-project (llvm+clang+clang-tools-extra), wall time
before: 7:46
after: 5:13
change: -33%
Indexer.cpp libclang should be updated too, I'm less familiar with that code,
and it's doing tricky things with the ShouldSkipFunctionBody callback, so it
needs to be done separately.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80296
Craig Topper [Tue, 26 May 2020 06:59:00 +0000 (23:59 -0700)]
[AArch64] Set i32 ISD::MULHU/S to Expand instead of Legal.
Looks like there are no isel patterns for these. A DAG combine
turns it into i64 multiply and a shift which hides this.
Extracted from D80485
Sam Parker [Tue, 26 May 2020 07:31:38 +0000 (08:31 +0100)]
[CostModel] Check for free intrinsics in BasicTTI
Recommitting part of "[CostModel] Unify Intrinsic Costs."
de71def3f59dc9f12f67141b5040d8e15c84d08a
Now that the 'free' intrinsic information has been sunk to the lowest
level, query the base implementation in BasicTTI before doing
anything else. I suspect this is the change that was causing the main
changes, particularly the large effects on debug builds.
Differential Revision: https://reviews.llvm.org/D80012
Pavel Labath [Tue, 26 May 2020 07:21:54 +0000 (09:21 +0200)]
[lldb] s/dyn_cast/isa
The cast result is unused and produces a warning with gcc.
Fangrui Song [Tue, 26 May 2020 06:00:50 +0000 (23:00 -0700)]
[AsmPrinter] Don't generate .Lfoo$local for -fno-PIC and -fPIE
-fno-PIC and -fPIE code generally cannot be linked in -shared mode and there is no benefit accessing via local aliases.
Actually, a .Lfoo$local reference will be converted to a STT_SECTION (if no section relaxation) reference which will cause the section symbol (sizeof(Elf64_Sym)=24) to be generated.
Serge Pavlov [Tue, 26 May 2020 06:19:01 +0000 (13:19 +0700)]
[FPEnv] Small fixes to implementation of flt.rounds
This change makes minor correction to the implementation of intrinsic
`llvm.flt.rounds`:
- Added documentation entry in LangRef,
- Attributes of the intrinsic changed to be in line with other functions
dependent of floating-point environment.
Differential Revision: https://reviews.llvm.org/D79322
Kang Zhang [Tue, 26 May 2020 06:14:08 +0000 (06:14 +0000)]
[NFC][PowerPC] Add a new case to test two-address verification
Kadir Cetinkaya [Tue, 5 May 2020 15:55:11 +0000 (17:55 +0200)]
[clangd] Change PreambleOnlyAction with content truncation
Summary:
Lexing until the token location is past preamble bound could be wrong
in some cases as preprocessor lexer can lex multiple tokens in a single call.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79426
Kadir Cetinkaya [Mon, 25 May 2020 15:25:55 +0000 (17:25 +0200)]
[clangd] Make use of SourceOrder to find first initializer in DefineOutline
Summary:
Constructors can have implicit initializers, this was crashing define
outline. Make sure we find the first "written" ctor initializer to figure out
`:` location.
Fixes https://github.com/clangd/clangd/issues/400
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80521
Yuanfang Chen [Tue, 26 May 2020 05:14:05 +0000 (22:14 -0700)]
[clang][test] fix tests for external assemblers
The test depends on using the integrated assembler. Make it
explicit by specifying -fintegrated-as.
Fangrui Song [Mon, 25 May 2020 22:05:35 +0000 (15:05 -0700)]
Make explicit -fno-semantic-interposition (in -fpic mode) infer dso_local
-fno-semantic-interposition is currently the CC1 default. (The opposite
disables some interprocedural optimizations.) However, it does not infer
dso_local: on most targets accesses to ExternalLinkage functions/variables
defined in the current module still need PLT/GOT.
This patch makes explicit -fno-semantic-interposition infer dso_local,
so that PLT/GOT can be eliminated if targets implement local aliases
for AsmPrinter::getSymbolPreferLocal (currently only x86).
Currently we check whether the module flag "SemanticInterposition" is 0.
If yes, infer dso_local. In the future, we can infer dso_local unless
"SemanticInterposition" is 1: frontends other than clang will also
benefit from the optimization if they don't bother setting the flag.
(There will be risks if they do want ELF interposition: they need to set
"SemanticInterposition" to 1.)
Nemanja Ivanovic [Tue, 26 May 2020 01:07:22 +0000 (20:07 -0500)]
[PowerPC] Prevent legalization loop from promoting SELECT_CC from v4i32 to v4i32
As reported in https://bugs.llvm.org/show_bug.cgi?id=45709 we can hit an
infinite loop in legalization since we set the legalization action for
ISD::SELECT_CC for all fixed length vector types to Promote. Without some
different legalization action for the type being promoted to, the legalizer
simply loops. Since we don't have patterns to match the node, the right
legalization action should be Expand.
Differential revision: https://reviews.llvm.org/D79854
Yuanfang Chen [Tue, 26 May 2020 00:36:28 +0000 (17:36 -0700)]
[clang][test] fix tests for external assemblers
These three tests depend on using the integrated assembler. Make it
explicit by specifying -fintegrated-as.
Yuanfang Chen [Fri, 22 May 2020 19:33:33 +0000 (12:33 -0700)]
[Clang][test] fix tests when using external assembler.
Summary:
The test assume using integraed-as, so make it explicit.
Reviewered by: aganea
Differential Revision: https://reviews.llvm.org/D80454
Kazu Hirata [Mon, 25 May 2020 22:43:28 +0000 (15:43 -0700)]
[Inlining] Set inline-deferral-scale to 2.
Summary:
This patch sets inline-deferral-scale to 2.
Both internal and SPEC benchmarking show that 2 is the best number
among -1, 2, 3, and 4.
inline-deferral-scale SPECint2006
------------------------------------------------------------
-1 38.0 (the default without this patch)
2 38.5
3 38.1
4 38.1
With the new default number, shouldBeDeferred returns true if:
TotalCost < IC.getCost() * 2
where
TotalCost is TotalSecondaryCost + IC.getCost() * NumCallerUsers.
If TotalCost >= 0 and NumCallerUsers >= 2, then
TotalCost >= IC.getCost() * 2, so shouldBeDeferred returns true only
when NumCallerUsers is 1.
Now, if TotalSecondaryCost < 0, which can happen if
InlineConstants::LastCallToStaticBonus, a huge number, has been
subtracted from TotalSecondaryCost, then TotalCost may be negative.
In this case, shouldBeDeferred may return true even when
NumCallerUsers >= 2.
Reviewers: davidxl, nikic
Reviewed By: davidxl
Subscribers: xbolva00, hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80229
Florian Hahn [Mon, 25 May 2020 19:44:38 +0000 (20:44 +0100)]
[LoopUnroll] Remove dead NextBlocks argument (NFC).
Marek Kurdej [Mon, 25 May 2020 20:34:08 +0000 (22:34 +0200)]
[Transforms] Fix typos. NFC
Marek Kurdej [Mon, 25 May 2020 20:26:50 +0000 (22:26 +0200)]
[libc++] [LWG3201] Update status page: lerp should be marked noexcept.
Summary: Update status page and test synopsis. Add synopsis in <cmath>.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D80456
Craig Topper [Mon, 25 May 2020 18:34:09 +0000 (11:34 -0700)]
[X86] Teach combineTruncatedArithmetic to push truncate through subtracts where only one of the inputs is free to truncate.
Fix combineSubToSubus to handle the new DAG to avoid a regression.
There are still regressions in test14/test15/test16. Where it
looks like were trying to set up cases we could match to
umin+trunc+subus but the handling was never finished. The
regression here isn't unique to sub. Its a lost opportunity for
taking an AND with two truncated inputs and producing a larger
AND with a single truncate. The same thing could happen with
any other node we handle in combineTruncatedArithmetic since we
are moving the truncate up the DAG.
Differential Revision: https://reviews.llvm.org/D80483
zoecarver [Sat, 23 May 2020 21:43:12 +0000 (14:43 -0700)]
[libcxx] Fix C++14 and up constexpr members in MoveOnly.
Summary: a4b8ee6 made all MoveOnly members constexpr but, some members and constructors contain expressions that are only valid in C++14 and later. This patch prefixes those methods and constructors with TEST_CONSTEXPR_CXX14.
Reviewers: ldionne, #libc!
Subscribers: dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D80482
LLVM GN Syncbot [Mon, 25 May 2020 18:14:50 +0000 (18:14 +0000)]
[gn build] Port
ba92b274225
Benjamin Kramer [Mon, 25 May 2020 18:13:03 +0000 (20:13 +0200)]
Revert "[PGO] Fix computation of function Hash"
This reverts commit
7c298c104bfe725d4315926a656263e8a5ac3054.
Fails make check-clang.
Failing Tests (8):
Clang :: Profile/c-counter-overflows.c
Clang :: Profile/c-general.c
Clang :: Profile/c-unprofiled-blocks.c
Clang :: Profile/cxx-rangefor.cpp
Clang :: Profile/cxx-throws.cpp
Clang :: Profile/misexpect-switch-default.c
Clang :: Profile/misexpect-switch-nonconst.c
Clang :: Profile/misexpect-switch.c
Jonas Devlieghere [Mon, 25 May 2020 17:59:39 +0000 (10:59 -0700)]
[lldb/Test] Add a trace method to replace print statements.
Many tests use (commented out) print statement for debugging the test
itself. This patch adds a new trace method to lldbtest to reuse the
existing tracing infrastructure and replace these print statements.
Differential revision: https://reviews.llvm.org/D80448
stevewan [Mon, 25 May 2020 17:43:22 +0000 (13:43 -0400)]
[AIX] Add '-bcdtors:all:0:s' to linker to gather static init functions
Summary: On AIX, add '-bcdtors:all:0:s' to the linker implicitly through the driver so that we can collect all static constructor and destructor functions.
Reviewers: hubert.reinterpretcast, Xiangling_L, ZarkoCA, daltenty
Reviewed By: hubert.reinterpretcast
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80415
Dmitry Preobrazhensky [Mon, 25 May 2020 16:55:38 +0000 (19:55 +0300)]
[AMDGPU][MC][GFX8+] Enabled clamp for v_add_u16, v_sub_u16 and v_subrev_u16
See https://bugs.llvm.org/show_bug.cgi?id=45926
Reviewers: arsenm, rampitec, vpykhtin
Differential Revision: https://reviews.llvm.org/D80430
Benjamin Kramer [Sun, 24 May 2020 21:08:27 +0000 (23:08 +0200)]
Make mlir::Value's bool conversion operator explicit
This still allows `if (value)` while requiring an explicit cast when not
in a boolean context. This means things like `std::set<Value>` will no
longer compile.
Differential Revision: https://reviews.llvm.org/D80497
Sergej Jaskiewicz [Tue, 5 May 2020 22:10:57 +0000 (01:10 +0300)]
Re-commit "[cmake] Allow std::filesystem tests in CrossWinToARMLinux.cmake"
https://reviews.llvm.org/D78200 has been re-committed, so we can now
enable building std::filesystem and running tests for it.
Sergej Jaskiewicz [Mon, 25 May 2020 16:08:49 +0000 (19:08 +0300)]
Re-commit "[libc++] [test] Generate static_test_env on the fly"
Don't use std::filesystem APIs for CWDGuard, use POSIX functions
instead. This way the tests don't rely on the correctness of
the functionality they're testing.
Differential Revision: https://reviews.llvm.org/D78200
Denys Petrov [Thu, 9 Apr 2020 13:20:07 +0000 (16:20 +0300)]
[analyzer] Improved RangeSet::Negate support of unsigned ranges
Summary:
This fixes https://bugs.llvm.org/show_bug.cgi?id=41588
RangeSet Negate function shall handle unsigned ranges as well as signed ones.
RangeSet getRangeForMinusSymbol function shall use wider variety of ranges, not only concrete value ranges.
RangeSet Intersect functions shall not produce assertions.
Changes:
Improved safety of RangeSet::Intersect function. Added isEmpty() check to prevent an assertion.
Added support of handling unsigned ranges to RangeSet::Negate and RangeSet::getRangeForMinusSymbol.
Extended RangeSet::getRangeForMinusSymbol to return not only range sets with single value [n,n], but with wide ranges [n,m].
Added unit test for Negate function.
Added regression tests for unsigned values.
Differential Revision: https://reviews.llvm.org/D77802
serge-sans-paille [Thu, 14 May 2020 05:23:10 +0000 (07:23 +0200)]
[PGO] Fix computation of function Hash
Previous implementation was incorrectly passing an uint64_t, that got converted
to an uint8_t, to finalize the hash computation. This led to different functions
having the same hash if they only differ by the remaining statements, which is
incorrect.
Added a new test case that trivially tests that a small function change is
reflected in the hash value.
Not that as this patch fixes the hash computation, it invalidates all hashes
computed before that patch applies, which could be an issue for large build
system that pre-compute the profile data and let client download them as part of
the build process.
Differential Revision: https://reviews.llvm.org/D79961
Dmitry Preobrazhensky [Mon, 25 May 2020 14:45:18 +0000 (17:45 +0300)]
[AMDGPU] Added 'A' constraint for inline assembler
Summary: 'A' constraint requires an immediate int or fp constant that can be inlined in an instruction encoding.
This is the second part of the change. The llvm part has been committed as
b087b91c9170.
See https://reviews.llvm.org/D78494
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D79493
Simon Pilgrim [Mon, 25 May 2020 14:35:47 +0000 (15:35 +0100)]
MustExecute.h - remove unnecessary includes. NFC.
Reduce to forward declarations and fix implicit LoopInfo.h dependency in Attributor.h
Simon Pilgrim [Mon, 25 May 2020 14:33:44 +0000 (15:33 +0100)]
[X86] Add PTEST tests showing failure to extract allsign cases
As discussed on PR42035, we can often use MOVMSK to avoid a cmpgt/ashr by just analysing the extracted signbits.
Shuhong Liu [Mon, 25 May 2020 14:11:55 +0000 (10:11 -0400)]
Add AIX to the test macro-same-context XFAIL list
Summary: Since the integrated assembly parser was not implemented yet for AIX and macro is not part of the native assembly dialect on AIX, the test macro-same-context is expected to fail for AIX; hence added AIX to XFAIL list.
Reviewers: hubert.reinterpretcast, daltenty, jasonliu
Reviewed By: daltenty
Subscribers: jasonliu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80232
Pavel Labath [Mon, 25 May 2020 13:59:48 +0000 (15:59 +0200)]
[lldb] Remove custom DWARF expression printing code
The llvm DWARFExpression dump is nearly identical, but better -- for
example it does print a spurious space after zero-argument expressions.
Some parts of our code (variable locations) have been already switched
to llvm-based expression dumping. This switches the remainder: unwind
plans and some unit tests.
Denys Petrov [Fri, 22 May 2020 10:10:37 +0000 (13:10 +0300)]
[ManagedStatic] Fix build errors with clang-tblgen in Debug mode using MSVC 2019 v16.6
After updating MSVS19 from v16.4 to v16.6 I faced with a build errors compiling in Debug mode.
It complains on clang-tblgen.exe and llvm-tblgen.exe cmd line args.
VS compiler had a bug. It dynamically creates an object with constexpr ctor in Debug mode. This bug was fixed in VS2019 v16.5.
A workaround was implemented for that and everything works until v16.5 comes.
The workaround became irrelevant since v16.5 and caused build errors.
So I disabled the workaround for VS2019 v16.5 and higher.
This relates to http://llvm.org/PR41367.
Differential Revision: https://reviews.llvm.org/D80433
serge-sans-paille [Mon, 25 May 2020 13:56:48 +0000 (15:56 +0200)]
Stack clash: update live-ins
This fixes http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/7150
Whitney Tsang [Mon, 25 May 2020 13:31:57 +0000 (13:31 +0000)]
[LoopUtils] Use llvm::find
Summary: Fixes this build error:
llvm/lib/Transforms/Utils/LoopUtils.cpp:679:26: error: no matching
function for call to 'find'
Loop::iterator I = find(ParentLoop->begin(), ParentLoop->end(),
L);
^~~~
Authored By: orivej
Reviewer: Whitney
Reviewed By: Whitney
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80473
Benjamin Kramer [Mon, 25 May 2020 13:12:08 +0000 (15:12 +0200)]
Make FEATURE_AVX512VP2INTERSECT match between compiler-rt and LLVM
compiler-rt also doesn't support bits >= 64 as far as I know.
Simon Pilgrim [Mon, 25 May 2020 12:59:46 +0000 (13:59 +0100)]
MemoryLocation.h - reduce Instructions.h include to Instruction.h include. NFC.
Add forward declarations for the few Instr classes we reference.
serge-sans-paille [Wed, 6 May 2020 11:42:01 +0000 (13:42 +0200)]
Improve stack-clash implementation on x86
- test both 32 and 64 bit version
- probe the tail in dynamic-alloca
- generate more concise code
Differential Revision: https://reviews.llvm.org/D79482
Simon Pilgrim [Mon, 25 May 2020 12:44:27 +0000 (13:44 +0100)]
MemoryBuiltins.h - remove unnecessary TargetLibraryInfo forward declaration. NFC.
We already have to include TargetLibraryInfo.h
Simon Pilgrim [Mon, 25 May 2020 12:43:20 +0000 (13:43 +0100)]
LoopInfo.h - remove unnecessary PHINode forward declaration. NFC.
This is directly defined in Instructions.h
Simon Pilgrim [Mon, 25 May 2020 12:27:10 +0000 (13:27 +0100)]
InstructionSimplify.h - remove unnecessary includes. NFC.
Remove unused User.h include.
Replace SetVector.h with forward declaration.
Sort the forward declarations + remove FastMathFlags (defined in Operator.h).
Fix implicit SetVector.h dependency in LowerConstantIntrinsics.cpp.
Simon Pilgrim [Mon, 25 May 2020 12:09:30 +0000 (13:09 +0100)]
InlineAdvisor.h - remove unnecessary PreservedAnalyses forward declaration. NFC.
This is directly defined in PassManager.h
Sanjay Patel [Mon, 25 May 2020 11:50:45 +0000 (07:50 -0400)]
[x86] favor vector constant load to avoid GPR to XMM transfer, part 2
This replaces the build_vector lowering code that was just added in
D80013
and matches the pattern later from the x86-specific "vzext_movl".
That seems to result in the same or better improvements and gets rid
of the 'TODO' items from that patch.
AFAICT, we always shrink wider constant vectors to 128-bit on these
patterns, so we still get the implicit zero-extension to ymm/zmm
without wasting space on larger vector constants. There's a trade-off
there because that means we miss potential load-folding.
Similarly, we could load scalar constants here with implicit
zero-extension even to 128-bit. That saves constant space, but it
means we forego load-folding, and so it increases register pressure.
This seems like a good middle-ground between those 2 options.
Differential Revision: https://reviews.llvm.org/D80131
Simon Pilgrim [Mon, 25 May 2020 11:56:44 +0000 (12:56 +0100)]
FunctionLoweringInfo.h - move APInt.h dependency to FunctionLoweringInfo.cpp. NFC.
Simon Pilgrim [Mon, 25 May 2020 11:52:14 +0000 (12:52 +0100)]
FunctionLoweringInfo.h - remove orphan addSEHHandlersForLPads declaration. NFC.
George Mitenkov [Mon, 25 May 2020 11:42:17 +0000 (07:42 -0400)]
Added pow intrinsic to LLVMIR dialect
Added pow intrinsic to LLVMIR dialect. Added a roundrip test for it.
Differential Revision: https://reviews.llvm.org/D80248
Stefan Pintilie [Mon, 25 May 2020 11:32:51 +0000 (06:32 -0500)]
[PowerPC][NFC] Split PPCELFStreamer::emitInstruction
Split off PPCELFStreamer::emitPrefixedInstruction from
PPCELFStreamer::emitInstruction.
Differential Revision: https://reviews.llvm.org/D79626
David Green [Mon, 25 May 2020 11:25:03 +0000 (12:25 +0100)]
[ARM] VMULH tests for when other parts are working. NFC
Xing GUO [Mon, 25 May 2020 11:42:15 +0000 (19:42 +0800)]
[ObjectYAML][DWARF] Remove unimplemented function.
```
StringMap<std::unique_ptr<MemoryBuffer>>
EmitDebugSections(llvm::DWARFYAML::Data &DI, bool ApplyFixups);
```
is unimplemented and unused.
Simon Pilgrim [Mon, 25 May 2020 11:41:08 +0000 (12:41 +0100)]
[DAG] Add SimplifyDemandedVectorElts binop SimplifyMultipleUseDemandedBits handling
For the supported binops (basic arithmetic, logicals + shifts), if we fail to simplify the demanded vector elts, then call SimplifyMultipleUseDemandedBits and try to peek through ops to remove unnecessary dependencies.
This helps with PR40502.
Differential Revision: https://reviews.llvm.org/D79003