Francis Ricci [Fri, 29 Sep 2017 16:51:50 +0000 (16:51 +0000)]
[test] Enable LeakSanitizer on 64-bit Darwin ASan llvm builds
Summary:
Also disables leak checking on lto tests, due to many leaks reported
in the system's ld64.
Reviewers: kcc, pcc, bogner, kubamracek
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D37781
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314535
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Fri, 29 Sep 2017 16:50:08 +0000 (16:50 +0000)]
[WebAssembly] Allow each data segment to specify its own alignment
Also, add a flags field as we will almost certainly
be needing that soon too.
Differential Revision: https://reviews.llvm.org/D38296
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314534
91177308-0d34-0410-b5e6-
96231b3b80d8
Hongbin Zheng [Fri, 29 Sep 2017 16:32:12 +0000 (16:32 +0000)]
[SimplifyIndVar] Do not fail when we constant fold an IV user to ConstantPointerNull
The type of a SCEVConstant may not match the corresponding LLVM Value.
In this case, we skip the constant folding for now.
TODO: Replace ConstantInt Zero by ConstantPointerNull
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314531
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 29 Sep 2017 16:07:05 +0000 (16:07 +0000)]
AMDGPU: fix bad test exposed by r314522
The test attempts to use -1 as carry-in for v_addc_*.
Before writing r314522, I did actually test this on real hardware,
and found that it doesn't work. So r314522 is correct in restricting
the carry-in operand: just remove those tests to make things pass
again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314530
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 29 Sep 2017 15:55:42 +0000 (15:55 +0000)]
[ThinLTO] Use decimal suffix for promoted values to match demanglers
Summary:
Demanglers such as libiberty know how to strip suffixes of the form
\.[a-zA-Z]+\.\d+, but our current promoted value suffixes are
.llvm.${modulehash}, where the module hash is in hex. Change the
module hash to decimal to allow demanglers to handle this.
Reviewers: danielcdh
Subscribers: llvm-commits, inglorion
Differential Revision: https://reviews.llvm.org/D38405
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314527
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Fri, 29 Sep 2017 15:41:22 +0000 (15:41 +0000)]
[dwarfdump][NFC] Consistent printing of address ranges
This implement the insertion operator for DWARF address ranges so they
are consistently printed as [LowPC, HighPC).
While a dump method might have felt more consistent, it is used
exclusively for printing error messages in the verifier and never used
for actual dumping. Hence this approach is more intuitive and creates
less clutter at the call sites.
Differential revision: https://reviews.llvm.org/D38395
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314523
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Fri, 29 Sep 2017 15:37:31 +0000 (15:37 +0000)]
AMDGPU: VALU carry-in and v_cndmask condition cannot be EXEC
The hardware will only forward EXEC_LO; the high 32 bits will be zero.
Additionally, inline constants do not work. At least,
v_addc_u32_e64 v0, vcc, v0, v1, -1
which could conceivably be used to combine (v0 + v1 + 1) into a single
instruction, acts as if all carry-in bits are zero.
The llvm.amdgcn.ps.live test is adjusted; it would be nice to combine
s_mov_b64 s[0:1], exec
v_cndmask_b32_e64 v0, v1, v2, s[0:1]
into
v_mov_b32 v0, v3
but it's not particularly high priority.
Fixes dEQP-GLES31.functional.shaders.helper_invocation.value.*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314522
91177308-0d34-0410-b5e6-
96231b3b80d8
Jun Bum Lim [Fri, 29 Sep 2017 14:50:16 +0000 (14:50 +0000)]
Use the basic cost if a GEP is not used as addressing mode
Summary:
Currently, getGEPCost() returns TCC_FREE whenever a GEP is a legal addressing mode in the target.
However, since it doesn't check its actual users, it will return FREE even in cases
where the GEP cannot be folded away as a part of actual addressing mode.
For example, if an user of the GEP is a call instruction taking the GEP as a parameter,
then the GEP may not be folded in isel.
Reviewers: hfinkel, efriedma, mcrosier, jingyue, haicheng
Reviewed By: hfinkel
Subscribers: javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D38085
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314517
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Fri, 29 Sep 2017 14:31:39 +0000 (14:31 +0000)]
[SystemZ] implement shouldCoalesce()
Implement shouldCoalesce() to help regalloc avoid running out of GR128
registers.
If a COPY involving a subreg of a GR128 is coalesced, the live range of the
GR128 virtual register will be extended. If this happens where there are
enough phys-reg clobbers present, regalloc will run out of registers (if
there is not a single GR128 allocatable register available).
This patch tries to allow coalescing only when it can prove that this will be
safe by checking the (local) interval in question.
Review: Ulrich Weigand, Quentin Colombet
https://reviews.llvm.org/D37899
https://bugs.llvm.org/show_bug.cgi?id=34610
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314516
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Sep 2017 14:13:47 +0000 (14:13 +0000)]
Fix spelling in comments. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314515
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Fri, 29 Sep 2017 13:53:44 +0000 (13:53 +0000)]
[X86] Improve codegen for inverted overflow checking intrinsics.
Adds a new combine for: xor(setcc cc, val), 1 --> setcc (invert(cc), val)
Differential Revision: https://reviews.llvm.org/D38161
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314514
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Fri, 29 Sep 2017 13:11:33 +0000 (13:11 +0000)]
[ARM] v8.3-a complex number support
New instructions are added to AArch32 and AArch64 to aid
floating-point multiplication and addition of complex numbers, where
the complex numbers are packed in a vector register as a pair of
elements. The Imaginary part of the number is placed in the more
significant element, and the Real part of the number is placed in the
less significant element.
This patch adds assembler for the ARM target.
Differential Revision: https://reviews.llvm.org/D36789
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314511
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Fri, 29 Sep 2017 12:45:54 +0000 (12:45 +0000)]
Small modification <NFC>
Change-Id: I360abccee12cae29bd2ac4f8399c9ecc92eb7f13
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314510
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Sep 2017 11:42:05 +0000 (11:42 +0000)]
Fix Wmismatched-tags warning.
InlineAsmIdentifierInfo was declared a class in some places and a class in others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314508
91177308-0d34-0410-b5e6-
96231b3b80d8
Aleksandar Beserminji [Fri, 29 Sep 2017 11:05:02 +0000 (11:05 +0000)]
[mips] Reordering callseq* nodes to be linear
Fix nested callseq* nodes by moving callseq_start after the
arguments calculation to temporary registers, so that callseq* nodes
in resulting DAG are linear.
Recommitting r314497. This version does not contain test which fails
when compiler is not build in debug mode.
Differential Revision: https://reviews.llvm.org/D37328
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314507
91177308-0d34-0410-b5e6-
96231b3b80d8
Aleksandar Beserminji [Fri, 29 Sep 2017 10:52:03 +0000 (10:52 +0000)]
Revert "[mips] Reordering callseq* nodes to be linear"
Added test relies on the compiler being built in debug mode,
which may not be the case.
This reverts commit r314497.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314506
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Fri, 29 Sep 2017 10:08:06 +0000 (10:08 +0000)]
[mips] Add missing license info, formatting changes. NFCI
Add missing license information to MicroMipsInstrFPU.td and
fix most of the formatting errors present. Others will be
addressed in a follow up commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314505
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 29 Sep 2017 10:02:01 +0000 (10:02 +0000)]
[X86][SSE] Added more tests for vector multiplications as utility for D37896
Added additional tests for vector multiplications with multipliers that are:
* powers of 2 displaced by 1,
* product of a power of 2 displaced by one with another power of 2.
Patch by @pacxx (Michael Haidl)
Differential Revision: https://reviews.llvm.org/D38350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314504
91177308-0d34-0410-b5e6-
96231b3b80d8
Aleksandar Beserminji [Fri, 29 Sep 2017 09:53:24 +0000 (09:53 +0000)]
[mips] Add test cases for dext/dins family of instructions
Add missing test cases for dext, dextm, dextu, dins, dinsm and
dinsu instructions.
Differential Revision: https://reviews.llvm.org/D37741
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314503
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Renouf [Fri, 29 Sep 2017 09:51:22 +0000 (09:51 +0000)]
[AMDGPU] calling conventions for AMDPAL OS type
Summary:
This commit adds comments on how the AMDPAL OS type overloads the
existing AMDGPU_ calling conventions used by Mesa, and adds a couple of
new ones.
Reviewers: arsenm, nhaehnle, dstuttard
Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D37752
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314502
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Renouf [Fri, 29 Sep 2017 09:49:35 +0000 (09:49 +0000)]
[AMDGPU] AMDPAL scratch buffer support
Summary:
Added support for scratch (including spilling) for OS type amdpal:
generates code to set up the scratch descriptor if it is needed.
With amdpal, the scratch resource descriptor is loaded from offset 0 of
the global information table. The low 32 bits of the address of the
global information table is passed in s0.
Added amdgpu-git-ptr-high function attribute to hard-wire the high 32
bits of the address of the global information table. If the function
attribute is not specified, or is 0xffffffff, then the backend generates
code to use the high 32 bits of pc.
The documentation for the AMDPAL ABI will be added in a later commit.
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye
Differential Revision: https://reviews.llvm.org/D37483
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314501
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Renouf [Fri, 29 Sep 2017 09:48:12 +0000 (09:48 +0000)]
[Triple] Add AMDPAL operating system type
Summary:
This operating system type represents the AMDGPU PAL runtime, and will
be required by the AMDGPU backend in order to generate correct code for
this runtime.
Currently it generates the same code as not specifying an OS at all.
That will change in future commits.
Patch from Tim Corringham.
Subscribers: arsenm, nhaehnle
Differential Revision: https://reviews.llvm.org/D37380
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314500
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Fri, 29 Sep 2017 09:33:31 +0000 (09:33 +0000)]
[dwarfdump][NFC] Consistent errors and warnings with --verify
This patch introduces 3 helper functions: error(), warn() and note() to
make printing during verification more consistent. When supported, the
respective prefixes are printed in color using the same color scheme as
clang.
Differential revision: https://reviews.llvm.org/D38368
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314498
91177308-0d34-0410-b5e6-
96231b3b80d8
Aleksandar Beserminji [Fri, 29 Sep 2017 09:32:14 +0000 (09:32 +0000)]
[mips] Reordering callseq* nodes to be linear
Fix nested callseq* nodes by moving callseq_start after the
arguments calculation to temporary registers, so that callseq* nodes
in resulting DAG are linear.
Differential Revision: https://reviews.llvm.org/D37328
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314497
91177308-0d34-0410-b5e6-
96231b3b80d8
Coby Tayree [Fri, 29 Sep 2017 07:02:46 +0000 (07:02 +0000)]
[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions
Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized.
supersedes D33278, D35774
Differential Revision: https://reviews.llvm.org/D37412
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314493
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 29 Sep 2017 05:20:53 +0000 (05:20 +0000)]
Make find_opt_files vararg
This is slightly less verbose for the common case of a single build directory
and more intuitive when using this API directly from the interpreter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314491
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 29 Sep 2017 05:03:43 +0000 (05:03 +0000)]
[ORC] Replace decltype with a concrete type to make MSVC happy.
This should fix some build failures on windows bots due to r314486.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314490
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Fri, 29 Sep 2017 02:48:07 +0000 (02:48 +0000)]
[CMake] Fix typo "Wraning" (NFC)
Summary:
The typo was added in https://reviews.llvm.org/rL247151.
It should be "warning", not "wraning".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314486
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 29 Sep 2017 02:45:44 +0000 (02:45 +0000)]
llvm-readobj: fix a few typos (NFC)
Correct the spelling of multiple in a couple of sites.
Patch by Alex Langford!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314485
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 29 Sep 2017 00:54:16 +0000 (00:54 +0000)]
Revert "[BypassSlowDivision] Improve our handling of divisions by constants"
This reverts commit r314253. It causes a miscompile on P100 in an internal
benchmark. Reverting while I investigate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314482
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 29 Sep 2017 00:52:33 +0000 (00:52 +0000)]
llvm-dwarfdump: support .apple-namespaces in --find
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314481
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Fri, 29 Sep 2017 00:33:57 +0000 (00:33 +0000)]
[llvm-rc] Import all make_unique invocations from llvm namespace.
Previous patch fixed one of LLVM buildbots (lld-x86_64-win7).
However, some others have already been failing because of make_unique
compilation error (llvm-clang-x86_64-expensive-checks-win).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314480
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 29 Sep 2017 00:33:22 +0000 (00:33 +0000)]
llvm-dwarfdump: add support for .apple_types in --find
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314479
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Fri, 29 Sep 2017 00:14:18 +0000 (00:14 +0000)]
[llvm-rc] Add user-defined resources parsing ability. [8/8]
This allows llvm-rc to parse user-defined resources (ref:
msdn.microsoft.com/en-us/library/windows/desktop/
aa381054.aspx).
These statements either import files, or put the specified raw data in
the resulting resource file.
Thanks to Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D37033
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314478
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Thu, 28 Sep 2017 23:53:25 +0000 (23:53 +0000)]
[llvm-rc] Add integer expressions parsing ability. [7/8]
This allows the ints to be written as integer expressions evaluating to
unsigned 16-bit/32-bit integers.
All the expressions may use the following operators: + - & | ~, and
parentheses. Minus token - can be also unary. There is no precedence of
the operators other than the unary operators binding stronger than their
binary counterparts.
Differential Revision: https://reviews.llvm.org/D37022
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314477
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Thu, 28 Sep 2017 23:39:36 +0000 (23:39 +0000)]
[MachineOutliner][NFC] Simplify logic in pruneCandidates
This commit yanks out the repeated sections of code in pruneCandidates into
two lambdas: ShouldSkipCandidate and Prune. This simplifies the logic in
pruneCandidates significantly, and reduces the chance of introducing bugs by
folding all of the shared logic into one place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314475
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 23:35:36 +0000 (23:35 +0000)]
[X86] Don't select (cmp (and, imm), 0) to testw
Summary:
X86ISelDAGToDAG tries to analyze ANDs compared with 0 to optimize to narrower immediates using subregisters.
I don't think we should be optimizing to 16-bit test instructions. It goes against our normal behavior of promoting i16 operations to i32. It only saves one byte due to the need to add a 0x66 prefix. I think it would also be subject to a length changing prefix penalty in the decoders on Intel CPUs.
Reviewers: RKSimon, zvi, spatel
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38273
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314474
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Thu, 28 Sep 2017 23:12:53 +0000 (23:12 +0000)]
[llvm-rc] Fix-up for r314468 (argument-dependent lookup in make_unique).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314472
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Sep 2017 23:12:06 +0000 (23:12 +0000)]
ARM: Fix cases where CSI Restored bit is not cleared
LR is an untypical callee saved register in that it is restored into a
different register (PC) and thus does not live-out of the return block.
This case requires the `Restored` flag in CalleeSavedInfo to be cleared.
This fixes a number of cases where this wasn't handled correctly yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314471
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Thu, 28 Sep 2017 22:47:34 +0000 (22:47 +0000)]
bpf: fix a bug for disassembling ld_pseudo inst
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314469
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Thu, 28 Sep 2017 22:41:38 +0000 (22:41 +0000)]
[llvm-rc] Add VERSIONINFO parsing ability. [6/8]
This extends the set of llvm-rc parser's available resources by
another one, VERSIONINFO.
Ref: msdn.microsoft.com/en-us/library/windows/desktop/
aa381058.aspx
Thanks to Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D37021
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314468
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Thu, 28 Sep 2017 22:27:31 +0000 (22:27 +0000)]
[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314467
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Sep 2017 22:27:25 +0000 (22:27 +0000)]
[x86] add tests for possible insertelement to shuffle transform; NFC
See PR34716 and D38316 for more discussion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314466
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 28 Sep 2017 22:08:25 +0000 (22:08 +0000)]
[SystemZ] Fix fall-out from r314428
The expensive-checks build bot found a problem with the r314428 commit:
if CC is live after a ATOMIC_CMP_SWAPW instruction, it needs to be
marked as live-in to the block after the loop the pseudo gets expanded
to. This actually fixes a code-gen bug as well, since if the CC isn't
live, the CR and JLH are merged to a CRJLH which doesn't actually set
the condition code any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314465
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 20:10:34 +0000 (20:10 +0000)]
[X86] Make use of vpmovwb when possible in LowerMULH
If we have BWI, we can truncate in a much simpler way by using vpmovwb. This even works without VLX by using the wider zmm->ymm truncate with a subvector extract.
Differential Revision: https://reviews.llvm.org/D38375
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314457
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 28 Sep 2017 19:43:53 +0000 (19:43 +0000)]
Fix -Werror build.
/code/llvm-project/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp:260:38: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
[this](decltype(ObjLayer)::ObjHandleT,
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314454
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Thu, 28 Sep 2017 19:04:30 +0000 (19:04 +0000)]
[ARM] Restore the right frame pointer register in Int_eh_sjlj_longjmp
In setupEntryBlockAndCallSites in CodeGen/SjLjEHPrepare.cpp,
we fetch and store the actual frame pointer, but on return via
the longjmp intrinsic, it always was restored into the r7 variable.
On windows, the frame pointer should be restored into r11 instead of r7.
On Darwin (where sjlj exception handling is used by default), the frame
pointer is always r7, both in arm and thumb mode, and likewise, on
windows, the frame pointer always is r11.
On linux however, if sjlj exception handling is enabled (which it isn't
by default), libcxxabi and the user code can be built in differing modes
using different registers as frame pointer. Therefore, when restoring
registers on a platform where we don't always use the same register
depending on code mode, restore both r7 and r11.
Differential Revision: https://reviews.llvm.org/D38253
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314451
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Thu, 28 Sep 2017 19:04:14 +0000 (19:04 +0000)]
[ARM] Fix SJLJ exception handling when manually chosen on a platform where it isn't default
Differential Revision: https://reviews.llvm.org/D38252
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314450
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Sep 2017 18:52:14 +0000 (18:52 +0000)]
MIR: Serialize CaleeSavedInfo Restored flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314449
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 18:45:29 +0000 (18:45 +0000)]
[AVX512] Add avx512bw command lines to 128-bit idiv tests.
The multiply lowering on some of the tests can take advantage of the vpmovwb to simplify the truncate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314448
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 18:45:28 +0000 (18:45 +0000)]
[X86] Use target independent ZERO_EXTEND/SIGN_EXTEND nodes were possible in LowerMULH
We aren't do any in register extends here so we should be able to just the target independent nodes directly and allow them to be lowered as necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314447
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 18:45:27 +0000 (18:45 +0000)]
[X86] Move a setOperation action for ISD::TRUNCATE near another one in the same if. Remove one that is redundant with another subtarget features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314446
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 28 Sep 2017 18:31:51 +0000 (18:31 +0000)]
Address further review feedback. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314443
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 28 Sep 2017 18:27:00 +0000 (18:27 +0000)]
try and appease gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314442
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 28 Sep 2017 18:10:52 +0000 (18:10 +0000)]
llvm-dwarfdump: implement --find for .apple_names
This patch implements the dwarfdump option --find=<name>. This option
looks for a DIE in the accelerator tables and dumps it if found. This
initial patch only adds support for .apple_names to keep the review
small, adding the other sections and pubnames support should be
trivial though.
Differential Revision: https://reviews.llvm.org/D38282
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314439
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 28 Sep 2017 17:43:07 +0000 (17:43 +0000)]
[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.
Bug found by Stefan Granitz. Thanks Stefan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314436
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Thu, 28 Sep 2017 17:24:40 +0000 (17:24 +0000)]
[JumpThreading] Preserve DT and LVI across the pass
JumpThreading now preserves dominance and lazy value information across the
entire pass. The pass manager is also informed of this preservation with
the goal of DT and LVI being recalculated fewer times overall during
compilation.
This change prepares JumpThreading for enhanced opportunities; particularly
those across loop boundaries.
Patch by: Brian Rzycki <b.rzycki@samsung.com>,
Sebastian Pop <s.pop@samsung.com>
Differential revision: https://reviews.llvm.org/D37528
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314435
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 17:00:21 +0000 (17:00 +0000)]
[X86] Use BWI instructions to improve lowering of v32i8 MULHU/S
Summary: If we have BWI instructions we can widen to v32i16 to do the multiply instead of splitting.
Reviewers: RKSimon, spatel, zvi
Reviewed By: zvi
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38305
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314432
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 16:56:36 +0000 (16:56 +0000)]
[X86] Remove dead code from X86ISelDAGToDAG.cpp multiply handling
Summary:
Lowering never creates X86ISD::UMUL for 8-bit types. X86ISD::UMUL8 is used instead. If X86ISD::UMUL 8-bit were ever used it would crash.
DAGCombiner replaces UMUL_LOHI/SMUL_LOHI with a wider MUL and a shift if the type twice as wide is legal. So we should never see i8 UMUL_LOHI/SMUL_LOHI. In fact I think there was a bug in part of the i8 code. Similar is true for i16 though without the bug.
Reviewers: RKSimon, spatel, zvi
Reviewed By: zvi
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38276
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314430
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 Sep 2017 16:53:16 +0000 (16:53 +0000)]
[X86] Use correct subvector index when combining two insert subvectors featuring zero vectors.
Previously we were using one of the subvector indices twice. The included test case causes an assert without this change.
Thanks to Simon Pilgrim for catching this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314429
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 28 Sep 2017 16:22:54 +0000 (16:22 +0000)]
[SystemZ] Custom-expand ATOMIC_CMP_AND_SWAP_WITH_SUCCESS
The SystemZ compare-and-swap instructions already provide the "success"
indication via a condition-code value, so the default expansion of those
operations generates an unnecessary extra comparsion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314428
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 28 Sep 2017 15:57:50 +0000 (15:57 +0000)]
[dwarfdump] Verify that CUs have a unit DIE.
This patch adds a check to the DWARF verifier to detect CUs without a
unit DIE.
Differential revision: https://reviews.llvm.org/D38363
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314426
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 28 Sep 2017 15:53:27 +0000 (15:53 +0000)]
Use SDValue::getConstantOperandVal helper. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314425
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 28 Sep 2017 15:24:07 +0000 (15:24 +0000)]
[mips] Remove codegen support for branch likely instructions.
This patch disables codegen support for branch likely instructions to
address a potential bug. These branches were unselectable as
they had the same patterns as the normal branches but came after them
when ISel was concerned.
The branch likely instructions were marked as having no delay
slots when they have annulling delay slots. The delay slot filler
does not currently handle annulling delay slot branches, so this
would lead to wrong codegen if these branches were generated.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D38169
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314421
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 28 Sep 2017 15:16:37 +0000 (15:16 +0000)]
Docs: fix link to Debugger intrinsic functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314420
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 Sep 2017 14:47:39 +0000 (14:47 +0000)]
[LoopUnroll] Fix use after poison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314418
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Thu, 28 Sep 2017 13:43:48 +0000 (13:43 +0000)]
[X86] Add overflow intrinsic test in preparation for D38161.
This commit adds the test file before codegen changes as requested in
D38161 to make it easier to see the difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314416
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Thu, 28 Sep 2017 13:10:06 +0000 (13:10 +0000)]
[DebugInfo] Do not extend range for physreg in LiveDebugVariables
Summary:
A DBG_VALUE that is referring to a physical register is
valid up until the next def of the register, or the end
of the basic block that it belongs to.
LiveDebugVariables is computing live intervals (slot index
ranges) for DBG_VALUE instructions, before regalloc, in order
to be able to re-insert DBG_VALUE instructions again after
regalloc. When the DBG_VALUE is mapping a variable to a
physical register we do not need to compute the range. We
should simply re-insert the DBG_VALUE at the start position.
The problem that was found, resulting in this patch, was a
situation when the DBG_VALUE was the last real use of the
physical register. The computeIntervals/extendDef methods
extended the range to cover the whole basic block, even though
the physical register very well could be allocated to some
virtual register inside the basic block. So the extended
range could not be trusted.
This patch is a preparation for https://reviews.llvm.org/D38229,
where the goal is to insert DBG_VALUE after each new definition
of a variable, even if the virtual registers that the variable
was connected to has been coalesced into using the same physical
register (e.g. due to two address instructions). For more info
see https://bugs.llvm.org/show_bug.cgi?id=34545
Reviewers: aprantl, rnk, echristo
Reviewed By: aprantl
Subscribers: Ka-Ka, llvm-commits
Differential Revision: https://reviews.llvm.org/D38140
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314414
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 Sep 2017 12:53:20 +0000 (12:53 +0000)]
[LoopInfo] Don't poison random memory regions.
The second argument for Allocator::Deallocate is the number of elements,
not the size of a single element. In asan mode specifying a large number
of elements poisoned random memory regions, leading to crashes
everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314413
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 28 Sep 2017 11:09:22 +0000 (11:09 +0000)]
[LVI] Move LVILatticeVal class to separate header file (NFC).
Summary:
This allows sharing the lattice value code between LVI and SCCP (D36656).
It also adds a `satisfiesPredicate` function, used by D36656.
Reviewers: davide, sanjoy, efriedma
Reviewed By: sanjoy
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D37591
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314411
91177308-0d34-0410-b5e6-
96231b3b80d8
Coby Tayree [Thu, 28 Sep 2017 11:04:08 +0000 (11:04 +0000)]
[x86][AsmParser] Allow some more MS size directives
MS allows the following size directives: float/double and long as synonymous to dword/qword and dword, respectively.
Differential Revision: https://reviews.llvm.org/D37190
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314410
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Eveson [Thu, 28 Sep 2017 10:07:30 +0000 (10:07 +0000)]
[llvm-cov] Create directory structure when filtering using -name*= options
Before this change using any of the -name*= command line options with an output
directory would result in a single file (functions.txt/functions.html)
containing the coverage for those specific functions. Now you get the same
directory structure as when not using any -name*= options.
Differential Revision: https://reviews.llvm.org/D38280
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314396
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 28 Sep 2017 09:31:46 +0000 (09:31 +0000)]
Teach TargetInstrInfo::getInlineAsmLength to parse .space directives with integer arguments
It's currently quite difficult to test passes like branch relaxation, which
requires branches with large displacement to be generated. The .space assembler
directive makes it easy to create arbitrarily large basic blocks, but
getInlineAsmLength is not able to parse it and so the size of the block is not
correctly estimated. Other backends (AArch64, AMDGPU) introduce options just
for testing that artificially restrict the ranges of branch instructions (e.g.
aarch64-tbz-offset-bits). Although parsing a single form of the .space
directive feels inelegant, it does allow a more direct testing approach.
This patch adapts the .space parsing code from
Mips16InstrInfo::getInlineAsmLength and removes it now the extra functionality
is provided by the base implementation. I want to move this functionality to
the generic getInlineAsmLength as 1) I need the same for RISC-V, and 2) I feel
other backends will benefit from more direct testing of large branch
displacements.
Differential Revision: https://reviews.llvm.org/D37798
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314393
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Thu, 28 Sep 2017 08:38:19 +0000 (08:38 +0000)]
[PowerPC] eliminate partially redundant compare instruction
This is a follow-on of D37211.
D37211 eliminates a compare instruction if two conditional branches can be made based on the one compare instruction, e.g.
if (a == 0) { ... }
else if (a < 0) { ... }
This patch extends this optimization to support partially redundant cases, which often happen in while loops.
For example, one compare instruction is moved from the loop body into the preheader by this optimization in the following example.
do {
if (a == 0) dummy1();
a = func(a);
} while (a > 0);
Differential Revision: https://reviews.llvm.org/D38236
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314390
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 28 Sep 2017 08:26:24 +0000 (08:26 +0000)]
[RISCV] Add common fixups and relocations
%lo(), %hi(), and %pcrel_hi() are supported and test cases have been added to
ensure the appropriate fixups and relocations are generated. I've added an
instruction format field which is used in RISCVMCCodeEmitter to, for
instance, tell whether it should emit a lo12_i fixup or a lo12_s fixup
(RISC-V has two 12-bit immediate encodings depending on the instruction
type).
Differential Revision: https://reviews.llvm.org/D23568
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314389
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikael Holmen [Thu, 28 Sep 2017 08:22:35 +0000 (08:22 +0000)]
[RegAllocGreedy]: Allow recoloring of done register if it's non-tied
Summary:
If we have a non-allocated register, we allow us to try recoloring of an
already allocated and "Done" register, even if they are of the same
register class, if the non-allocated register has at least one tied def
and the allocated one has none.
It should be easier to recolor the non-tied register than the tied one, so
it might be an improvement even if they use the same regclasses.
Reviewers: qcolombet
Reviewed By: qcolombet
Subscribers: llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D38309
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314388
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 28 Sep 2017 07:54:01 +0000 (07:54 +0000)]
[RISCV] Define RISC-V specific e_flags
Add RISC-V e_flags as defined in the ABI document:
https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#file-header
Differential Revision: https://reviews.llvm.org/D38310
Patch by Chih-Mao Chen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314386
91177308-0d34-0410-b5e6-
96231b3b80d8
Jatin Bhateja [Thu, 28 Sep 2017 07:40:52 +0000 (07:40 +0000)]
[X86] Adding more cases to horizontal [f]add/[f]sub for avx512.
Reviewers: jbhateja
Reviewed By: jbhateja
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38344
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314385
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Thu, 28 Sep 2017 06:17:19 +0000 (06:17 +0000)]
[DAGCombiner] Fix an off-by-one error in vector logic
Without this, we could end up trying to get the Nth (0-indexed) element
from a subvector of size N.
Differential Revision: https://reviews.llvm.org/D37880
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314380
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Thu, 28 Sep 2017 02:46:11 +0000 (02:46 +0000)]
bpf: add new insns for bswap_to_le and negation
This patch adds new insn, "reg = be16/be32/be64 reg",
for bswap to little endian for big-endian target (bpfeb).
It also adds new insn for negation "reg = -reg".
Currently, for source code, e.g.,
b = -a
LLVM still prefers to generate:
b = 0 - a
But "reg = -reg" format can be used in assembly code.
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314376
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 28 Sep 2017 02:45:42 +0000 (02:45 +0000)]
Use a BumpPtrAllocator for Loop objects
Summary:
And now that we no longer have to explicitly free() the Loop instances, we can
(with more ease) use the destructor of LoopBase to do what LoopBase::clear() was
doing.
Reviewers: chandlerc
Subscribers: mehdi_amini, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D38201
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314375
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 28 Sep 2017 02:17:35 +0000 (02:17 +0000)]
[ORC] Update the GlobalMappingLayer interface to fit the error-ized layer
concept.
Add a unit-test to make sure we don't backslide, and tweak the MockBaseLayer
utility to make it easier to test this kind of thing in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314374
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Thu, 28 Sep 2017 00:27:39 +0000 (00:27 +0000)]
Fix a UBsan bot.
If we do not initialize Prefix here, Prefix.data() returns a nullptr.
Later, it is passed to memcpy. memcpy's behavior is undefined if src (or
dst) is a nullptr even if a given size is 0. That's why this code
triggered UBsan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314368
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Wed, 27 Sep 2017 23:26:01 +0000 (23:26 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314363
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Wed, 27 Sep 2017 23:16:56 +0000 (23:16 +0000)]
Check for overflows when calculating the offset in GetGEPCost.
Summary:
This avoids C++ UB if the GEP is weird and the calculation overflows
int64_t, and it's also observable in the cost model's results.
Such GEPs are almost surely not valid pointers, but LLVM nonetheless
generates them sometimes.
Reviewers: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38337
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314362
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Wed, 27 Sep 2017 23:09:14 +0000 (23:09 +0000)]
Reverted r313993.
This patch produces a crash and hexagon_vector_loop_carried_reuse_constant.ll test fails on Windows (llvm-clang-x86_64-expensive-checks-win build bot).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314361
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 27 Sep 2017 22:57:18 +0000 (22:57 +0000)]
Revert r314017 '[InstCombine] Simplify check for RHS being a splat constant in foldICmpUsingKnownBits by just checking Op1Min==Op1Max rather than going through m_APInt.'
This reverts r314017 and similar code added in later commits. It seems to not work for pointer compares and is causing a bot failure for the last several days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314360
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Wed, 27 Sep 2017 22:39:37 +0000 (22:39 +0000)]
Update the description of AVR32 for the ELFDumper
AVR32 is an unrelated architecture with 32-bit addressing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314359
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 27 Sep 2017 22:03:15 +0000 (22:03 +0000)]
Fix -Wunused-variable for Release build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314353
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 27 Sep 2017 21:45:22 +0000 (21:45 +0000)]
Return the LoopUnrollResult from tryToUnrollLoop; NFC
I will use this in a later change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314352
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 27 Sep 2017 21:45:21 +0000 (21:45 +0000)]
LoopDeletion: use return value instead of passing in LPMUpdater; NFC
I will use this refactoring in a later patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314351
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 27 Sep 2017 21:45:19 +0000 (21:45 +0000)]
Rename LoopUnrollStatus to LoopUnrollResult; NFC
A "Result" suffix is more appropriate here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314350
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 27 Sep 2017 21:38:02 +0000 (21:38 +0000)]
Fix off-by-one error in TarWriter.
The tar format originally supported up to 99 byte filename. The two
extensions are proposed later: Ustar or PAX.
In the UStar extension, a pathanme is split at a '/' and its "prefix"
and "suffix" are stored in different locations in the tar header. Since
"prefix" can be up to 155 byte, it can represent up to 254 byte
filename (but exact limit depends on the location of '/' character in
a pathname.)
Our TarWriter first attempt to use UStar extension and then fallback to
PAX extension.
But there's a bug in UStar header creation. "Suffix" part must be a NUL-
terminated string, but we didn't handle it correctly. As a result, if
your filename just 100 characters long, the last character was droppped.
This patch fixes the issue.
Differential Revision: https://reviews.llvm.org/D38149
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314349
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Wed, 27 Sep 2017 21:37:33 +0000 (21:37 +0000)]
[CMake] Fix typo: "in-tree" -> "in-source" (NFC)
Summary:
*In-source builds* of LLVM, in which a user invokes `cmake` from within the
LLVM source directory, or invokes `cmake -B/path/to/source/dir/of/llvm`,
are explicitly checked for and disallowed by LLVM's `CMakeLists.txt`.
*In-tree builds*, on the other hand, refer to when the source directories
of projects such as Clang are nested within the `llvm/tools` source
directory. These are not disallowed, and are in fact a common way of
building LLVM and Clang.
Revise the comment to match the logic underneath it: it checks for an
"in-source build", not an "in-tree build".
Reviewers: beanz
Reviewed By: beanz
Subscribers: mgorny
Differential Revision: https://reviews.llvm.org/D38317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314348
91177308-0d34-0410-b5e6-
96231b3b80d8
Don Hinton [Wed, 27 Sep 2017 21:19:56 +0000 (21:19 +0000)]
Cleanup some problems with LLVM_ENABLE_DUMP in release builds, and
always set LLVM_ENABLE_DUMP=ON for +Asserts builds.
Differential Revision: https://reviews.llvm.org/D38306
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314346
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 27 Sep 2017 21:19:24 +0000 (21:19 +0000)]
Do not remove a target file in FileOutputBuffer::create().
FileOutputBuffer::create() attempts to remove a target file if the file
is a regular one, which results in an unexpected result in a failure
scenario.
If something goes wrong and the user of FileOutputBuffer decides to not
call commit(), it leaves nothing. An existing file is removed, and no
new file is created.
What we should do is to atomically replace an existing file with a new
file using rename(), so that it wouldn't remove an existing file without
creating a new one.
Differential Revision: https://reviews.llvm.org/D38283
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314345
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Wed, 27 Sep 2017 20:47:39 +0000 (20:47 +0000)]
[MachineOutliner] AArch64: Avoid saving + restoring LR if possible
This commit allows the outliner to avoid saving and restoring the link register
on AArch64 when it is dead within an entire class of candidates.
This introduces changes to the way the outliner interfaces with the target.
For example, the target now interfaces with the outliner using a
MachineOutlinerInfo struct rather than by using getOutliningCallOverhead and
getOutliningFrameOverhead.
This also improves several comments on the outliner's cost model.
https://reviews.llvm.org/D36721
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314341
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 27 Sep 2017 20:34:17 +0000 (20:34 +0000)]
Revert r314249 "Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST."""
This caused PR34751
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314339
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 27 Sep 2017 20:34:13 +0000 (20:34 +0000)]
Revert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg."
This contributed to PR34751
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314338
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 27 Sep 2017 20:19:53 +0000 (20:19 +0000)]
[X86][SSE] Pull out variable shuffle mask combine logic. NFCI.
Hopefully this will make it easier to vary the combine depth threshold per-target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314337
91177308-0d34-0410-b5e6-
96231b3b80d8