Jun Bum Lim [Fri, 27 Apr 2018 18:44:37 +0000 (18:44 +0000)]
[CodeGen] Use RegUnits to track register aliases (NFC)
Summary: Use RegUnits to track register aliases in PostRASink and AArch64LoadStoreOptimizer.
Reviewers: thegameg, mcrosier, gberry, qcolombet, sebpop, MatzeB, t.p.northover, javed.absar
Reviewed By: thegameg, sebpop
Subscribers: javed.absar, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D45695
llvm-svn: 331066
Simon Pilgrim [Fri, 27 Apr 2018 18:19:48 +0000 (18:19 +0000)]
[X86] Split WriteFBlend/WriteFVarBlend/WriteFVarShuffle into XMM and YMM/ZMM scheduler classes
This removes all the WriteFBlend/WriteFVarBlend InstRW overrides - some WriteFVarShuffle remain to be fixed.
llvm-svn: 331065
Rafael Espindola [Fri, 27 Apr 2018 18:17:36 +0000 (18:17 +0000)]
Split .eh_frame sections in parellel.
We can now split them in the same spot we split merge sections.
llvm-svn: 331064
Bruno Cardoso Lopes [Fri, 27 Apr 2018 18:01:23 +0000 (18:01 +0000)]
[Modules][ObjC] ASTReader should add protocols for class extensions
During deserialization clang is currently missing the merging of
protocols into the canonical interface for the class extension.
This merging only currently happens during parsing and should also
be considered during deserialization.
rdar://problem/
38724303
llvm-svn: 331063
Mark Searles [Fri, 27 Apr 2018 17:59:15 +0000 (17:59 +0000)]
[AMDGPU][Waitcnt] Update a few tests to use default waitcnt pass (si-insert-waitcnts) rather than old pass (si-insert-waits); this is a small step towards the overall goal of removing the old waitcnt pass, which is no longer maintained.
Differential Revision: https://reviews.llvm.org/D46154
llvm-svn: 331062
Philip Reames [Fri, 27 Apr 2018 17:41:37 +0000 (17:41 +0000)]
[GuardWidening] Add some clarifying comments about heuristics [NFC]
llvm-svn: 331061
Philip Reames [Fri, 27 Apr 2018 17:29:10 +0000 (17:29 +0000)]
[LoopGuardWidening] Split out a loop pass version of GuardWidening
The idea is to have a pass which performs the same transformation as GuardWidening, but can be run within a loop pass manager without disrupting the pass manager structure. As demonstrated by the test case, this doesn't quite get there because of issues with post dom, but it gives a good step in the right direction. the motivation is purely to reduce compile time since we can now preserve locality during the loop walk.
This patch only includes a legacy pass. A follow up will add a new style pass as well.
llvm-svn: 331060
Sanjay Patel [Fri, 27 Apr 2018 16:33:35 +0000 (16:33 +0000)]
[docs] add fp-cast-overflow-workaround options to release notes
llvm-svn: 331059
Rafael Espindola [Fri, 27 Apr 2018 16:29:57 +0000 (16:29 +0000)]
Split merge sections early.
Now that getSectionPiece is fast (uses a hash) it is probably OK to
split merge sections early.
The reason I want to do this is to split eh_frame sections in the same
place.
This does mean that we have to decompress early. Given that the only
compressed sections are debug info, I don't think we are missing much.
It is a small improvement: 0.5% on the geometric mean.
llvm-svn: 331058
Sanjay Patel [Fri, 27 Apr 2018 16:24:39 +0000 (16:24 +0000)]
[docs] more dashes
llvm-svn: 331057
Sanjay Patel [Fri, 27 Apr 2018 16:21:22 +0000 (16:21 +0000)]
[docs] add -ffp-cast-overflow-workaround to the release notes
This option was added with:
D46135
rL331041
...copying the text from UsersManual.rst for more exposure.
llvm-svn: 331056
Nirav Dave [Fri, 27 Apr 2018 16:16:06 +0000 (16:16 +0000)]
[MC] Undo spurious commit added into r331052.
llvm-svn: 331055
Simon Pilgrim [Fri, 27 Apr 2018 16:11:57 +0000 (16:11 +0000)]
[X86] Split WriteFHadd into XMM and YMM/ZMM scheduler classes
This removes all the HADD/HSUB PS/PD InstRW overrides.
llvm-svn: 331054
Stuart Brady [Fri, 27 Apr 2018 16:11:56 +0000 (16:11 +0000)]
Test commit removing trailing whitespace
llvm-svn: 331053
Nirav Dave [Fri, 27 Apr 2018 16:11:24 +0000 (16:11 +0000)]
[MC] Provide default value for IsResolved.
llvm-svn: 331052
Simon Pilgrim [Fri, 27 Apr 2018 15:50:33 +0000 (15:50 +0000)]
[X86][AVX] Split WriteFLogic into XMM and YMM/ZMM scheduler classes
This removes all the AND/ANDN/OR/XOR PS/PD InstRW overrides.
llvm-svn: 331051
Simon Dardis [Fri, 27 Apr 2018 15:49:49 +0000 (15:49 +0000)]
[mips] Analyze and provide selection patterns microMIPSR6 branches
These branches were previously unanalyzable and unselectable. Add them and
recognize how to generate their inverses.
Reviewers: smaksimovic, atanasyan, abeserminji
Differential Revision: https://reviews.llvm.org/D46113
llvm-svn: 331050
Greg Clayton [Fri, 27 Apr 2018 15:45:58 +0000 (15:45 +0000)]
Always normalize FileSpec paths.
Always normalizing lldb_private::FileSpec paths will help us get a consistent results from comparisons when setting breakpoints and when looking for source files. This also removes a lot of complexity from the comparison routines. Modified the DWARF line table parser to use the normalized compile unit directory if needed.
Differential Revision: https://reviews.llvm.org/D45977
llvm-svn: 331049
Nirav Dave [Fri, 27 Apr 2018 15:45:54 +0000 (15:45 +0000)]
[MC] Modify MCAsmStreamer to always build MCAssembler. NFCI.
llvm-svn: 331048
Nirav Dave [Fri, 27 Apr 2018 15:45:27 +0000 (15:45 +0000)]
[MC] Allow MCAssembler to be constructed without all subcomponents. NFCI.
llvm-svn: 331047
Zaara Syeda [Fri, 27 Apr 2018 15:41:19 +0000 (15:41 +0000)]
[PPC64] Add offset to local entry point when calling functions without plt
PPC64 V2 ABI describes two entry points to a function. The global entry point
sets up the TOC base pointer. When calling a local function, the call should
branch to the local entry point rather than the global entry point.
Section 3.4.1 describes using the 3 most significant bits of the st_other
field to find out how many instructions there are between the local and global
entry point. This patch adds the correct offset required to branch to the local
entry point of a function.
Differential Revision: https://reviews.llvm.org/D45729
llvm-svn: 331046
Rui Ueyama [Fri, 27 Apr 2018 15:32:04 +0000 (15:32 +0000)]
Do not set RequiresNullTerminator. NFC.
When reading object files, we don't need '\0' at end of each file.
llvm-svn: 331045
Francis Visoiu Mistrih [Fri, 27 Apr 2018 15:30:54 +0000 (15:30 +0000)]
[AArch64] Place the first ldp at the end when ReverseCSRRestoreSeq is true
Put the first ldp at the end, so that the load-store optimizer can run
and merge the ldp and the add into a post-index ldp.
This didn't work in case no frame was needed and resulted in code size
regressions.
llvm-svn: 331044
Frederic Riss [Fri, 27 Apr 2018 15:30:09 +0000 (15:30 +0000)]
Mark test as @skipIfOutOfTreeDebugserver
This test will currently fail for people using the system debugserver.
llvm-svn: 331043
Kostya Kortchinsky [Fri, 27 Apr 2018 15:10:50 +0000 (15:10 +0000)]
[CMake] Enable warnings for runtimes
Summary:
`HandleLLVMOptions` adds `-w` to the cflags if `LLVM_ENABLE_WARNINGS` is not on.
With `-w`, `check_cxx_compiler_flag` doesn't error out for unsupported flags
(for example `-mcrc` on x86_64), and those flags end up being detected as
working - and really they aren't.
I am not entirely sure what the best way to solve this is, but setting
`LLVM_ENABLE_WARNINGS` prior to including `HandleLLVMOptions` does the job.
Reviewers: phosek, beanz
Reviewed By: phosek
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D46079
llvm-svn: 331042
Sanjay Patel [Fri, 27 Apr 2018 14:22:48 +0000 (14:22 +0000)]
[Driver, CodeGen] add options to enable/disable an FP cast optimization
As discussed in the post-commit thread for:
rL330437 ( http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20180423/545906.html )
We need a way to opt-out of a float-to-int-to-float cast optimization because too much
existing code relies on the platform-specific undefined result of those casts when the
float-to-int overflows.
The LLVM changes associated with adding this function attribute are here:
rL330947
rL330950
rL330951
Also as suggested, I changed the LLVM doc to mention the specific sanitizer flag that
catches this problem:
rL330958
Differential Revision: https://reviews.llvm.org/D46135
llvm-svn: 331041
Jonas Paulsson [Fri, 27 Apr 2018 14:09:03 +0000 (14:09 +0000)]
[SystemZ] Remove scheduling info from some Pseudo instructions (NFC).
If the MachineInstr uses a custom inserter and is then erased after
instruction selection, there is no use for mapping it to a sched class.
Review: Ulrich Weigand
llvm-svn: 331040
Oliver Stannard [Fri, 27 Apr 2018 14:03:32 +0000 (14:03 +0000)]
[ARM,AArch64] Add intrinsics for dot product instructions
The ACLE spec which describes these intrinsics hasn't been published yet, but
this is based on the final draft which will be published soon, and these have
already been implemented by GCC.
Differential revision: https://reviews.llvm.org/D46109
llvm-svn: 331039
Oliver Stannard [Fri, 27 Apr 2018 13:56:02 +0000 (13:56 +0000)]
[ARM] Add __ARM_FEATURE_DOTPROD pre-defined macro
This adds a pre-defined macro to test if the compiler has support for the
v8.2-A dot rpoduct intrinsics in AArch32 mode.
The AAcrh64 equivalent has already been added by rL330229.
The ACLE spec which describes this macro hasn't been published yet, but this is
based on the final internal draft, and GCC has already implemented this.
Differential revision: https://reviews.llvm.org/D46108
llvm-svn: 331038
Florian Hahn [Fri, 27 Apr 2018 13:52:51 +0000 (13:52 +0000)]
[LoopInterchange] Allow some loops with PHI nodes in the exit block.
We currently support LCSSA PHI nodes in the outer loop exit, if their
incoming values do not come from the outer loop latch or if the
outer loop latch has a single predecessor. In that case, the outer loop latch
will be executed only if the inner loop gets executed. If we have multiple
predecessors for the outer loop latch, it may be executed even if the inner
loop does not get executed.
This is a first step to support the case described in
https://bugs.llvm.org/show_bug.cgi?id=30472
Reviewers: efriedma, karthikthecool, mcrosier
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D43237
llvm-svn: 331037
Oliver Stannard [Fri, 27 Apr 2018 13:45:32 +0000 (13:45 +0000)]
[AArch64] Codegen for v8.2A dot product intrinsics
This adds IR intrinsics for the AArch64 dot-product instructions introduced in
v8.2-A.
Differential revisioon: https://reviews.llvm.org/D46107
llvm-svn: 331036
Benjamin Kramer [Fri, 27 Apr 2018 13:36:05 +0000 (13:36 +0000)]
[NVPTX] Turn on Loop/SLP vectorization
Since PTX has grown a <2 x half> datatype vectorization has become more
important. The late LoadStoreVectorizer intentionally only does loads
and stores, but now arithmetic has to be vectorized for optimal
throughput too.
This is still very limited, SLP vectorization happily creates <2 x half>
if it's a legal type but there's still a lot of register moving
happening to get that fed into a vectorized store. Overall it's a small
performance win by reducing the amount of arithmetic instructions.
I haven't really checked what the loop vectorizer does to PTX code, the
cost model there might need some more tweaks. I didn't see it causing
harm though.
Differential Revision: https://reviews.llvm.org/D46130
llvm-svn: 331035
Simon Pilgrim [Fri, 27 Apr 2018 13:32:42 +0000 (13:32 +0000)]
[X86] Replace some system instruction instregex single matches with instrs entry. NFCI.
llvm-svn: 331034
Aleksandar Beserminji [Fri, 27 Apr 2018 13:30:27 +0000 (13:30 +0000)]
[mips] Fix how compiler fuse instructions to fmadd/fmsub
This patch makes compiler does not fuse fmul and fadd/fsub into
fmadd/fmsub by default. Instead, -fp-contract=fast option can
be used when such behavior is desired.
Differential Revision: https://reviews.llvm.org/D46057
llvm-svn: 331033
Oliver Stannard [Fri, 27 Apr 2018 12:50:40 +0000 (12:50 +0000)]
[ARM] Codegen for v8.2A dot product intrinsics
This adds IR intrinsics for the ARM dot-product instructions introduced in
v8.2-A.
Differential revision: https://reviews.llvm.org/D46106
llvm-svn: 331032
Sam McCall [Fri, 27 Apr 2018 11:59:28 +0000 (11:59 +0000)]
[clangd] Fix unicode handling, using UTF-16 where LSP requires it.
Summary:
The Language Server Protocol unfortunately mandates that locations in files
be represented by line/column pairs, where the "column" is actually an index
into the UTF-16-encoded text of the line.
(This is because VSCode is written in JavaScript, which is UTF-16-native).
Internally clangd treats source files at UTF-8, the One True Encoding, and
generally deals with byte offsets (though there are exceptions).
Before this patch, conversions between offsets and LSP Position pretended
that Position.character was UTF-8 bytes, which is only true for ASCII lines.
Now we examine the text to convert correctly (but don't actually need to
transcode it, due to some nice details of the encodings).
The updated functions in SourceCode are the blessed way to interact with
the Position.character field, and anything else is likely to be wrong.
So I also updated the other accesses:
- CodeComplete needs a "clang-style" line/column, with column in utf-8 bytes.
This is now converted via Position -> offset -> clang line/column
(a new function is added to SourceCode.h for the second conversion).
- getBeginningOfIdentifier skipped backwards in UTF-16 space, which is will
behave badly when it splits a surrogate pair. Skipping backwards in UTF-8
coordinates gives the lexer a fighting chance of getting this right.
While here, I clarified(?) the logic comments, fixed a bug with identifiers
containing digits, simplified the signature slightly and added a test.
This seems likely to cause problems with editors that have the same bug, and
treat the protocol as if columns are UTF-8 bytes. But we can find and fix those.
Reviewers: hokein
Subscribers: klimek, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D46035
llvm-svn: 331029
Alex Bradbury [Fri, 27 Apr 2018 11:50:30 +0000 (11:50 +0000)]
[RISCV] Add remat.ll test case
This test case demonstrates suboptimal codegen due to the fact that simple
constants aren't recognised as rematerialisable.
llvm-svn: 331028
David Green [Fri, 27 Apr 2018 11:29:49 +0000 (11:29 +0000)]
[ARM] Enable misched for R52.
Back when the R52 schedule was added in rL286949, there was no way
to enable machine schedules in ARM for specific cores. Since then a
target feature has been added. This enables the feature for R52,
removing the need to manually specify compiler flags.
llvm-svn: 331027
Sven van Haastregt [Fri, 27 Apr 2018 10:37:04 +0000 (10:37 +0000)]
[OpenCL] Add separate read_only and write_only pipe IR types
SPIR-V encodes the read_only and write_only access qualifiers of pipes,
so separate LLVM IR types are required to target SPIR-V. Other backends
may also find this useful.
These new types are `opencl.pipe_ro_t` and `opencl.pipe_wo_t`, which
replace `opencl.pipe_t`.
This replaces __get_pipe_num_packets(...) and __get_pipe_max_packets(...)
which took a read_only pipe with separate versions for read_only and
write_only pipes, namely:
* __get_pipe_num_packets_ro(...)
* __get_pipe_num_packets_wo(...)
* __get_pipe_max_packets_ro(...)
* __get_pipe_max_packets_wo(...)
These separate versions exist to avoid needing a bitcast to one of the
two qualified pipe types.
Patch by Stuart Brady.
Differential Revision: https://reviews.llvm.org/D46015
llvm-svn: 331026
Mikhail Maltsev [Fri, 27 Apr 2018 09:12:12 +0000 (09:12 +0000)]
[IR] Do not assume that function pointers are aligned
Summary:
The value tracking analysis uses function alignment to infer that the
least significant bits of function pointers are known to be zero.
Unfortunately, this is not correct for ARM targets: the least
significant bit of a function pointer stores the ARM/Thumb state
information (i.e., the LSB is set for Thumb functions and cleared for
ARM functions).
The original approach (https://reviews.llvm.org/D44781) introduced a
new field for function pointer alignment in the DataLayout structure
to address this. But it seems unlikely that optimizations based on
function pointer alignment would bring much benefit in practice to
justify the additional maintenance burden, so this patch simply
assumes that function pointer alignment is always unknown.
Reviewers: javed.absar, efriedma
Reviewed By: efriedma
Subscribers: kristof.beyls, llvm-commits, hfinkel, rogfer01
Differential Revision: https://reviews.llvm.org/D46110
llvm-svn: 331025
Petar Jovanovic [Fri, 27 Apr 2018 09:12:08 +0000 (09:12 +0000)]
[mips] Add support for Virtualization ASE
This includes
Instructions: tlbginv, tlbginvf, tlbgp, tlbgr, tlbgwi, tlbgwr, hypcall
mfgc0, mtgc0, mfhgc0, mthgc0, dmfgc0, dmtgc0,
Assembler directives: .set virt, .set novirt, .module virt, .module novirt
Attribute: virt
.MIPS.abiflags: VZ (0x100)
Patch by Vladimir Stefanovic.
Differential Revision: https://reviews.llvm.org/D44905
llvm-svn: 331024
Dmitry Vyukov [Fri, 27 Apr 2018 08:59:35 +0000 (08:59 +0000)]
tsan: improve "destroy of a locked mutex" reports
1. Allow to suppress by current stack.
We generally allow to suppress by all main stacks.
Current is probably the stack one wants to use to
suppress such reports.
2. Fix last lock stack restoration.
We trimmed shadow value by storing it in u32.
This magically worked for the test that provoked
the report on the main thread. But this breaks
for locks in any other threads.
llvm-svn: 331023
Serguei Katkov [Fri, 27 Apr 2018 08:02:50 +0000 (08:02 +0000)]
[SCEV] Add trivial case handling for umin utilities. NFC.
Reviewers: sanjoy, mkazantsev
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D46175
llvm-svn: 331022
Raphael Isemann [Fri, 27 Apr 2018 07:05:40 +0000 (07:05 +0000)]
Make MultiplexASTDeserializationListener part of the API [NFC]
Summary:
This patch moves the MultiplexASTDeserializationListener declaration into a public header.
We're currently using this multiplexer in the cling interpreter to attach another
ASTDeserializationListener during the execution (so, after the MultiplexConsumer is already
attached which prevents us from attaching more). So far we're doing this by patching clang
and making this class public, but it makes things easier if we make this instead just public in
upstream.
Reviewers: thakis, v.g.vassilev, rsmith, bruno
Reviewed By: bruno
Subscribers: llvm-commits, cfe-commits, v.g.vassilev
Differential Revision: https://reviews.llvm.org/D37475
llvm-svn: 331021
Akira Hatanaka [Fri, 27 Apr 2018 06:57:00 +0000 (06:57 +0000)]
[CodeGen] Avoid destructing a callee-destructued struct type in a
function if a function delegates to another function.
Fix a bug introduced in r328731, which caused a struct with ObjC __weak
fields that was passed to a function to be destructed twice, once in the
callee function and once in another function the callee function
delegates to. To prevent this, keep track of the callee-destructed
structs passed to a function and disable their cleanups at the point of
the call to the delegated function.
This reapplies r331016, which was reverted in r331019 because it caused
an assertion to fail in EmitDelegateCallArg on a windows bot. I made
changes to EmitDelegateCallArg so that it doesn't try to deactivate
cleanups for structs that have trivial destructors (cleanups for those
structs are never pushed to the cleanup stack in EmitParmDecl).
rdar://problem/
39194693
Differential Revision: https://reviews.llvm.org/D45382
llvm-svn: 331020
Akira Hatanaka [Fri, 27 Apr 2018 05:56:55 +0000 (05:56 +0000)]
Revert "[CodeGen] Avoid destructing a callee-destructued struct type in a"
This reverts commit r331016, which broke a windows bot.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11727
llvm-svn: 331019
Fangrui Song [Fri, 27 Apr 2018 05:50:40 +0000 (05:50 +0000)]
[ELF] Fix typo. NFC
llvm-svn: 331018
Richard Smith [Fri, 27 Apr 2018 04:27:26 +0000 (04:27 +0000)]
Fix typo.
llvm-svn: 331017
Akira Hatanaka [Fri, 27 Apr 2018 04:21:51 +0000 (04:21 +0000)]
[CodeGen] Avoid destructing a callee-destructued struct type in a
function if a function delegates to another function.
Fix a bug introduced in r328731, which caused a struct with ObjC __weak
fields that was passed to a function to be destructed twice, once in the
callee function and once in another function the callee function
delegates to. To prevent this, keep track of the callee-destructed
structs passed to a function and disable their cleanups at the point of
the call to the delegated function.
rdar://problem/
39194693
Differential Revision: https://reviews.llvm.org/D45382
llvm-svn: 331016
Serguei Katkov [Fri, 27 Apr 2018 03:56:53 +0000 (03:56 +0000)]
[SCEV] Introduce bulk umin creation utilities
Add new umin creation method which accepts a list of operands.
SCEV does not represents umin which is required in getExact, so
it transforms umin to umax with not. As a result the transformation of
tree of max to max with several operands does not work.
We just use the new introduced method for creation umin from several operands.
Reviewers: sanjoy, mkazantsev
Reviewed By: sanjoy
Subscribers: javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46047
llvm-svn: 331015
Artem Dergachev [Fri, 27 Apr 2018 02:16:03 +0000 (02:16 +0000)]
[analyzer] Fix operator delete[] array-type-sub-expression handling.
Avoid crash when the sub-expression of operator delete[] is of array type.
This is not the same as simply using a delete[] syntax.
We're still not properly calling destructors in this case in the analyzer.
Differential Revision: https://reviews.llvm.org/D46146
llvm-svn: 331014
Richard Smith [Fri, 27 Apr 2018 02:00:13 +0000 (02:00 +0000)]
Parse A::template B as an identifier rather than as a template-id with no
template arguments.
This fixes some cases where we'd incorrectly accept "A::template B" when B is a
kind of template that requires template arguments (in particular, a variable
template or a concept).
llvm-svn: 331013
Jim Ingham [Fri, 27 Apr 2018 01:57:40 +0000 (01:57 +0000)]
Fix a thinko in the iteration over StructuredDataPlugin Create functions.
The code was grabbing the first plugin, and then never getting
another one.
<rdar://problem/
39779438>
llvm-svn: 331012
Matt Morehouse [Fri, 27 Apr 2018 01:48:09 +0000 (01:48 +0000)]
Revert "[SimplifyLibcalls] Replace locked IO with unlocked IO"
This reverts r331002 due to sanitizer bot breakage.
llvm-svn: 331011
Akira Hatanaka [Fri, 27 Apr 2018 01:42:33 +0000 (01:42 +0000)]
[Driver] Don't enable "-fregister-global-dtors-with-atexit" by default
when compiling the kernel or kexts.
Destructors should be registered with atexit by default only when we are
compiling userland code.
llvm-svn: 331010
Petr Hosek [Fri, 27 Apr 2018 01:25:32 +0000 (01:25 +0000)]
Revert "[CMake] Make simple source used for CMake checks a C file"
This reverts commit r331003 which breaks sanitizer bots because of
missing 32-bit libstdc++ library.
llvm-svn: 331009
Eli Friedman [Fri, 27 Apr 2018 00:32:24 +0000 (00:32 +0000)]
[LowerTypeTests] Mark .cfi.jumptable nounwind.
It doesn't unwind, and the wrong marking leads to the creation of an
.eh_frame section when it isn't necessary.
Differential Revision: https://reviews.llvm.org/D46082
llvm-svn: 331008
Eli Friedman [Fri, 27 Apr 2018 00:21:34 +0000 (00:21 +0000)]
[MachineOutliner] Don't outline from functions with a section marking.
The program might have unusual expectations for functions; for example,
the Linux kernel's build system warns if it finds references from .text
to .init.data.
I'm not sure this is something we actually want to make any guarantees
about (there isn't any explicit rule that would disallow outlining
in this case), but we might want to be conservative anyway.
Differential Revision: https://reviews.llvm.org/D46091
llvm-svn: 331007
Sam Clegg [Fri, 27 Apr 2018 00:17:24 +0000 (00:17 +0000)]
typo
llvm-svn: 331006
Sam Clegg [Fri, 27 Apr 2018 00:17:21 +0000 (00:17 +0000)]
[WebAssembly] Section symbols must have local binding
Summary: Also test for symbols information in test/MC/WebAssembly/debug-info.ll.
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D46160
llvm-svn: 331005
Frederic Riss [Fri, 27 Apr 2018 00:09:04 +0000 (00:09 +0000)]
[debugserver] Fix handling of the 'g' packet
LLDB doesn't use this packet so we never hit this, but it looks like
some other projects talk to debugserver and are hitting an assert
(https://github.com/derekparker/delve/issues/1015).
We had an off by 1 in the accounting of the FPU structure sizes.
I added a test that basically just check that 'g' doesn't return
an error (currently it assert in debug builds). I didn't make
it an lldb-server test because it looks like lldb-server doesn't
implement the g packet.
llvm-svn: 331004
Petr Hosek [Thu, 26 Apr 2018 23:35:13 +0000 (23:35 +0000)]
[CMake] Make simple source used for CMake checks a C file
The source being compiled is plain C, but using .cc extension forces it
to be compiled as C++ which requires a working C++ compiler including
C++ library which may not be the case when we're building compiler-rt
together with libcxx as part of runtimes build.
Differential Revision: https://reviews.llvm.org/D46152
llvm-svn: 331003
David Bolvansky [Thu, 26 Apr 2018 22:31:43 +0000 (22:31 +0000)]
[SimplifyLibcalls] Replace locked IO with unlocked IO
Summary: If file stream arg is not captured and source is fopen, we could replace IO calls by unlocked IO ("_unlocked" function variants) to gain better speed,
Reviewers: efriedma, RKSimon, spatel, sanjoy, hfinkel, majnemer
Subscribers: lebedev.ri, llvm-commits
Differential Revision: https://reviews.llvm.org/D45736
llvm-svn: 331002
Matt Davis [Thu, 26 Apr 2018 22:30:40 +0000 (22:30 +0000)]
[MCA] [NFC] Remove unused Index formal from ResourceManager::issueInstruction
Summary: The instruction index was never referenced in the body. Just a minor cleanup.
Reviewers: andreadb
Reviewed By: andreadb
Subscribers: javed.absar, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D46142
llvm-svn: 331001
Shoaib Meenai [Thu, 26 Apr 2018 22:25:04 +0000 (22:25 +0000)]
[ELF] Clarify help wording for --symbol-ordering-file
The input file for this option should contain a list of symbols, not a
list of sections, so explicitly refer to ordering symbols (but keep the
reference to laying out sections, since that's how the option must
operate). Referring to the file itself as the "symbol ordering file" is
consistent with --warn-symbol-ordering and less ambiguous than "symbol
file" (albeit slightly redundant).
Differential Revision: https://reviews.llvm.org/D46099
llvm-svn: 331000
Billy Robert O'Neal III [Thu, 26 Apr 2018 22:18:33 +0000 (22:18 +0000)]
[libcxx] [test] Remove non-portable assertions from filebuf tests
seekoff.pass.cpp:
libc++'s tests are asserting things about the buffer passed to pubsetbuf. [filebuf.virtuals]/12 says that what the filebuf does with the buffer you give it is completely implementation defined. The MSVC++ implementation takes that buffer and hands it off to the CRT (by calling ::setvbuf) and the CRT doesn't necessarily follow the pattern this test wants.
This change simply makes asserts against the buffer's contents use LIBCPP_ASSERT instead of assert.
pbackfail.pass.cpp:
libc++'s tests are asserting about what characters will and will not be available in the putback area. [filebuf.virtuals]/9 says "The function can alter the number of putback positions available as a result of any call." This change LIBCPP_ASSERTS libc++'s behavior, but checks invariants of the putback area independently.
llvm-svn: 330999
Matt Davis [Thu, 26 Apr 2018 21:55:45 +0000 (21:55 +0000)]
[Docs] Escape the @ symbol, so that it appears in documentation output. [NFC]
Summary:
The '@' character is a special character in Doxygen. In a handful of cases we were not escaping this character which resulted in llvm intrinsics not being rendered properly. Specifically, the @llvm part was removed.
For example, see https://llvm.org/doxygen/classllvm_1_1AssumptionCache.html. There are a few references to '.assume' without the @llvm. prefix. This patch corrects this.
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D45981
llvm-svn: 330998
Chandler Carruth [Thu, 26 Apr 2018 21:46:01 +0000 (21:46 +0000)]
[x86] Revert r330322 (& r330323): Lowering x86 adds/addus/subs/subus intrinsics
The LLVM commit introduces a crash in LLVM's instruction selection.
I filed http://llvm.org/PR37260 with the test case.
llvm-svn: 330997
Roman Lebedev [Thu, 26 Apr 2018 21:41:56 +0000 (21:41 +0000)]
[InstCombine][NFC] Regenerate checks in or-xor.ll
llvm-svn: 330996
Reid Kleckner [Thu, 26 Apr 2018 21:13:59 +0000 (21:13 +0000)]
Fix WAsm dwarfdump.ll test on Windows
llvm-svn: 330995
Roman Lebedev [Thu, 26 Apr 2018 21:13:09 +0000 (21:13 +0000)]
[InstCombine][NFC] Regenerate checks in and-or-not.ll
llvm-svn: 330994
Adrian Prantl [Thu, 26 Apr 2018 20:59:58 +0000 (20:59 +0000)]
Revert "Fix a bug that prevents global variables from having a DW_OP_deref."
This reverts commit r3309704 while investigating bot breakage.
llvm-svn: 330993
Sanjoy Das [Thu, 26 Apr 2018 20:52:28 +0000 (20:52 +0000)]
[InstCombine] Simplify Add with remainder expressions as operands.
Summary:
Simplify integer add expression X % C0 + (( X / C0 ) % C1) * C0 to
X % (C0 * C1). This is a common pattern seen in code generated by the XLA
GPU backend.
Add test cases for this new optimization.
Patch by Bixia Zheng!
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: efriedma, craig.topper, lebedev.ri, llvm-commits, jlebar
Differential Revision: https://reviews.llvm.org/D45976
llvm-svn: 330992
Sanjoy Das [Thu, 26 Apr 2018 20:52:27 +0000 (20:52 +0000)]
Add test cases to prepare for the optimization that simplifies Add with
remainder expressions as operands.
Summary:
Add test cases to prepare for the new optimization that Simplifies integer add
expression X % C0 + (( X / C0 ) % C1) * C0 to X % (C0 * C1).
Patch by Bixia Zheng!
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46017
llvm-svn: 330991
Reid Kleckner [Thu, 26 Apr 2018 20:46:50 +0000 (20:46 +0000)]
[asan] Align __asan_global_start so that it works with LLD
Otherwise LLD will not align the .ASAN$GA section start, and
&__asan_globals + 1 will not be the start of the next real ASan global
metadata in .ASAN$GL.
We discovered this issue when attempting to use LLD on Windows in
Chromium: https://crbug.com/837090
llvm-svn: 330990
Reid Kleckner [Thu, 26 Apr 2018 20:34:19 +0000 (20:34 +0000)]
Enable full debug info in the ASan runtime on Windows
Clang-cl supports the -gline-tables-only flag, so we were going down
that path. Honestly, we should just go ahead and enable full codeview
support.
llvm-svn: 330989
Roman Tereshin [Thu, 26 Apr 2018 20:22:17 +0000 (20:22 +0000)]
[GlobalISel] Reporting rules covered as part of the InstructionSelect's debug-only printing
The main goal of this change is to make it much easier to track which
rules are actually covered by Testgen'erated regression tests.
Reviewers: aemerson, dsanders
Differential Revision: https://reviews.llvm.org/D46095
llvm-svn: 330988
Craig Topper [Thu, 26 Apr 2018 20:14:46 +0000 (20:14 +0000)]
[X86] Make __builtin_ia32_readeflags_u32 and __builtin_ia32_writeeflags_u32 only available on 32-bit targets.
These builtins can't be handled by the backend on 64-bit targets. So error up front instead of throwing an isel error.
Fixes PR37225
Differential Revision: https://reviews.llvm.org/D46132
llvm-svn: 330987
Roman Lebedev [Thu, 26 Apr 2018 20:07:17 +0000 (20:07 +0000)]
[InstCombine][NFC] add2.ll: add a few commutative checks.
Fixes some missing test coverage in InstCombineAddSub.cpp, visitAdd()
llvm-svn: 330986
Roman Lebedev [Thu, 26 Apr 2018 20:07:12 +0000 (20:07 +0000)]
[InstCombine][NFC] Autogenerate checks in add2.ll
llvm-svn: 330985
Roman Lebedev [Thu, 26 Apr 2018 20:00:11 +0000 (20:00 +0000)]
[LLD][WASM] Handle WASM_SYMBOL_TYPE_SECTION in toString().
Fixes build. If this is not the desired solution, please revert.
WasmSymbolType was changed in rL330982 / D44184
llvm-svn: 330984
Simon Atanasyan [Thu, 26 Apr 2018 19:55:28 +0000 (19:55 +0000)]
[mips] Accept 32-bit offsets for lb and lbu commands
`lb` and `lbu` commands accepts 16-bit signed offsets. But GAS accepts
larger offsets for these commands. If an offset does not fit in 16-bit
range, `lb` command is translated into lui/lb or lui/addu/lb series.
It's interesting that initially LLVM assembler supported this feature,
but later it was broken.
This patch restores support for 32-bit offsets. It replaces `mem_simm16`
operand for `LB` and `LBu` definitions by the new `mem_simmptr` operand.
This operand is intended to check that offset fits to the same size as
using for pointers. Later we will be able to extend this rule and
accepts 64-bit offsets when it is possible.
Some issues remain:
- The regression also affects LD, SD, LH, LHU commands. I'm going
to fix them by a separate patch.
- GAS accepts any 32-bit values as an offset. Now LLVM accepts signed
16-bit values and this patch extends the range to signed 32-bit offsets.
In other words, the following code accepted by GAS and still triggers
an error by LLVM:
```
lb $4, 0x80000004
# gas
lui a0, 0x8000
lb a0, 4(a0)
```
- In case of 64-bit pointers GAS accepts a 64-bit offset and translates
it to the li/dsll/lb series of commands. LLVM still rejects it.
Probably this feature has never been implemented in LLVM. This issue
is for a separate patch.
```
lb $4, 0x800000001
# gas
li a0, 0x8000
dsll a0, a0, 0x14
lb a0, 4(a0)
```
Differential Revision: https://reviews.llvm.org/D45020
llvm-svn: 330983
Sam Clegg [Thu, 26 Apr 2018 19:27:28 +0000 (19:27 +0000)]
[WebAssembly] Write DWARF data into wasm object file
- Writes ".debug_XXX" into corresponding custom sections.
- Writes relocation records into "reloc.debug_XXX" sections.
Patch by Yury Delendik!
Differential Revision: https://reviews.llvm.org/D44184
llvm-svn: 330982
Matt Arsenault [Thu, 26 Apr 2018 19:21:37 +0000 (19:21 +0000)]
DAG: Fix not legalizing vector fcanonicalizes
If an fcanoncialize was done on a vector type that was legal,
llvm-svn: 330981
Matt Arsenault [Thu, 26 Apr 2018 19:21:32 +0000 (19:21 +0000)]
AMDGPU: Extend extract_vector_elt fneg combine to fabs
Fixes a regression in a future commit.
llvm-svn: 330980
Matt Arsenault [Thu, 26 Apr 2018 19:21:26 +0000 (19:21 +0000)]
AMDGPU: Consolidate SubtargetPredicate definitions
llvm-svn: 330979
Rafael Espindola [Thu, 26 Apr 2018 19:21:07 +0000 (19:21 +0000)]
Delete unused variable.
llvm-svn: 330978
Justin Bogner [Thu, 26 Apr 2018 19:15:25 +0000 (19:15 +0000)]
Specify REQUIRES: default_triple in a few tests
These were all failing when specifying LLVM_DEFAULT_TARGET_TRIPLE=''.
llvm-svn: 330977
Geoff Berry [Thu, 26 Apr 2018 18:50:45 +0000 (18:50 +0000)]
[AArch64] Fix scavenged spill slot base when stack realignment required.
Summary:
Use the FP for scavenged spill slot accesses to prevent corruption of
the callee-save region when the SP is re-aligned.
Based on problem and patch reported by @paulwalker-arm
This is an alternative to solution proposed in D45770
Reviewers: t.p.northover, paulwalker-arm, thegameg, javed.absar
Subscribers: qcolombet, mcrosier, paulwalker-arm, kristof.beyls, rengolin, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D46063
llvm-svn: 330976
Roman Lebedev [Thu, 26 Apr 2018 18:44:37 +0000 (18:44 +0000)]
[NFC][InstCombine] rem.ll: add a few commutative tests.
This closes a gap in missing test coverage in
isKnownToBeAPowerOfTwo() from ValueTracking.cpp
llvm-svn: 330975
Roman Lebedev [Thu, 26 Apr 2018 18:44:32 +0000 (18:44 +0000)]
[NFC][InstCombine] Regenerate rem.ll test
llvm-svn: 330974
Alexander Shaposhnikov [Thu, 26 Apr 2018 18:28:17 +0000 (18:28 +0000)]
[llvm-objcopy] Implement --redefine-sym option
This diff implements --redefine-sym option
for changing the name of a symbol.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D46029
llvm-svn: 330973
Michael Berg [Thu, 26 Apr 2018 18:17:58 +0000 (18:17 +0000)]
augmenting description for fcmp fmf - NFC
llvm-svn: 330972
Sam Clegg [Thu, 26 Apr 2018 18:17:21 +0000 (18:17 +0000)]
[WebAssembly] Add version to linking section (to match llvm-side change)
Differential Revision: https://reviews.llvm.org/D46070
llvm-svn: 330971
Adrian Prantl [Thu, 26 Apr 2018 18:17:04 +0000 (18:17 +0000)]
Fix a bug that prevents global variables from having a DW_OP_deref.
For local variables the first DW_OP_deref is consumed by turning the
location kind into a memeory location, but that only makes sense for
values that are in a register to begin with, which cannot happen for
global variables that are attached to a symbol.
rdar://problem/
39741860
llvm-svn: 330970
Sam Clegg [Thu, 26 Apr 2018 18:15:32 +0000 (18:15 +0000)]
[WebAssembly] Add version to object file metadata
Summary: See https://github.com/WebAssembly/tool-conventions/issues/54
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D46069
llvm-svn: 330969
Andrea Di Biagio [Thu, 26 Apr 2018 18:03:24 +0000 (18:03 +0000)]
[Tablegen] SubtargetEmitter: move the logic that prints predicates for variant scheduling classes to helper functions. NFC
llvm-svn: 330968
Rafael Espindola [Thu, 26 Apr 2018 18:03:04 +0000 (18:03 +0000)]
Add a comment. NFC.
llvm-svn: 330967
Rafael Espindola [Thu, 26 Apr 2018 17:58:58 +0000 (17:58 +0000)]
Replace SharedSymbols with Defined when creating copy relocations.
This is slightly simpler to read IMHO. Now if a symbol has a position
in the file, it is Defined.
The main motivation is that with this a SharedSymbol doesn't need a
section, which reduces the size of SymbolUnion.
With this the peak allocation when linking chromium goes from 568.1 to
564.2 MB.
llvm-svn: 330966
Haicheng Wu [Thu, 26 Apr 2018 17:56:50 +0000 (17:56 +0000)]
[GlobalMerge] Fix a typo
now => know
llvm-svn: 330965