]> granicus.if.org Git - llvm/log
llvm
6 years ago[IndVars] Fix corner case with unreachable Phi inputs. PR40454
Max Kazantsev [Tue, 12 Feb 2019 09:59:44 +0000 (09:59 +0000)]
[IndVars] Fix corner case with unreachable Phi inputs. PR40454

Logic in `getInsertPointForUses` doesn't account for a corner case when `Def`
only comes to a Phi user from unreachable blocks. In this case, the incoming
value may be arbitrary (and not even available in the input block) and break
the loop-related invariants that are asserted below.

In fact, if we encounter this situation, no IR modification is needed. This
Phi will be simplified away with nearest cleanup.

Differential Revision: https://reviews.llvm.org/D58045
Reviewed By: spatel

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

6 years ago[llvm-readobj] Only allow 4-byte pr_data
Fangrui Song [Tue, 12 Feb 2019 09:56:01 +0000 (09:56 +0000)]
[llvm-readobj] Only allow 4-byte pr_data

Summary: AMD64 psABI says: "The pr_data field of each property contains a 4-byte unsigned integer." Thus we don't need to handle 8-byte pr_data.

Reviewers: mike.dvoretsky, grimar, craig.topper, xiangzhangllvm, hjl.tools

Reviewed By: grimar

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

6 years ago[llvm-readobj] - Simplify .gnu.version_r dumping a bit.
George Rimar [Tue, 12 Feb 2019 09:50:04 +0000 (09:50 +0000)]
[llvm-readobj] - Simplify .gnu.version_r dumping a bit.

Current implementation takes "Number of needed versions" from DT_VERNEEDNUM
dynamic tag entry. Though it would be a bit simpler to take it from sh_info
section header field directly:
https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html

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

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

6 years ago[LoopSimplifyCFG] Change logic of dead loops removal to avoid hitting asserts
Max Kazantsev [Tue, 12 Feb 2019 09:37:00 +0000 (09:37 +0000)]
[LoopSimplifyCFG] Change logic of dead loops removal to avoid hitting asserts

The function `LI.erase` has some invariants that need to be preserved when it
tries to remove a loop which is not the top-level loop. In particular, it
requires loop's preheader to be strictly in loop's parent. Our current logic
of deletion of dead blocks may erase the information about preheader before we
handle the loop, and therefore we may hit this assertion.

This patch changes the logic of loop deletion: we make them top-level loops
before we actually erase them. This allows us to trigger the simple branch of
`erase` logic which just detatches blocks from the loop and does not try to do
some complex stuff that need this invariant.

Thanks to @uabelho for reporting this!

Differential Revision: https://reviews.llvm.org/D57221
Reviewed By: fedor.sergeev

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

6 years ago[yaml2obj/obj2yaml] - Move `Info` field out from `Section` class.
George Rimar [Tue, 12 Feb 2019 09:08:59 +0000 (09:08 +0000)]
[yaml2obj/obj2yaml] - Move `Info` field out from `Section` class.

ELFYAML.h contains a `Section` class which is a base for a few other
sections classes that are used for mapping different section types.
`Section` has a `StringRef Info` field used for storing sh_info.

At the same time, sh_info has very different meanings for sections and
cannot be processed in a similar way generally,
for example ELFDumper does not handle it in `dumpCommonSection`
but do that in `dumpGroup` and `dumpCommonRelocationSection` respectively.

At this moment, we have and handle it as a string, because that was possible for
the current use case. But also it can simply be a number:
For SHT_GNU_verdef is "The number of version definitions within the section."

The patch moves `Info` field out to be able to have it as a number.
With that change, each class will be able to decide what type and purpose
of the sh_info field it wants to use.

I also had to edit 2 test cases. This is because patch fixes a bug. Previously we
accepted yaml files with Info fields for all sections (for example, for SHT_DYNSYM too).
But we do not handle it and the resulting objects had zero sh_info fields set for
such sections. Now it is accepted only for sections that supports it.

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

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

6 years agoLibFuzzer.rst: double backticks
Hans Wennborg [Tue, 12 Feb 2019 09:08:52 +0000 (09:08 +0000)]
LibFuzzer.rst: double backticks

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

6 years agoDelete blocks from DTU to avoid dangling pointers
Max Kazantsev [Tue, 12 Feb 2019 08:10:29 +0000 (08:10 +0000)]
Delete blocks from DTU to avoid dangling pointers

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

6 years ago[LoopSimplifyCFG] Pay respect to LCSSA when removing dead blocks
Max Kazantsev [Tue, 12 Feb 2019 07:48:07 +0000 (07:48 +0000)]
[LoopSimplifyCFG] Pay respect to LCSSA when removing dead blocks

Utility function that we use for blocks deletion always unconditionally removes
one-input Phis. In LoopSimplifyCFG, it can lead to breach of LCSSA form.
This patch alters this function to keep them if needed.

Differential Revision: https://reviews.llvm.org/D57231
Reviewed By: fedor.sergeev

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

6 years ago[NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIs
Max Kazantsev [Tue, 12 Feb 2019 07:09:29 +0000 (07:09 +0000)]
[NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIs

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

6 years ago[Statepoint Lowering] Update misleading comments about chains
Philip Reames [Tue, 12 Feb 2019 06:25:58 +0000 (06:25 +0000)]
[Statepoint Lowering] Update misleading comments about chains

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

6 years ago[NFC] Add parameter for keeping one-input Phis in DeleteDeadBlock(s)
Max Kazantsev [Tue, 12 Feb 2019 06:14:27 +0000 (06:14 +0000)]
[NFC] Add parameter for keeping one-input Phis in DeleteDeadBlock(s)

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

6 years ago[X86] Collapse FP_TO_INT16_IN_MEM/FP_TO_INT32_IN_MEM/FP_TO_INT64_IN_MEM into a single...
Craig Topper [Tue, 12 Feb 2019 06:14:18 +0000 (06:14 +0000)]
[X86] Collapse FP_TO_INT16_IN_MEM/FP_TO_INT32_IN_MEM/FP_TO_INT64_IN_MEM into a single opcode using memory VT to distinquish. NFC

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

6 years ago[X86] Remove the value type operand from the floating point load/store MemIntrinsicSD...
Craig Topper [Tue, 12 Feb 2019 06:14:16 +0000 (06:14 +0000)]
[X86] Remove the value type operand from the floating point load/store MemIntrinsicSDNodes. Use the MemoryVT instead. NFCI

We already have the memory VT, we can just match from that during isel.

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

6 years ago[build] Remove a stray comment. NFC
Shoaib Meenai [Tue, 12 Feb 2019 02:25:27 +0000 (02:25 +0000)]
[build] Remove a stray comment. NFC

The CMake change associated with this comment was removed but the
comment got left behind. Add a newline instead.

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

6 years ago[CMake] Don't override required compiler flags in the runtimes build
Petr Hosek [Tue, 12 Feb 2019 02:11:25 +0000 (02:11 +0000)]
[CMake] Don't override required compiler flags in the runtimes build

Ensure that HandleLLVMOptions adds all necessary required flags,
including -Wno-error when building with LLVM_ENABLE_WERROR enabled.

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

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

6 years ago[x86] add tests for logic of setcc (PR40611); NFC
Sanjay Patel [Tue, 12 Feb 2019 01:46:30 +0000 (01:46 +0000)]
[x86] add tests for logic of setcc (PR40611); NFC

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

6 years ago[PowerPC] add tests for logic of setcc (PR40611); NFC
Sanjay Patel [Tue, 12 Feb 2019 01:46:26 +0000 (01:46 +0000)]
[PowerPC] add tests for logic of setcc (PR40611); NFC

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

6 years agoFix r353771 to target linux only (split-dwarf isn't supported on macho)
David Blaikie [Tue, 12 Feb 2019 01:19:00 +0000 (01:19 +0000)]
Fix r353771 to target linux only (split-dwarf isn't supported on macho)

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

6 years ago[LoopReroll] Fix reroll root legality checking.
Eli Friedman [Tue, 12 Feb 2019 00:33:25 +0000 (00:33 +0000)]
[LoopReroll] Fix reroll root legality checking.

The code checked that the first root was an appropriate distance from
the base value, but skipped checking the other roots. This could lead to
rerolling a loop that can't be legally rerolled (at least, not without
rewriting the loop in a non-trivial way).

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

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

6 years ago[Test] Use autogenerated checks for more statepoint tests
Philip Reames [Tue, 12 Feb 2019 00:12:46 +0000 (00:12 +0000)]
[Test] Use autogenerated checks for more statepoint tests

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

6 years ago[Tests] Fill out a few tests around gc relocation uniquing
Philip Reames [Tue, 12 Feb 2019 00:01:39 +0000 (00:01 +0000)]
[Tests] Fill out a few tests around gc relocation uniquing

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

6 years agoDebugInfo: Split DWARF + gmlt + no-split-dwarf-inlining shouldn't emit anything to...
David Blaikie [Tue, 12 Feb 2019 00:00:38 +0000 (00:00 +0000)]
DebugInfo: Split DWARF + gmlt + no-split-dwarf-inlining shouldn't emit anything to the .dwo file

This configuration (due to r349207) was intended not to emit any DWO CU,
but a degenerate CU was still being emitted - containing a header and a
DW_TAG_compile_unit with no attributes.

Under that situation, emit nothing to the .dwo file. (since this is a
dynamic property of the input the .dwo file is still emitted, just with
nothing in it (so a valid, but empty, ELF file) - if some other CU
didn't satisfy this criteria, its DWO CU would still go there, etc)

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

6 years ago[Test] Autogenerate a statepoint test and actual show the reload
Philip Reames [Mon, 11 Feb 2019 23:55:24 +0000 (23:55 +0000)]
[Test] Autogenerate a statepoint test and actual show the reload

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

6 years agoBe conservative about unordered accesses for the moment
Philip Reames [Mon, 11 Feb 2019 23:34:33 +0000 (23:34 +0000)]
Be conservative about unordered accesses for the moment

Background: As described in https://reviews.llvm.org/D57601, I'm working towards separating volatile and atomic in the MMO uses for atomic instructions.

In https://reviews.llvm.org/D57593, I fixed a bug where isUnordered was returning the wrong result, but didn't account for the fact I was getting slightly ahead of myself. While both uses of isUnordered are correct (as far as I can tell), we don't have tests to demonstrate this and being aggressive gets in the way of having the removal of volatile truly be non-functional. Once D57601 lands, I will return to these call sites, revert this patch, and add the appropriate tests to show the expected behaviour.

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

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

6 years ago[tblgen] Add a timer covering the time spent reading the Instruction defs
Daniel Sanders [Mon, 11 Feb 2019 23:02:02 +0000 (23:02 +0000)]
[tblgen] Add a timer covering the time spent reading the Instruction defs

This patch adds a -time-regions option to tablegen that can enable timers
(currently only one) that assess the performance of tablegen itself. This
can be useful for identifying scaling problems with tablegen backends.

This particular timer has allowed me to ignore time that is not attributed
the GISel combiner pass. It's useful by itself but it is particularly
useful in combination with https://reviews.llvm.org/D52954 which causes
this period of time to be annotated within Xcode Instruments which in turn
allows profile samples and recorded allocations attributed to reading
instructions to be filtered out.

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

6 years agoGlobalISel: Verify G_EXTRACT
Matt Arsenault [Mon, 11 Feb 2019 22:12:43 +0000 (22:12 +0000)]
GlobalISel: Verify G_EXTRACT

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

6 years ago[TargetLibraryInfo] Update run time support for Windows
Evandro Menezes [Mon, 11 Feb 2019 22:12:01 +0000 (22:12 +0000)]
[TargetLibraryInfo] Update run time support for Windows

It seems that, since VC19, the `float` C99 math functions are supported for all
targets, unlike the C89 ones.

According to the discussion at https://reviews.llvm.org/D57625.

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

6 years ago[LegalizeTypes] Expand FNEG to bitwise op for IEEE FP types
Ana Pazos [Mon, 11 Feb 2019 22:10:08 +0000 (22:10 +0000)]
[LegalizeTypes] Expand FNEG to bitwise op for IEEE FP types

Summary:
Except for custom floating point types x86_fp80 and ppc_fp128,
expand Y = FNEG(X) to Y = X ^ sign mask to avoid library call.
 Using bitwise operation can improve code size and performance.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: efriedma, kpn, arsenm, eli.friedman, javed.absar, rbar, johnrusso, simoncook, sabuasal, niosHD, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, asb, llvm-commits

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

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

6 years ago[IRReader] Expose getLazyIRModule
Scott Linder [Mon, 11 Feb 2019 22:01:13 +0000 (22:01 +0000)]
[IRReader] Expose getLazyIRModule

Currently there is no way to lazy-load an in-memory IR module without
first writing it to disk. This patch just exposes the existing
implementation of getLazyIRModule.

This is effectively a revert of rL212364

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

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

6 years agoGlobalISel: Implement moreElementsVector for implicit_def
Matt Arsenault [Mon, 11 Feb 2019 22:00:39 +0000 (22:00 +0000)]
GlobalISel: Implement moreElementsVector for implicit_def

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

6 years agoGlobalISel: Fix not calling the observer when legalizing G_EXTRACT
Matt Arsenault [Mon, 11 Feb 2019 21:33:54 +0000 (21:33 +0000)]
GlobalISel: Fix not calling the observer when legalizing G_EXTRACT

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

6 years ago[globalisel] Correct string emitted by GISelChangeObserver::erasingInstr()
Daniel Sanders [Mon, 11 Feb 2019 20:45:19 +0000 (20:45 +0000)]
[globalisel] Correct string emitted by GISelChangeObserver::erasingInstr()

The API indicates that the MI is about to be erased rather than it has been erased.

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

6 years ago[X86] Correct the memory operand for the FLD emitted in FP_TO_INTHelper for 32-bit...
Craig Topper [Mon, 11 Feb 2019 20:38:10 +0000 (20:38 +0000)]
[X86] Correct the memory operand for the FLD emitted in FP_TO_INTHelper for 32-bit SSE targets.

We were using DstTy, but that represents the integer type we are converting to which is i64 in this
case. The FLD is part of an intermediate step to get from the SSE registers to the x87 registers.
If the floating point type is f32, the memory operand should reflect a 4 byte access not an 8 byte
access. The store we used to get from SSE to the stack is using the corect size.

While there, consistenly use TheVT in place of Op.getOperand(0).getValueType() throughout the function.

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

6 years ago[llvm-cxxfilt] Split and demangle stdin input
Matt Davis [Mon, 11 Feb 2019 20:30:53 +0000 (20:30 +0000)]
[llvm-cxxfilt] Split and demangle stdin input

Summary:
Originally, llvm-cxxfilt would treat a line as a single mangled item to be demangled.
If a mangled name appears in the middle of that string, that name would not be demangled.

GNU c++filt  splits and demangles every word  in a  string that is piped to it via stdin.
Prior to this patch llvm-cxxfilt would never split strings  piped to it.
This patch replicates the GNU behavior and splits strings that are piped to it via stdin.

This fixes PR39990

Reviewers: compnerd, jhenderson, davide

Reviewed By: compnerd, jhenderson

Subscribers: erik.pilkington, jhenderson, llvm-commits

Tags: #llvm

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

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

6 years ago[globalisel] Restore comment explaining the nits of GISelChangeObserver::createdInstr()
Daniel Sanders [Mon, 11 Feb 2019 20:05:49 +0000 (20:05 +0000)]
[globalisel] Restore comment explaining the nits of GISelChangeObserver::createdInstr()

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

6 years ago[MemorySSA] Remove verifyClobberSanity.
Alina Sbirlea [Mon, 11 Feb 2019 19:51:21 +0000 (19:51 +0000)]
[MemorySSA] Remove verifyClobberSanity.

Summary:
This verification may fail after certain transformations due to
BasicAA's fragility. Added a small explanation and a testcase that
triggers the assert in checkClobberSanity (before its removal).
Addresses PR40509.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, llvm-commits, Prazek

Tags: #llvm

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

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

6 years agoRefactor setAlreadyUnrolled() and setAlreadyVectorized().
Michael Kruse [Mon, 11 Feb 2019 19:45:44 +0000 (19:45 +0000)]
Refactor setAlreadyUnrolled() and setAlreadyVectorized().

Loop::setAlreadyUnrolled() and
LoopVectorizeHints::setLoopAlreadyUnrolled() both add loop metadata that
stops the same loop from being transformed multiple times. This patch
merges both implementations.

In doing so we fix 3 potential issues:

 * setLoopAlreadyUnrolled() kept the llvm.loop.vectorize/interleave.*
   metadata even though it will not be used anymore. This already caused
   problems such as http://llvm.org/PR40546. Change the behavior to the
   one of setAlreadyUnrolled which deletes this loop metadata.

 * setAlreadyUnrolled() used to create a new LoopID by calling
   MDNode::get with nullptr as the first operand, then replacing it by
   the returned references using replaceOperandWith. It is possible
   that MDNode::get would instead return an existing node (due to
   de-duplication) that then gets modified. To avoid, use a fresh
   TempMDNode that does not get uniqued with anything else before
   replacing it with replaceOperandWith.

 * LoopVectorizeHints::matchesHintMetadataName() only compares the
   suffix of the attribute to set the new value for. That is, when
   called with "enable", would erase attributes such as
   "llvm.loop.unroll.enable", "llvm.loop.vectorize.enable" and
   "llvm.loop.distribute.enable" instead of the one to replace.
   Fortunately, function was only called with "isvectorized".

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

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

6 years ago[InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift
Sanjay Patel [Mon, 11 Feb 2019 19:26:27 +0000 (19:26 +0000)]
[InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift

This bug seems to be harmless in release builds, but will cause an error in UBSAN
builds or an assertion failure in debug builds.

When it gets to this opcode comparison, it assumes both of the operands are BinaryOperators,
but the prior m_LogicalShift will also match a ConstantExpr. The cast<BinaryOperator> will
assert in a debug build, or reading an invalid value for BinaryOp from memory with
((BinaryOperator*)constantExpr)->getOpcode() will cause an error in a UBSAN build.

The test I added will fail without this change in debug/UBSAN builds, but not in release.

Patch by: @AndrewScheidecker (Andrew Scheidecker)

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

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

6 years ago[SelectionDAGBuilder] Add restrictions to EmitFuncArgumentDbgValue
Bjorn Pettersson [Mon, 11 Feb 2019 19:23:30 +0000 (19:23 +0000)]
[SelectionDAGBuilder] Add restrictions to EmitFuncArgumentDbgValue

Summary:
This patch fixes PR40587.

When a dbg.value instrinsic is emitted to the DAG
by using EmitFuncArgumentDbgValue the resulting
DBG_VALUE is hoisted to the beginning of the entry
block. I think the idea is to be able to locate
a formal argument already from the start of the
function.
However, EmitFuncArgumentDbgValue only checked that
the value that was used to describe a variable was
originating from a function parameter, not that the
variable itself actually was an argument to the
function. So when for example assigning a local
variable "local" the value from an argument "a",
the assocated DBG_VALUE instruction would be hoisted
to the beginning of the function, even if the scope
for "local" started somewhere else (or if "local"
was mapped to other values earlier in the function).

This patch adds some logic to EmitFuncArgumentDbgValue
to check that the variable being described actually
is an argument to the function. And that the dbg.value
being lowered already is in the entry block. Otherwise
we bail out, and the dbg.value will be handled as an
ordinary dbg.value (not as a "FuncArgumentDbgValue").

A tricky situation is when both the variable and
the value is related to function arguments, but not
neccessarily the same argument. We make sure that we
do not describe the same argument more than once as
a "FuncArgumentDbgValue". This solution works as long
as opt has injected a "first" dbg.value that corresponds
to the formal argument at the function entry.

Reviewers: jmorse, aprantl

Subscribers: jyknight, hiraditya, fedor.sergeev, dstenb, llvm-commits

Tags: #llvm

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

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

6 years ago[LICM&MSSA] Limit store hoisting.
Alina Sbirlea [Mon, 11 Feb 2019 19:07:15 +0000 (19:07 +0000)]
[LICM&MSSA] Limit store hoisting.

Summary:
If there is no clobbering access for a store inside the loop, that store
can only be hoisted if there are no interfearing loads.
A more general verification introduced here: there are no loads that are
not optimized to an access outside the loop.
Addresses PR40586.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

Tags: #llvm

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

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

6 years ago[TargetLibraryInfo] Update run time support for Windows
Evandro Menezes [Mon, 11 Feb 2019 19:02:28 +0000 (19:02 +0000)]
[TargetLibraryInfo] Update run time support for Windows

It seems that the run time for Windows has changed and supports more math
functions than it used to, especially on AArch64, ARM, and AMD64.

Fixes PR40541.

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

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

6 years ago[AArch64][GlobalISel] Add isel support for a couple vector exts/truncs
Jessica Paquette [Mon, 11 Feb 2019 18:56:39 +0000 (18:56 +0000)]
[AArch64][GlobalISel] Add isel support for a couple vector exts/truncs

Add support for

- v4s16 <-> v4s32
- v2s64 <-> v2s32

And update tests that use them to show that we generate the correct
instructions.

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

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

6 years ago[GlobalISel][AArch64] NFC: Remove unnecessary IR from select-fp-casts.mir
Jessica Paquette [Mon, 11 Feb 2019 18:41:22 +0000 (18:41 +0000)]
[GlobalISel][AArch64] NFC: Remove unnecessary IR from select-fp-casts.mir

The IR section in this test doesn't do anything, so there's no point in it
being there. Since it's redundant, just remove it.

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

6 years ago[DebugInfo] Fix /usr/lib/debug llvm-symbolizer lookup with relative paths
Jordan Rupprecht [Mon, 11 Feb 2019 18:05:48 +0000 (18:05 +0000)]
[DebugInfo] Fix /usr/lib/debug llvm-symbolizer lookup with relative paths

Summary:
rL189250 added a realpath call, and rL352916 because realpath breaks assumptions with some build systems. However, the /usr/lib/debug case has been clarified, falling back to /usr/lib/debug is currently broken if the obj passed in is a relative path. Adding a call to use absolute paths when falling back to /usr/lib/debug fixes that while still not making any realpath assumptions.

This also adds a --fallback-debug-path command line flag for testing (since we probably can't write to /usr/lib/debug from buildbot environments), but was also verified manually:

```
$ rm -f path/to/dwarfdump-test.elf-x86-64
$ strace llvm-symbolizer --obj=relative/path/to/dwarfdump-test.elf-x86-64.debuglink 0x40113f |& grep dwarfdump
```

Lookups went to relative/path/to/dwarfdump-test.elf-x86-64, relative/path/to/.debug/dwarfdump-test.elf-x86-64, and then finally /usr/lib/debug/absolute/path/to/dwarfdump-test.elf-x86-64.

Reviewers: dblaikie, samsonov

Reviewed By: dblaikie

Subscribers: krytarowski, aprantl, hiraditya, llvm-commits

Tags: #llvm

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

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

6 years ago[MCA][Scheduler] Track resources that were found busy when issuing an instruction.
Andrea Di Biagio [Mon, 11 Feb 2019 17:55:47 +0000 (17:55 +0000)]
[MCA][Scheduler] Track resources that were found busy when issuing an instruction.

This is a follow up of r353706. When the scheduler fails to issue a ready
instruction to the underlying pipelines, it now updates a mask of 'busy resource
units'. That information will be used in future to obtain the set of
"problematic" resources in the case of bottlenecks caused by resource pressure.
No functional change intended.

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

6 years ago[PowerPC] Avoid scalarization of vector truncate
Roland Froese [Mon, 11 Feb 2019 17:29:14 +0000 (17:29 +0000)]
[PowerPC] Avoid scalarization of vector truncate

The PowerPC code generator currently scalarizes vector truncates that would fit in a vector register, resulting in vector extracts, scalar operations, and vector merges. This patch custom lowers a vector truncate that would fit in a register to a vector shuffle instead.

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

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

6 years ago[GlobalISel][AArch64] Select G_FFLOOR
Jessica Paquette [Mon, 11 Feb 2019 17:22:58 +0000 (17:22 +0000)]
[GlobalISel][AArch64] Select G_FFLOOR

This teaches the legalizer about G_FFLOOR, and lets us select G_FFLOOR in
AArch64.

It updates the existing floating point tests, and adds a select-floor.mir test.

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

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

6 years agoRecommit "[GlobalISel] Add IRTranslator support for G_FFLOOR"
Jessica Paquette [Mon, 11 Feb 2019 17:16:32 +0000 (17:16 +0000)]
Recommit "[GlobalISel] Add IRTranslator support for G_FFLOOR"

After the changes introduced in r353586, this instruction doesn't cause any
issues for any backend.

Original review: https://reviews.llvm.org/D57485

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

6 years agoGlobalISel: Add G_FCANONICALIZE instruction
Matt Arsenault [Mon, 11 Feb 2019 17:05:20 +0000 (17:05 +0000)]
GlobalISel: Add G_FCANONICALIZE instruction

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

6 years ago[AMDGPU] fix atomic_optimizations_buffer.ll test after DPP combiner was enabled by...
Valery Pykhtin [Mon, 11 Feb 2019 16:28:42 +0000 (16:28 +0000)]
[AMDGPU] fix atomic_optimizations_buffer.ll test after DPP combiner was enabled by default.

Related commits: rL353691, rL353703.

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

6 years ago[X86] Regenerate insertelement tests
Simon Pilgrim [Mon, 11 Feb 2019 16:16:09 +0000 (16:16 +0000)]
[X86] Regenerate insertelement tests

Add common X86/X64 prefixes (and use X86 instead of X32)

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

6 years agoAdd recipes for migrating downstream branches of git mirrors
David Greene [Mon, 11 Feb 2019 15:40:02 +0000 (15:40 +0000)]
Add recipes for migrating downstream branches of git mirrors

Add some common recipes for downstream users developing on top of the
existing git mirrors. These instructions show how to migrate local
branches to the monorepo.

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

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

6 years agoMove some classes into anonymous namespaces. NFC.
Benjamin Kramer [Mon, 11 Feb 2019 15:16:21 +0000 (15:16 +0000)]
Move some classes into anonymous namespaces. NFC.

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

6 years ago[MCA] Return a mask of busy resources from method ResourceManager::checkAvailability...
Andrea Di Biagio [Mon, 11 Feb 2019 14:53:04 +0000 (14:53 +0000)]
[MCA] Return a mask of busy resources from method ResourceManager::checkAvailability(). NFCI

In case of bottlenecks caused by pipeline pressure, we want to be able to
correctly report the set of problematic pipelines. This is a first step towards
adding support for bottleneck hints in llvm-mca (see PR37494). No functional
change intended.

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

6 years ago[AMDGPU] Remove unused variable
Benjamin Kramer [Mon, 11 Feb 2019 14:49:54 +0000 (14:49 +0000)]
[AMDGPU] Remove unused variable

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

6 years ago[AMDGPU] Fix DPP sequence in atomic optimizer.
Neil Henning [Mon, 11 Feb 2019 14:44:14 +0000 (14:44 +0000)]
[AMDGPU] Fix DPP sequence in atomic optimizer.

This commit fixes the DPP sequence in the atomic optimizer (which was
previously missing the row_shr:3 step), and works around a read_register
exec bug by using a ballot instead.

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

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

6 years agoRevert "[X86][SSE] Generalize X86ISD::BLENDI support to more value types"
Sam McCall [Mon, 11 Feb 2019 14:05:36 +0000 (14:05 +0000)]
Revert "[X86][SSE] Generalize X86ISD::BLENDI support to more value types"

This reverts commit r353610.
It causes a miscompile visible in macro expansion in a bootstrapped clang.

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190211/626590.html

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

6 years ago[TEST] Add missing opportunity test for PR39673
Max Kazantsev [Mon, 11 Feb 2019 12:58:18 +0000 (12:58 +0000)]
[TEST] Add missing opportunity test for PR39673

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

6 years ago[ARM] Add v8m.base pattern for add negative imm
Sam Parker [Mon, 11 Feb 2019 11:35:42 +0000 (11:35 +0000)]
[ARM] Add v8m.base pattern for add negative imm

The v8m.base ISA contains movw, which can operate on an unsigned
16-bit value. Add the pattern that converts an add with a negative
value, that could fit into 16-bits when negated, into a sub with that
positive value.

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

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

6 years ago[AMDGPU] Enable DPP combiner pass by default.
Valery Pykhtin [Mon, 11 Feb 2019 11:15:03 +0000 (11:15 +0000)]
[AMDGPU] Enable DPP combiner pass by default.

Related revisions: https://reviews.llvm.org/D55444, https://reviews.llvm.org/D55314

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

6 years ago[NFC][ARM] Simplify loop-indexing codegen test
Sam Parker [Mon, 11 Feb 2019 10:52:49 +0000 (10:52 +0000)]
[NFC][ARM] Simplify loop-indexing codegen test

Remove unnecessary offset checks, CHECK-BASE checks and add some
extra -NOT checks and TODO comments.

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

6 years ago[TEST] Add failing test from PR40454
Max Kazantsev [Mon, 11 Feb 2019 10:44:57 +0000 (10:44 +0000)]
[TEST] Add failing test from PR40454

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

6 years agotest-release.sh: Add option to use ninja
Diana Picus [Mon, 11 Feb 2019 10:30:22 +0000 (10:30 +0000)]
test-release.sh: Add option to use ninja

Allow the use of ninja instead of make. This is useful on some
platforms where we'd like to be able to limit the number of link jobs
without slowing down the other steps of the release.

This patch adds a -use-ninja command line option, which sets the
generator to Ninja both for LLVM and the test-suite. It also deals with
some differences between make and ninja:
* DESTDIR handling - ninja doesn't like this to be listed after the
  target, but both make and ninja can handle it before the command
* Verbose mode - ninja uses -v, make uses VERBOSE=1
* Keep going mode - make has a -k mode, which builds as much as possible
  even when failures are encountered; for ninja we need to set a hard
  limit (we use 100 since most people won't look at 100 failures anyway)

I haven't tested with gmake.

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

6 years agoAttempt to fix buildbot after r353679 #2
Eugene Leviant [Mon, 11 Feb 2019 10:17:17 +0000 (10:17 +0000)]
Attempt to fix buildbot after r353679 #2

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

6 years ago[DWARF] LLVM ERROR: Broken function found, while removing Debug Intrinsics.
Carlos Alberto Enciso [Mon, 11 Feb 2019 10:16:38 +0000 (10:16 +0000)]
[DWARF] LLVM ERROR: Broken function found, while removing Debug Intrinsics.

Check that when SimplifyCFG is flattening a 'br', all their debug intrinsic instructions are removed, including any dbg.label referencing a label associated with the basic blocks being removed.

As the test case involves a CFG transformation, move it to the correct location.

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

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

6 years agoAttempt to fix buildbot after r353679
Eugene Leviant [Mon, 11 Feb 2019 10:12:19 +0000 (10:12 +0000)]
Attempt to fix buildbot after r353679

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

6 years agoSmall refactoring of FileError. NFC.
Eugene Leviant [Mon, 11 Feb 2019 09:49:37 +0000 (09:49 +0000)]
Small refactoring of FileError. NFC.

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

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

6 years ago[ARM] LoadStoreOptimizer: reoder limit
Sjoerd Meijer [Mon, 11 Feb 2019 09:37:42 +0000 (09:37 +0000)]
[ARM] LoadStoreOptimizer: reoder limit

The whole design of generating LDMs/STMs is fragile and unreliable: it depends on
rescheduling here in the LoadStoreOptimizer that isn't register pressure aware
and regalloc that isn't aware of generating LDMs/STMs.
This patch adds a (hidden) option to control the total number of instructions that
can be re-ordered. I appreciate this looks only a tiny bit better than a hard-coded
constant, but at least it allows more easy experimentation with different values
for now. Ideally we calculate this reorder limit based on some heuristics, and take
register pressure into account. I might be looking into that next.

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

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

6 years agoMove CFLGraph and the AA summary code over to the new `CallBase`
Chandler Carruth [Mon, 11 Feb 2019 09:25:41 +0000 (09:25 +0000)]
Move CFLGraph and the AA summary code over to the new `CallBase`
instruction base class rather than the `CallSite` wrapper.

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

6 years ago[llvm] [cmake] Use current directory in GenerateVersionFromVCS
Michal Gorny [Mon, 11 Feb 2019 09:07:07 +0000 (09:07 +0000)]
[llvm] [cmake] Use current directory in GenerateVersionFromVCS

Find dependent scripts of GenerateVersionFromVCS in current directory
rather than ../../cmake/modules.  I do not see any reason why the former
would not work and The latter is incorrect when GenerateVersionFromVCS
is used from install directory (i.e. in stand-alone builds).

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

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

6 years agoRemove `CallSite` from the CodeMetrics analysis, moving it to the new
Chandler Carruth [Mon, 11 Feb 2019 09:03:32 +0000 (09:03 +0000)]
Remove `CallSite` from the CodeMetrics analysis, moving it to the new
`CallBase` and simpler APIs therein.

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

6 years agoRemove a declaration that is dead, and not even implemented any longer.
Chandler Carruth [Mon, 11 Feb 2019 09:03:26 +0000 (09:03 +0000)]
Remove a declaration that is dead, and not even implemented any longer.

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

6 years ago[ARM] LoadStoreOptimizer: just a clean-up. NFC.
Sjoerd Meijer [Mon, 11 Feb 2019 08:47:59 +0000 (08:47 +0000)]
[ARM] LoadStoreOptimizer: just a clean-up. NFC.

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

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

6 years agoUpdate more files added with the old header to the new one.
Chandler Carruth [Mon, 11 Feb 2019 08:25:56 +0000 (08:25 +0000)]
Update more files added with the old header to the new one.

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

6 years agoUpdate new files added to llvm-objcopy to use the new file header.
Chandler Carruth [Mon, 11 Feb 2019 08:25:19 +0000 (08:25 +0000)]
Update new files added to llvm-objcopy to use the new file header.

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

6 years agoUpdate files that were mistakenly added with the old file header to the
Chandler Carruth [Mon, 11 Feb 2019 08:07:38 +0000 (08:07 +0000)]
Update files that were mistakenly added with the old file header to the
new one.

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

6 years agoUpdate files that were mistakenly added with the old file header.
Chandler Carruth [Mon, 11 Feb 2019 08:07:32 +0000 (08:07 +0000)]
Update files that were mistakenly added with the old file header.

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

6 years ago[CallSite removal] Port InstSimplify over to use `CallBase` both in its
Chandler Carruth [Mon, 11 Feb 2019 07:54:10 +0000 (07:54 +0000)]
[CallSite removal] Port InstSimplify over to use `CallBase` both in its
interface and implementation.

Port code with: `cast<CallBase>(CS.getInstruction())`.

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

6 years ago[CallSite removal] Migrate ConstantFolding APIs and implementation to
Chandler Carruth [Mon, 11 Feb 2019 07:51:44 +0000 (07:51 +0000)]
[CallSite removal] Migrate ConstantFolding APIs and implementation to
`CallBase`.

Users have been updated. You can see how to update any out-of-tree
usages: pass `cast<CallBase>(CS.getInstruction())`.

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

6 years ago[CallSite removal] Migrate the statepoint GC infrastructure to use the
Chandler Carruth [Mon, 11 Feb 2019 07:42:30 +0000 (07:42 +0000)]
[CallSite removal] Migrate the statepoint GC infrastructure to use the
`CallBase` class rather than `CallSite` wrappers.

I pushed this change down through most of the statepoint infrastructure,
completely removing the use of CallSite where I could reasonably do so.
I ended up making a couple of cut-points: generic call handling
(instcombine, TLI, SDAG). As soon as it hit truly generic handling with
users outside the immediate code, I simply transitioned into or out of
a `CallSite` to make this a reasonable sized chunk.

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

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

6 years ago[X86] Removed unused SDTypeProfile. NFC
Craig Topper [Mon, 11 Feb 2019 07:30:48 +0000 (07:30 +0000)]
[X86] Removed unused SDTypeProfile. NFC

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

6 years agogn build: Fix clang-tidy dep on ClangSACheckers.
Nico Weber [Mon, 11 Feb 2019 03:09:57 +0000 (03:09 +0000)]
gn build: Fix clang-tidy dep on ClangSACheckers.

Patch by Mirko Bonadei <mbonadei@webrtc.org>!

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

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

6 years ago[X86] EltsFromConsecutiveLoads - replace SmallBitVector with APInt (NFC).
Simon Pilgrim [Sun, 10 Feb 2019 22:45:48 +0000 (22:45 +0000)]
[X86] EltsFromConsecutiveLoads - replace SmallBitVector with APInt (NFC).

Minor refactor to simplify some incoming patches to improve broadcast loads.

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

6 years ago[GlobalISel] Regex the opcodes in unit test to fix non-deterministic ordering
Mandeep Singh Grang [Sun, 10 Feb 2019 19:53:43 +0000 (19:53 +0000)]
[GlobalISel] Regex the opcodes in unit test to fix non-deterministic ordering

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

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

6 years ago[CodeGen][X86] Don't scalarize vector saturating add/sub
Nikita Popov [Sun, 10 Feb 2019 19:06:38 +0000 (19:06 +0000)]
[CodeGen][X86] Don't scalarize vector saturating add/sub

Now that we have vector support for [US](ADD|SUB)O we no longer
need to scalarize when expanding [US](ADD|SUB)SAT.

This matches what the cost model already does.

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

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

6 years ago[AArch64] Regenerate bswap tests
Simon Pilgrim [Sun, 10 Feb 2019 18:27:37 +0000 (18:27 +0000)]
[AArch64] Regenerate bswap tests

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

6 years ago[X86] Add basic bitreverse/bswap combine tests
Simon Pilgrim [Sun, 10 Feb 2019 18:07:03 +0000 (18:07 +0000)]
[X86] Add basic bitreverse/bswap combine tests

Shows missing SimplifyDemandedBits support

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

6 years ago[DAG] Add optional AllowUndefs to isNullOrNullSplat
Simon Pilgrim [Sun, 10 Feb 2019 17:42:15 +0000 (17:42 +0000)]
[DAG] Add optional AllowUndefs to isNullOrNullSplat

No change in default behaviour (AllowUndefs = false)

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

6 years ago[DAGCombine] Simplify funnel shifts with undef/zero args to bitshifts
Simon Pilgrim [Sun, 10 Feb 2019 17:04:00 +0000 (17:04 +0000)]
[DAGCombine] Simplify funnel shifts with undef/zero args to bitshifts

Now that we have SimplifyDemandedBits support for funnel shifts (rL353539), we need to simplify funnel shifts back to bitshifts in cases where either argument has been folded to undef/zero.

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

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

6 years ago[X86] Add masked variable tests for funnel undef/zero argument combines
Simon Pilgrim [Sun, 10 Feb 2019 15:46:32 +0000 (15:46 +0000)]
[X86] Add masked variable tests for funnel undef/zero argument combines

I've avoided 'modulo' masks as we'll SimplifyDemandedBits those in the future, and we just need to check that the shift variable is 'in range'

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

6 years ago[x86] narrow 256-bit horizontal ops via demanded elements
Sanjay Patel [Sun, 10 Feb 2019 15:22:06 +0000 (15:22 +0000)]
[x86] narrow 256-bit horizontal ops via demanded elements

256-bit horizontal math ops are an x86 monstrosity (and thankfully have
not been extended to 512-bit AFAIK).

The two 128-bit halves operate on separate halves of the inputs. So if we
don't demand anything in the upper half of the result, we can extract the
low halves of the inputs, do the math, and then insert that result into a
256-bit output.

All of the extract/insert is free (ymm<-->xmm), so we're left with a
narrower (cheaper) version of the original op.

In the affected tests based on:
https://bugs.llvm.org/show_bug.cgi?id=33758
https://bugs.llvm.org/show_bug.cgi?id=38971
...we see that the h-op narrowing can result in further narrowing of other
math via existing generic transforms.

I originally drafted this patch as an exact pattern match starting from
extract_vector_elt, but I thought we might see diffs starting from
extract_subvector too, so I changed it to a more general demanded elements
solution. There are no extra existing regression test improvements from
that switch though, so we could go back.

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

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

6 years ago[X86] Add additional tests for funnel undef/zero argument combines
Simon Pilgrim [Sun, 10 Feb 2019 14:54:57 +0000 (14:54 +0000)]
[X86] Add additional tests for funnel undef/zero argument combines

As suggested on D58009

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

6 years ago[TargetLowering] refactor setcc folds to fix another miscompile (PR40657)
Sanjay Patel [Sun, 10 Feb 2019 14:29:57 +0000 (14:29 +0000)]
[TargetLowering] refactor setcc folds to fix another miscompile (PR40657)

SimplifySetCC still has much room for improvement, but this should
fix the remaining problem examples from:
https://bugs.llvm.org/show_bug.cgi?id=40657

The initial fix for this problem was rL353615.

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

6 years ago[X86][SSE] Add SimplifyDemandedBits test for BLENDVPD
Simon Pilgrim [Sun, 10 Feb 2019 12:55:44 +0000 (12:55 +0000)]
[X86][SSE] Add SimplifyDemandedBits test for BLENDVPD

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

6 years ago[Local] Delete a redundant check. NFC
Fangrui Song [Sun, 10 Feb 2019 09:25:56 +0000 (09:25 +0000)]
[Local] Delete a redundant check. NFC

isInstructionTriviallyDead also performs the use_empty() check.

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

6 years ago[yaml2obj] - Fix .dynamic section entries writing for 32bit targets.
George Rimar [Sun, 10 Feb 2019 08:35:38 +0000 (08:35 +0000)]
[yaml2obj] - Fix .dynamic section entries writing for 32bit targets.

This was introduced by me in r353613.

I tried to fix Big-endian bot and replaced
uintX_t -> ELFT::Xword. But ELFT::Xword is a packed<uint64_t>,
so it is always 8 bytes and that was obviously incorrect.

My intention was to use something like packed<uint> actually, which
size is target dependent.

Patch fixes this bug and adds a test case, since no bots seems reported this.

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

6 years ago[X86] Move some vector InstAliases out from under unnecessary 'let Predicates'. NFCI
Craig Topper [Sun, 10 Feb 2019 02:34:31 +0000 (02:34 +0000)]
[X86] Move some vector InstAliases out from under unnecessary 'let Predicates'. NFCI

We don't have any assembler predicates for vector ISAs so this isn't necessary. It just adds extra lines and identation.

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

6 years ago[InstCombine] Fix an unused variable warning.
Craig Topper [Sun, 10 Feb 2019 02:21:29 +0000 (02:21 +0000)]
[InstCombine] Fix an unused variable warning.

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

6 years ago[X86] Add tests for funnel undef argument combines
Simon Pilgrim [Sat, 9 Feb 2019 22:21:09 +0000 (22:21 +0000)]
[X86] Add tests for funnel undef argument combines

If one of the shifted arguments is undef we should be folding to a regular shift.

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

6 years ago[X86] CombineOr - fold to generic funnel shifts
Simon Pilgrim [Sat, 9 Feb 2019 20:34:59 +0000 (20:34 +0000)]
[X86] CombineOr - fold to generic funnel shifts

As discussed on D57389, this is a first step towards moving the SHLD/SHRD matching code to DAGCombiner using FSHL/FSHR instead.

There's a bit of work to do before I can do that, so this just folds to FSHL/FSHR in the existing code (handling the different SHRD/FSHR argument ordering), which fixes the issue we had with i16 shift amounts not being correctly masked.

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