OSDN Git Service

android-x86/external-llvm.git
6 years ago[CMake] Fix typo "Wraning" (NFC)
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

6 years agollvm-readobj: fix a few typos (NFC)
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

6 years agoRevert "[BypassSlowDivision] Improve our handling of divisions by constants"
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

6 years agollvm-dwarfdump: support .apple-namespaces in --find
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

6 years ago[llvm-rc] Import all make_unique invocations from llvm namespace.
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

6 years agollvm-dwarfdump: add support for .apple_types in --find
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

6 years ago[llvm-rc] Add user-defined resources parsing ability. [8/8]
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

6 years ago[llvm-rc] Add integer expressions parsing ability. [7/8]
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

6 years ago[MachineOutliner][NFC] Simplify logic in pruneCandidates
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

6 years ago[X86] Don't select (cmp (and, imm), 0) to testw
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

6 years ago[llvm-rc] Fix-up for r314468 (argument-dependent lookup in make_unique).
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

6 years agoARM: Fix cases where CSI Restored bit is not cleared
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

6 years agobpf: fix a bug for disassembling ld_pseudo inst
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

6 years ago[llvm-rc] Add VERSIONINFO parsing ability. [6/8]
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

6 years ago[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other...
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

6 years ago[x86] add tests for possible insertelement to shuffle transform; NFC
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

6 years ago[SystemZ] Fix fall-out from r314428
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

6 years ago[X86] Make use of vpmovwb when possible in LowerMULH
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

6 years agoFix -Werror build.
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

6 years ago[ARM] Restore the right frame pointer register in Int_eh_sjlj_longjmp
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

6 years ago[ARM] Fix SJLJ exception handling when manually chosen on a platform where it isn...
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

6 years agoMIR: Serialize CaleeSavedInfo Restored flag
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

6 years ago[AVX512] Add avx512bw command lines to 128-bit idiv tests.
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

6 years ago[X86] Use target independent ZERO_EXTEND/SIGN_EXTEND nodes were possible in LowerMULH
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

6 years ago[X86] Move a setOperation action for ISD::TRUNCATE near another one in the same if...
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

6 years agoAddress further review feedback. (NFC)
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

6 years agotry and appease gcc
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

6 years agollvm-dwarfdump: implement --find for .apple_names
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

6 years ago[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.
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

6 years ago[JumpThreading] Preserve DT and LVI across the pass
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

6 years ago[X86] Use BWI instructions to improve lowering of v32i8 MULHU/S
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

6 years ago[X86] Remove dead code from X86ISelDAGToDAG.cpp multiply handling
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

6 years ago[X86] Use correct subvector index when combining two insert subvectors featuring...
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

6 years ago[SystemZ] Custom-expand ATOMIC_CMP_AND_SWAP_WITH_SUCCESS
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

6 years ago[dwarfdump] Verify that CUs have a unit DIE.
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

6 years agoUse SDValue::getConstantOperandVal helper. NFCI.
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

6 years ago[mips] Remove codegen support for branch likely instructions.
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

6 years agoDocs: fix link to Debugger intrinsic functions
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

6 years ago[LoopUnroll] Fix use after poison.
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

6 years ago[X86] Add overflow intrinsic test in preparation for D38161.
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

6 years ago[DebugInfo] Do not extend range for physreg in LiveDebugVariables
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

6 years ago[LoopInfo] Don't poison random memory regions.
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

6 years ago[LVI] Move LVILatticeVal class to separate header file (NFC).
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

6 years ago[x86][AsmParser] Allow some more MS size directives
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

6 years ago[llvm-cov] Create directory structure when filtering using -name*= options
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

6 years agoTeach TargetInstrInfo::getInlineAsmLength to parse .space directives with integer...
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

6 years ago[PowerPC] eliminate partially redundant compare instruction
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

6 years ago[RISCV] Add common fixups and relocations
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

6 years ago[RegAllocGreedy]: Allow recoloring of done register if it's non-tied
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

6 years ago[RISCV] Define RISC-V specific e_flags
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

6 years ago[X86] Adding more cases to horizontal [f]add/[f]sub for avx512.
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

6 years ago[DAGCombiner] Fix an off-by-one error in vector logic
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

6 years agobpf: add new insns for bswap_to_le and negation
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

6 years agoUse a BumpPtrAllocator for Loop objects
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

6 years ago[ORC] Update the GlobalMappingLayer interface to fit the error-ized layer
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

6 years agoFix a UBsan bot.
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

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What...
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

6 years agoCheck for overflows when calculating the offset in GetGEPCost.
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

6 years agoReverted r313993.
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

6 years agoRevert r314017 '[InstCombine] Simplify check for RHS being a splat constant in foldIC...
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

6 years agoUpdate the description of AVR32 for the ELFDumper
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

6 years agoFix -Wunused-variable for Release build.
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

6 years agoReturn the LoopUnrollResult from tryToUnrollLoop; NFC
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

6 years agoLoopDeletion: use return value instead of passing in LPMUpdater; NFC
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

6 years agoRename LoopUnrollStatus to LoopUnrollResult; NFC
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

6 years agoFix off-by-one error in TarWriter.
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

6 years ago[CMake] Fix typo: "in-tree" -> "in-source" (NFC)
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

6 years agoCleanup some problems with LLVM_ENABLE_DUMP in release builds, and
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

6 years agoDo not remove a target file in FileOutputBuffer::create().
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

6 years ago[MachineOutliner] AArch64: Avoid saving + restoring LR if possible
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

6 years agoRevert r314249 "Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions...
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

6 years agoRevert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg."
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

6 years ago[X86][SSE] Pull out variable shuffle mask combine logic. NFCI.
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

6 years ago[CodeGen] Emit necessary .note sections for -fsplit-stack
Than McIntosh [Wed, 27 Sep 2017 19:34:00 +0000 (19:34 +0000)]
[CodeGen] Emit necessary .note sections for -fsplit-stack

Summary:
According to https://gcc.gnu.org/wiki/SplitStacks, the linker expects a zero-sized .note.GNU-split-stack section if split-stack is used (and also .note.GNU-no-split-stack section if it also contains non-split-stack functions), so it can handle the cases where a split-stack function calls non-split-stack function.

This change adds the sections if needed.

Fixes PR #34670.

Reviewers: thanm, rnk, luqmana

Reviewed By: rnk

Subscribers: llvm-commits

Patch by Cherry Zhang <cherryyz@google.com>

Differential Revision: https://reviews.llvm.org/D38051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314335 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Rewrite the zero vector checks in lowerV2X128VectorShuffle to use the Zeroable...
Craig Topper [Wed, 27 Sep 2017 18:56:20 +0000 (18:56 +0000)]
[X86] Rewrite the zero vector checks in lowerV2X128VectorShuffle to use the Zeroable APInt

We already have zeroable bits in an APInt. We might as well use that instead of checking for an all zero BUILD_VECTOR.

Differential Revision: https://reviews.llvm.org/D37950

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314332 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] In combineLoopSADPattern, pad result with zeros and use full size add instead...
Craig Topper [Wed, 27 Sep 2017 18:36:45 +0000 (18:36 +0000)]
[X86] In combineLoopSADPattern, pad result with zeros and use full size add instead of using a smaller add and inserting.

In some cases the result psadbw is smaller than the type of the add that started the match. Currently in these cases we are using a smaller add and inserting the result.

If we instead combine the psadbw with zeros and use the full size add we can take advantage of implicit zeroing we get if we emit a narrower move before the add.

In a future patch, I want to make isel aware that the psadbw itself already zeroed the upper bits and remove the move entirely.

Differential Revision: https://reviews.llvm.org/D37453

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314331 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLP] Fix crash on propagate IR flags for undef operands of min/max
Alexey Bataev [Wed, 27 Sep 2017 17:42:49 +0000 (17:42 +0000)]
[SLP] Fix crash on propagate IR flags for undef operands of min/max
reductions.

If both operands of the newly created SelectInst are Undefs the
resulting operation is also Undef, not SelectInst. It may cause crashes
when trying to propagate IR flags because function expects exactly
SelectInst instruction, nothing else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314323 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[support] mapped_file_region: and fix the windows code too
Roman Lebedev [Wed, 27 Sep 2017 17:24:34 +0000 (17:24 +0000)]
[support] mapped_file_region: and fix the windows code too

Followup for r314312 / r314313
Sorry, i really failed to fully grep all the codebase :/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314321 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Gating select arithmetic optimization.
Chad Rosier [Wed, 27 Sep 2017 17:16:51 +0000 (17:16 +0000)]
[InstCombine] Gating select arithmetic optimization.

These changes faciliate positive behavior for arithmetic based select
expressions that match its translation criteria, keeping code size gated to
neutral or improved scenarios.

Patch by Michael Berg <michael_c_berg@apple.com>!

Differential Revision: https://reviews.llvm.org/D38263

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314320 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][Falkor] Ignore SP based loads in HW prefetch fixups.
Geoff Berry [Wed, 27 Sep 2017 17:14:10 +0000 (17:14 +0000)]
[AArch64][Falkor] Ignore SP based loads in HW prefetch fixups.

Reviewers: mcrosier

Subscribers: aemerson, rengolin, javed.absar, kristof.beyls

Differential Revision: https://reviews.llvm.org/D38301

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314319 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Misched] : Fix typo in comment. NFC.
Javed Absar [Wed, 27 Sep 2017 16:39:17 +0000 (16:39 +0000)]
[Misched] : Fix typo in comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314316 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLP] fix typos/formatting; NFC
Sanjay Patel [Wed, 27 Sep 2017 16:32:56 +0000 (16:32 +0000)]
[SLP] fix typos/formatting; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314315 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[llvm-cov] Create directory structure when filtering using -name*= options"
Sean Eveson [Wed, 27 Sep 2017 16:20:07 +0000 (16:20 +0000)]
Revert "[llvm-cov] Create directory structure when filtering using -name*= options"

Test failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314314 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] mapped_file_region::size() returns size_t
Roman Lebedev [Wed, 27 Sep 2017 16:08:33 +0000 (16:08 +0000)]
[Support] mapped_file_region::size() returns size_t

Fixup last commit, found by clang-stage1-cmake-RA-incremental bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314313 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] mapped_file_region: store size as size_t
Roman Lebedev [Wed, 27 Sep 2017 15:59:16 +0000 (15:59 +0000)]
[Support] mapped_file_region: store size as size_t

Summary:
Found when testing stage-2 build with D38101.

```
In file included from /build/llvm/lib/Support/Path.cpp:1045:
/build/llvm/lib/Support/Unix/Path.inc:648:14: error: comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare]
  if (length > std::numeric_limits<size_t>::max()) {
      ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

`size_t` is `uint64_t` here, apparently, thus any `uint64_t` value
always fits into `size_t`.

Initial patch was to use some preprocessor logic to
not check if the size is known to fit at compile time.
But Zachary Turner suggested using this approach.

Reviewers: Bigcheese, rafael, zturner, mehdi_amini

Reviewed by (via email): zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38132

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314312 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Create directory structure when filtering using -name*= options
Sean Eveson [Wed, 27 Sep 2017 15:37:40 +0000 (15:37 +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@314310 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SimplifyCFG] add a struct to house optional folds (PR34603)
Sanjay Patel [Wed, 27 Sep 2017 14:54:16 +0000 (14:54 +0000)]
[SimplifyCFG] add a struct to house optional folds (PR34603)

This was intended to be no-functional-change, but it's not - there's a test diff.

So I thought I should stop here and post it as-is to see if this looks like what was expected
based on the discussion in PR34603:
https://bugs.llvm.org/show_bug.cgi?id=34603

Notes:
 1. The test improvement occurs because the existing 'LateSimplifyCFG' marker is not carried
    through the recursive calls to 'SimplifyCFG()->SimplifyCFGOpt().run()->SimplifyCFG()'.
    The parameter isn't passed down, so we pick up the default value from the function signature
    after the first level. I assumed that was a bug, so I've passed 'Options' down in all of the
    'SimplifyCFG' calls.

 2. I split 'LateSimplifyCFG' into 2 bits: ConvertSwitchToLookupTable and KeepCanonicalLoops.
    This would theoretically allow us to differentiate the transforms controlled by those params
    independently.

 3. We could stash the optional AssumptionCache pointer and 'LoopHeaders' pointer in the struct too.
    I just stopped here to minimize the diffs.

 4. Similarly, I stopped short of messing with the pass manager layer. I have another question that
    could wait for the follow-up: why is the new pass manager creating the pass with LateSimplifyCFG
    set to true no matter where in the pipeline it's creating SimplifyCFG passes?

    // Create an early function pass manager to cleanup the output of the
    // frontend.
    EarlyFPM.addPass(SimplifyCFGPass());

    -->

    /// \brief Construct a pass with the default thresholds
    /// and switch optimizations.
    SimplifyCFGPass::SimplifyCFGPass()
       : BonusInstThreshold(UserBonusInstThreshold),
         LateSimplifyCFG(true) {}   <-- switches get converted to lookup tables and loops may not be in canonical form

    If this is unintended, then it's possible that the current behavior of dropping the 'LateSimplifyCFG'
    setting via recursion was masking this bug.

Differential Revision: https://reviews.llvm.org/D38138

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314308 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InlineCost] add visitSelectInst()
Haicheng Wu [Wed, 27 Sep 2017 14:44:56 +0000 (14:44 +0000)]
[InlineCost] add visitSelectInst()

InlineCost can understand Select IR now.  This patch finds free Select IRs and
continue the propagation of SimplifiedValues, ConstantOffsetPtrs, and
SROAArgValues.

Differential Revision: https://reviews.llvm.org/D37198

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314307 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SKX][KNL] Updated regression tests to use -mattr instead of -mcpu flag.NFC.
Gadi Haber [Wed, 27 Sep 2017 14:44:15 +0000 (14:44 +0000)]
[X86][SKX][KNL] Updated regression tests to use -mattr instead of -mcpu flag.NFC.

NFC.
 Updated 8 regression tests to use -mattr instead of -mcpu flag as follows:
 -mcpu=knl --> -mattr=+avx512f
 -mcpu=skx --> -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq

The updates are as part of the preparation of a large commit to add all instruction scheduling for the SKX target.

Reviewers: delena, zvi, RKSimon
Differential Revision: https://reviews.llvm.org/D38222

Change-Id: I2381c9b5bb75ecacfca017243c22d054f6eddd14

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314306 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86 Tests: Unsigned saturation subtraction tests. NFC.
Zvi Rackover [Wed, 27 Sep 2017 14:38:05 +0000 (14:38 +0000)]
X86 Tests: Unsigned saturation subtraction tests. NFC.

Summary:
Adding tests for D37534.

Commit on behalf of julia.koval@intel.com

Reviewers: n.bozhenov, zvi, spatel, DavidKreitzer

Reviewed By: zvi

Differential Revision: https://reviews.llvm.org/D37510

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314305 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTypo: const MCSchedModel SchedModel -> const MCSchedModel &SchedModel
Krzysztof Parzyszek [Wed, 27 Sep 2017 12:48:48 +0000 (12:48 +0000)]
Typo: const MCSchedModel SchedModel -> const MCSchedModel &SchedModel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314301 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RegAllocGreedy] Fix spelling error, "inteference" -> "interference", NFC
Mikael Holmen [Wed, 27 Sep 2017 11:27:50 +0000 (11:27 +0000)]
[RegAllocGreedy] Fix spelling error, "inteference" -> "interference", NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314299 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] eliminate unconditional branch to the next instruction
Hiroshi Inoue [Wed, 27 Sep 2017 10:33:02 +0000 (10:33 +0000)]
[PowerPC] eliminate unconditional branch to the next instruction

This patch makes analyzeBranch eliminate unconditional branch to the next instruction.
After basic blocks are re-organized by optimizers, such as machine block placement, a BB may end with an unconditional branch to the next (fallthrough) BB. This patch removes such redundant branch instruction.

Differential Revision: https://reviews.llvm.org/D37730

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314297 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Misched]: Remove double call getMicroOpFactor.NFC.
Javed Absar [Wed, 27 Sep 2017 10:31:58 +0000 (10:31 +0000)]
[Misched]: Remove double call getMicroOpFactor.NFC.

Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D38176

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314296 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AsmParser] fix PR32035
Coby Tayree [Wed, 27 Sep 2017 10:29:29 +0000 (10:29 +0000)]
[X86][AsmParser] fix PR32035

Differential Revision: https://reviews.llvm.org/D37473

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314295 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[test] Don't verify .debug_line offsets in bitcode tests.
Jonas Devlieghere [Wed, 27 Sep 2017 10:23:34 +0000 (10:23 +0000)]
[test] Don't verify .debug_line offsets in bitcode tests.

The exact values of the .debug_line offsets should not be hard-coded in
the checks for bitcode tests.

Fixes: http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/543

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314294 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] Improve (i4 bitcast (v4i1 x)) handling for 256-bit vector compare results.
Simon Pilgrim [Wed, 27 Sep 2017 10:10:17 +0000 (10:10 +0000)]
[X86][AVX] Improve (i4 bitcast (v4i1 x)) handling for 256-bit vector compare results.

As commented on D37849 and rL313547, AVX1 targets were missing a chance to use vmovmskpd for v4f64/v4i64 results for bool vector bitcasts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314293 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUse const where possible. NFCI.
Simon Pilgrim [Wed, 27 Sep 2017 10:03:17 +0000 (10:03 +0000)]
Use const where possible. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314292 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dwarfdump] Fix printing of .debug_line offset.
Jonas Devlieghere [Wed, 27 Sep 2017 10:00:27 +0000 (10:00 +0000)]
[dwarfdump] Fix printing of .debug_line offset.

Fixes 32-bit buildbots:
  http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/542
  http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/11533
  http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/11494

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314291 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dwarfdump] Add support for -debug-line=OFFSET
Jonas Devlieghere [Wed, 27 Sep 2017 09:33:45 +0000 (09:33 +0000)]
[dwarfdump] Add support for -debug-line=OFFSET

This patch adds support for passing an offset to -debug-line.

Differential revision: https://reviews.llvm.org/D38240

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314288 91177308-0d34-0410-b5e6-96231b3b80d8