]> granicus.if.org Git - llvm/log
llvm
8 years ago[NVPTX] Remove unnecessary isImageReadoOnly(), isImageWriteOnly(), & isImageReadWrite...
Justin Lebar [Wed, 8 Mar 2017 01:14:15 +0000 (01:14 +0000)]
[NVPTX] Remove unnecessary isImageReadoOnly(), isImageWriteOnly(), & isImageReadWrite calls

This is repetition of isImage() function in NVPTXUtilities.cpp.

Patch by Briana Grace!

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

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

8 years agoAMDGPU: Don't wait at end of block with a trivial successor
Matt Arsenault [Wed, 8 Mar 2017 01:06:58 +0000 (01:06 +0000)]
AMDGPU: Don't wait at end of block with a trivial successor

If there is only one successor, and that successor only
has one predecessor the wait can obviously be delayed until
uses or the end of the next block. This avoids code quality
regressions when there are trivial fallthrough blocks inserted
for structurization.

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

8 years ago[DAGCombine] Simplify ISD::AND in GetDemandedBits.
Eli Friedman [Wed, 8 Mar 2017 00:56:35 +0000 (00:56 +0000)]
[DAGCombine] Simplify ISD::AND in GetDemandedBits.

This helps in cases involving bitfields where an AND is exposed by
legalization.

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

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

8 years agoAMDGPU: Constant fold rcp node
Matt Arsenault [Wed, 8 Mar 2017 00:48:46 +0000 (00:48 +0000)]
AMDGPU: Constant fold rcp node

When doing arcp optimization with a constant denominator,
this was leaving behind rcps with constant inputs.

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

8 years ago[DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
Konstantin Zhuravlyov [Wed, 8 Mar 2017 00:28:57 +0000 (00:28 +0000)]
[DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef

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

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

8 years agoFix additional constructor call missed by r297241.
Daniel Sanders [Tue, 7 Mar 2017 23:32:10 +0000 (23:32 +0000)]
Fix additional constructor call missed by r297241.

It was added between my build+test and my commit.

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

8 years agoAMDGPU/SI: Do not insert EndCf in an unreachable block
Changpeng Fang [Tue, 7 Mar 2017 23:29:36 +0000 (23:29 +0000)]
AMDGPU/SI: Do not insert EndCf in an unreachable block

Reviewers:
  arsenm

Differential Revision:
  http://reviews.llvm.org/D22025

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

8 years ago[InstCombine] shrink truncated insertelement into undef vector
Sanjay Patel [Tue, 7 Mar 2017 23:27:14 +0000 (23:27 +0000)]
[InstCombine] shrink truncated insertelement into undef vector

This is the 2nd part of solving:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

D30123 moves the trunc ahead of the shuffle, and this moves the trunc ahead of the insertelement.
We're limiting this transform to undef rather than any constant to avoid backend problems.

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

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

8 years agoRecommit: [globalisel] Change LLT constructor string into an LLT-based object that...
Daniel Sanders [Tue, 7 Mar 2017 23:20:35 +0000 (23:20 +0000)]
Recommit: [globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.

Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

The problem with the previous commit appears to have been that TableGen was including CodeGen/LowLevelType.h instead of Support/LowLevelTypeImpl.h.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

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

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

8 years ago[Hexagon] Check for presence before looking registers up in bit tracker
Krzysztof Parzyszek [Tue, 7 Mar 2017 23:12:04 +0000 (23:12 +0000)]
[Hexagon] Check for presence before looking registers up in bit tracker

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

8 years ago[Hexagon] Generate bitsplit instruction
Krzysztof Parzyszek [Tue, 7 Mar 2017 23:08:35 +0000 (23:08 +0000)]
[Hexagon] Generate bitsplit instruction

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

8 years agoGlobalISel: use inserts for landingpad instead of sequences.
Tim Northover [Tue, 7 Mar 2017 23:04:06 +0000 (23:04 +0000)]
GlobalISel: use inserts for landingpad instead of sequences.

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

8 years agoFix one-after-the-end type metadata handling in globalsplit.
Evgeniy Stepanov [Tue, 7 Mar 2017 22:18:48 +0000 (22:18 +0000)]
Fix one-after-the-end type metadata handling in globalsplit.

Itanium ABI may have an address point one byte after the end of a
vtable. When such vtable global is split, the !type metadata needs to
follow the right vtable.

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

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

8 years agoADT: Fix SmallPtrSet iterators in reverse mode
Duncan P. N. Exon Smith [Tue, 7 Mar 2017 21:56:32 +0000 (21:56 +0000)]
ADT: Fix SmallPtrSet iterators in reverse mode

Fix SmallPtrSet::iterator behaviour and creation ReverseIterate is true.

  - Any function that creates an iterator now uses
    SmallPtrSet::makeIterator, which creates an iterator that
    dereferences to the given pointer.

  - In reverse-iterate mode, initialze iterator::End with "CurArray"
    instead of EndPointer.

  - In reverse-iterate mode, the current node is iterator::Buffer[-1].
    iterator::operator* and SmallPtrSet::makeIterator are the only ones
    that need to know.

  - Fix the assertions for reverse-iterate mode.

This fixes the tests Danny B added in r297182, and adds a couple of
others to confirm that dereferencing does the right thing, regardless of
how the iterator was found, and that iteration works correctly from each
return from find.

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

8 years agoFix source-lines test on Windows.
Zachary Turner [Tue, 7 Mar 2017 21:53:21 +0000 (21:53 +0000)]
Fix source-lines test on Windows.

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

8 years ago[InstCombine] shrink truncated splat shuffle (2nd try)
Sanjay Patel [Tue, 7 Mar 2017 21:45:16 +0000 (21:45 +0000)]
[InstCombine] shrink truncated splat shuffle (2nd try)

This was committed at r297155 and reverted at r297166 because of an
over-reaching clang test. That should be fixed with r297189.

This is one part of solving a recent bug report:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

This keeps with our general approach: changing arbitrary shuffles is off-limts,
but changing splat is ok. The transform is very similar to the existing
shrinkBitwiseLogic() canonicalization.

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

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

8 years ago[ObjectYAML] Fix issue with DWARF2 AddrSize 8
Chris Bieneman [Tue, 7 Mar 2017 21:34:35 +0000 (21:34 +0000)]
[ObjectYAML] Fix issue with DWARF2 AddrSize 8

In my refactoring I introduced a bug where we were using the reference size instead of the offset size for DW_FORM_strp and similar forms.

This patch resolves the error and adds a test case testing all the DWARF forms for DWARF2 AddrSize 8. There is similar coverage already in the DWARFDebugInfoTest sources that covers the parser. Once I migrate the DWARFGenerator APIs to be built on the YAML tools they will be fully covered under the same tests.

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

8 years agoGlobalISel: fix legalization of G_INSERT
Tim Northover [Tue, 7 Mar 2017 21:24:33 +0000 (21:24 +0000)]
GlobalISel: fix legalization of G_INSERT

We were calculating incorrect extract/insert offsets by trying to be too
tricksy with min/max. It's clearer to just split the logic up into "register
starts before this segment" vs "after".

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

8 years agoStrip trailing whitespace.
Simon Pilgrim [Tue, 7 Mar 2017 21:16:38 +0000 (21:16 +0000)]
Strip trailing whitespace.

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

8 years ago[coroutines] Add handling for unwind coro.ends
Gor Nishanov [Tue, 7 Mar 2017 21:00:54 +0000 (21:00 +0000)]
[coroutines] Add handling for unwind coro.ends

Summary:
The purpose of coro.end intrinsic is to allow frontends to mark the cleanup and
other code that is only relevant during the initial invocation of the coroutine
and should not be present in resume and destroy parts.

In landing pads coro.end is replaced with an appropriate instruction to unwind to
caller. The handling of coro.end differs depending on whether the target is
using landingpad or WinEH exception model.

For landingpad based exception model, it is expected that frontend uses the
`coro.end`_ intrinsic as follows:

```
    ehcleanup:
      %InResumePart = call i1 @llvm.coro.end(i8* null, i1 true)
      br i1 %InResumePart, label %eh.resume, label %cleanup.cont

    cleanup.cont:
      ; rest of the cleanup

    eh.resume:
      %exn = load i8*, i8** %exn.slot, align 8
      %sel = load i32, i32* %ehselector.slot, align 4
      %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0
      %lpad.val29 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1
      resume { i8*, i32 } %lpad.val29

```
The `CoroSpit` pass replaces `coro.end` with ``True`` in the resume functions,
thus leading to immediate unwind to the caller, whereas in start function it
is replaced with ``False``, thus allowing to proceed to the rest of the cleanup
code that is only needed during initial invocation of the coroutine.

For Windows Exception handling model, a frontend should attach a funclet bundle
referring to an enclosing cleanuppad as follows:

```
    ehcleanup:
      %tok = cleanuppad within none []
      %unused = call i1 @llvm.coro.end(i8* null, i1 true) [ "funclet"(token %tok) ]
      cleanupret from %tok unwind label %RestOfTheCleanup
```

The `CoroSplit` pass, if the funclet bundle is present, will insert
``cleanupret from %tok unwind to caller`` before
the `coro.end`_ intrinsic and will remove the rest of the block.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits, mehdi_amini

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

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

8 years agoImplement FreeMachineFunction::getPassName().
Yaron Keren [Tue, 7 Mar 2017 20:59:08 +0000 (20:59 +0000)]
Implement FreeMachineFunction::getPassName().

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

8 years ago[GlobalISel] Don't translate intrinsics with metadata parameters.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:09 +0000 (20:53 +0000)]
[GlobalISel] Don't translate intrinsics with metadata parameters.

Some intrinsics take metadata parameters.  These all need custom
handling of some form, and cannot possibly be lowered generically to
G_INTRINSIC calls with vreg operands.
Reject them, instead of hitting an assert later in getOrCreateVReg.

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

8 years ago[GlobalISel] Avoid invalidating ValToVReg when translating no-op bitcast.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:06 +0000 (20:53 +0000)]
[GlobalISel] Avoid invalidating ValToVReg when translating no-op bitcast.

When we translate a no-op (same type) bitcast, we try to be clever and
only emit a COPY if we already assigned a vreg to the defined value.
However, when we didn't, we tried to assign to a reference into the
ValToVReg DenseMap, even though the RHS of the assignment
(getOrCreateVReg) could potentially grow that DenseMap, invalidating the
reference.

Avoid that by getting the source vreg first.
I audited the rest of the translator; this is the only tricky case.

The test is quite unwieldy, as the problem is caused by the DenseMap
growing, which happens after the 47th mapped value.

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

8 years ago[GlobalISel] Relax vector G_SELECT assertion.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:03 +0000 (20:53 +0000)]
[GlobalISel] Relax vector G_SELECT assertion.

For vector operands, the `select` instruction supports both vector and
non-vector conditions.  The MIR builder had an overly restrictive
assertion, that only accepted vector conditions for vector selects
(in effect implementing ISD::VSELECT).

Make it possible to express the full range of G_SELECTs.

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

8 years ago[GlobalISel] Add vector select translation test. NFC.
Ahmed Bougacha [Tue, 7 Mar 2017 20:53:00 +0000 (20:53 +0000)]
[GlobalISel] Add vector select translation test. NFC.

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

8 years ago[GlobalISel] Slightly clean up DBG_VALUE FP build code.
Ahmed Bougacha [Tue, 7 Mar 2017 20:52:57 +0000 (20:52 +0000)]
[GlobalISel] Slightly clean up DBG_VALUE FP build code.

I messed up my rebases leading to r297200, and ended up with stale (but
working) code.  Fix it.

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

8 years ago[fuzzer] Don't crash if LLVMFuzzerMutate was called by CustomCrossOver
Vitaly Buka [Tue, 7 Mar 2017 20:37:38 +0000 (20:37 +0000)]
[fuzzer] Don't crash if LLVMFuzzerMutate was called by CustomCrossOver

Reviewers: kcc

Subscribers: llvm-commits, mgorny

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

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

8 years ago[GlobalISel] Ignore %noreg when applying default regbank mapping.
Ahmed Bougacha [Tue, 7 Mar 2017 20:34:23 +0000 (20:34 +0000)]
[GlobalISel] Ignore %noreg when applying default regbank mapping.

When computing the mapping for non-generic instructions, we skipped
%noreg operands, because we can't always reason about their banks.

Also skip them when applying the mapping.  Otherwise, we could end
up with mappings that we can't apply.

While there, duplicate an assert to distinguish between the two
error conditions.

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

8 years ago[GlobalISel] Emit DBG_VALUE %noreg for non-int/fp constant values.
Ahmed Bougacha [Tue, 7 Mar 2017 20:34:20 +0000 (20:34 +0000)]
[GlobalISel] Emit DBG_VALUE %noreg for non-int/fp constant values.

When a dbg_value has a constant operand that isn't representable in MI,
there isn't much we can do.  Use %noreg (0) for those situations.
This matches the SelectionDAG behavior.

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

8 years ago[GlobalISel] Add constant dbg.value translation tests. NFC.
Ahmed Bougacha [Tue, 7 Mar 2017 20:34:13 +0000 (20:34 +0000)]
[GlobalISel] Add constant dbg.value translation tests. NFC.

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

8 years ago[NVPTX] Fixed lowering of unaligned loads/stores of f16 scalars and vectors.
Artem Belevich [Tue, 7 Mar 2017 20:33:38 +0000 (20:33 +0000)]
[NVPTX] Fixed lowering of unaligned loads/stores of f16 scalars and vectors.

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

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

8 years agoSjLjEHPrepare: Fix the pass for swifterror arguments
Arnold Schwaighofer [Tue, 7 Mar 2017 20:29:02 +0000 (20:29 +0000)]
SjLjEHPrepare: Fix the pass for swifterror arguments

We cannot leave the identity copies 'select true, arg, undef' that this pass
inserts for arguments to simplify handling of values on swifterror arguments.

swifterror arguments have restrictions on their uses.

rdar://30839288

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

8 years agoFix bugpoint to work with swifterror values
Arnold Schwaighofer [Tue, 7 Mar 2017 20:28:59 +0000 (20:28 +0000)]
Fix bugpoint to work with swifterror values

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

8 years agollvm-objdump: handle line numbers and source options for amdgpu objects
Konstantin Zhuravlyov [Tue, 7 Mar 2017 20:17:11 +0000 (20:17 +0000)]
llvm-objdump: handle line numbers and source options for amdgpu objects

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

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

8 years agoFix C2712 build error on Windows
Konstantin Zhuravlyov [Tue, 7 Mar 2017 20:09:46 +0000 (20:09 +0000)]
Fix C2712 build error on Windows

Move the __try/__except block outside of the set_thread_name function to avoid a conflict with object unwinding due to the use of the llvm::Storage.

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

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

8 years ago[AArch64] Vulcan is now ThunderXT99
Joel Jones [Tue, 7 Mar 2017 19:42:40 +0000 (19:42 +0000)]
[AArch64] Vulcan is now ThunderXT99

Broadcom Vulcan is now Cavium ThunderX2T99.

LLVM Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32113

Minor fixes for the alignments of loops and functions for
ThunderX T81/T83/T88 (better performance).

Patch was tested with SpecCPU2006.

Patch by Stefan Teleman

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

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

8 years agoRevert r297177: Change LLT constructor string into an LLT-based object ...
Daniel Sanders [Tue, 7 Mar 2017 19:21:23 +0000 (19:21 +0000)]
Revert r297177: Change LLT constructor string into an LLT-based object ...

More module problems. This time it only showed up in the stage 2 compile of
clang-x86_64-linux-selfhost-modules-2 but not the stage 1 compile.

Somehow, this change causes the build to need Attributes.gen before it's been
generated.

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

8 years ago[JumpThread] Simplify CmpInst-as-Condition branch-folding a bit.
Xin Tong [Tue, 7 Mar 2017 18:59:09 +0000 (18:59 +0000)]
[JumpThread] Simplify CmpInst-as-Condition branch-folding a bit.

Summary: Simplify CmpInst-as-Condition branch-folding a bit.

Reviewers: sanjoy, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

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

8 years ago[cmake] Include openmp with add_llvm_external_project
Pirama Arumuga Nainar [Tue, 7 Mar 2017 18:54:17 +0000 (18:54 +0000)]
[cmake] Include openmp with add_llvm_external_project

Summary:
Include projects/openmp into the build using add_llvm_external_project
instead of add_subdirectory.  This creates an option
LLVM_TOOL_OPENMP_BUILD that selects whether this project gets included
in an in-tree build.

Reviewers: beanz, AndreyChurbanov, jlpeyton

Subscribers: srhines, openmp-commits, llvm-commits, mgorny

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

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

8 years ago[ObjectYAML] Add support for DWARF5 Unit header
Chris Bieneman [Tue, 7 Mar 2017 18:50:58 +0000 (18:50 +0000)]
[ObjectYAML] Add support for DWARF5 Unit header

In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields.

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

8 years agoAdd unit tests for changes to SmallPtrSet and PointerLikeTypeTraits
Daniel Berlin [Tue, 7 Mar 2017 18:47:52 +0000 (18:47 +0000)]
Add unit tests for changes to SmallPtrSet and PointerLikeTypeTraits

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

8 years agoAdd PointerLikeTypeTraits for const things, as long as there is one for the non-const...
Daniel Berlin [Tue, 7 Mar 2017 18:47:50 +0000 (18:47 +0000)]
Add PointerLikeTypeTraits for const things, as long as there is one for the non-const version. Clang and other users have a number of types they use as pointers, and this avoids having to define both const and non-const versions of PointerLikeTraits.

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

8 years agoMake SmallPtrSet count and find able to take const PtrType's
Daniel Berlin [Tue, 7 Mar 2017 18:47:48 +0000 (18:47 +0000)]
Make SmallPtrSet count and find able to take const PtrType's

Summary:
For our set/map types, count/find normally take const references.
This works well for non-pointer types, but can suck for pointer
types.

DenseSet<int *> foo;
const int *b = nullptr;
foo.count(b) does not work

but the equivalent reference version does work
(patch to fix DenseSet/DenseMap coming up)
For SmallPtrSet, you have no such option.

The following will not work right now:
SmallPtrSet<int *> foo;
const int *b = nullptr;
foo.count(b);

This makes const correctness hard in some cases.
Example:
SmallPtrSet<Instruction *> InstructionsToErase;

You can't make this SmallPtrSet<const Instruction *> because then you
can't erase the instruction.  If I want to see if something is in the
set, I may only have a const Instruction *.  Given that count and find
are non-mutating, this should just work.

The places in our code base that do this resort to const_cast :(.

This patch makes count and find able to be used with const Instruction
* in the above SmallPtrSet examples.

This is a bit annoying because of where C++ applies the const, so we
have to remove the pointer type from the passed-in-type and rebuild it
with const.

Reviewers: dblaikie

Subscribers: llvm-commits

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

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

8 years ago[LV] Consider users that are memory accesses in uniforms expansion step
Matthew Simpson [Tue, 7 Mar 2017 18:47:30 +0000 (18:47 +0000)]
[LV] Consider users that are memory accesses in uniforms expansion step

When expanding the set of uniform instructions beyond the seed instructions
(e.g., consecutive pointers), we mark a new instruction uniform if all its
loop-varying users are uniform. We should also allow users that are consecutive
or interleaved memory accesses. This fixes cases where we have an instruction
that is used as the pointer operand of a consecutive access but also used by a
non-memory instruction that later becomes uniform as part of the expansion.

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

8 years ago[X86] Add option to specify preferable loop alignment
Sanjoy Das [Tue, 7 Mar 2017 18:47:22 +0000 (18:47 +0000)]
[X86] Add option to specify preferable loop alignment

Summary:
Loop alignment can cause a significant change of
the perfromance for short loops.
To be able to evaluate the impact of loop alignment this change
introduces the new option x86-experimental-pref-loop-alignment.
The alignment will be 2^Value bytes, the default value is 4.

Patch by Serguei Katkov!

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: sanjoy, llvm-commits

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

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

8 years ago[globalisel] Change LLT constructor string into an LLT-based object that knows how...
Daniel Sanders [Tue, 7 Mar 2017 18:32:25 +0000 (18:32 +0000)]
[globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.

Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.

Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.

Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar

Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls

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

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

8 years agoFurther reduce testcase
Adrian Prantl [Tue, 7 Mar 2017 18:26:36 +0000 (18:26 +0000)]
Further reduce testcase

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

8 years agoFix test and add missing return for llvm-lto2 error case
Teresa Johnson [Tue, 7 Mar 2017 18:15:13 +0000 (18:15 +0000)]
Fix test and add missing return for llvm-lto2 error case

Summary:
This test was missing the target triple.
Once I fixed that, the case with the invalid character error stopped
returning 1 from llvm-lto2 and the test reported a failure. Fixed by
adding the missing return from llvm-lto2. Apparently we were failing
when we eventually tried to get the target.

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

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

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

8 years ago[GlobalISel] Translate floating-point negation
Volkan Keles [Tue, 7 Mar 2017 18:03:28 +0000 (18:03 +0000)]
[GlobalISel] Translate floating-point negation

Reviewers: qcolombet, javed.absar, aditya_nandakumar, dsanders, t.p.northover, ab

Reviewed By: qcolombet

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

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

8 years agoUpdate comment in testcase
Adrian Prantl [Tue, 7 Mar 2017 17:55:36 +0000 (17:55 +0000)]
Update comment in testcase

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

8 years agoRephrase condition for better readability. NFC
Adrian Prantl [Tue, 7 Mar 2017 17:50:51 +0000 (17:50 +0000)]
Rephrase condition for better readability. NFC

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

8 years ago[fs] Make sure to check S_ISLNK() in fillStatus.
Zachary Turner [Tue, 7 Mar 2017 17:48:47 +0000 (17:48 +0000)]
[fs] Make sure to check S_ISLNK() in fillStatus.

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

8 years agorevert r297155 because there's a clang test that depends on InstCombine:
Sanjay Patel [Tue, 7 Mar 2017 17:41:45 +0000 (17:41 +0000)]
revert r297155 because there's a clang test that depends on InstCombine:

tools/clang/test/CodeGen/zvector.c

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

8 years agoRevert "Strip debug info when inlining into a nodebug function."
Adrian Prantl [Tue, 7 Mar 2017 17:28:57 +0000 (17:28 +0000)]
Revert "Strip debug info when inlining into a nodebug function."

This reverts commit r296488.

As noted by David Blaikie on llvm-commits, I overlooked the case of a
debug function being inlined into a nodebug function being inlined
into a debug function.

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

8 years agoRelax the conflicting function arg verifier to allow for inlined debug
Adrian Prantl [Tue, 7 Mar 2017 17:28:54 +0000 (17:28 +0000)]
Relax the conflicting function arg verifier to allow for inlined debug
info in nodebug functions.

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

8 years agoVerfier: Move the reset of DebugFnArgs closer to other similar operations.
Adrian Prantl [Tue, 7 Mar 2017 17:28:49 +0000 (17:28 +0000)]
Verfier: Move the reset of DebugFnArgs closer to other similar operations.
NFC

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

8 years agoRevert r297132, it caused PR32171
Nico Weber [Tue, 7 Mar 2017 17:23:52 +0000 (17:23 +0000)]
Revert r297132, it caused PR32171

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

8 years ago[InstCombine] shrink truncated splat shuffle
Sanjay Patel [Tue, 7 Mar 2017 16:10:36 +0000 (16:10 +0000)]
[InstCombine] shrink truncated splat shuffle

This is one part of solving a recent bug report:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110293.html

This keeps with our general approach: changing arbitrary shuffles is off-limts,
but changing splat is ok. The transform is very similar to the existing
shrinkBitwiseLogic() canonicalization.

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

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

8 years ago[Support] Add the option to not follow symlinks on stat.
Zachary Turner [Tue, 7 Mar 2017 16:10:10 +0000 (16:10 +0000)]
[Support] Add the option to not follow symlinks on stat.

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

8 years ago[ARM] Correct handling of LSL #0 in an IT block
John Brawn [Tue, 7 Mar 2017 14:42:03 +0000 (14:42 +0000)]
[ARM] Correct handling of LSL #0 in an IT block

The check for LSL #0 in an IT block was checking if operand 4 was zero, but
operand 4 is the condition code operand so it was actually checking for LSLEQ.
Fix this by checking operand 3, which really is the immediate operand, and add
some tests.

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

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

8 years ago[Hexagon] Do not insert instructions before PHI nodes
Krzysztof Parzyszek [Tue, 7 Mar 2017 14:20:19 +0000 (14:20 +0000)]
[Hexagon] Do not insert instructions before PHI nodes

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

8 years ago[ARM] Reapply r296865 "[ARM] fpscr read/write intrinsics not aware of each other""
Ranjeet Singh [Tue, 7 Mar 2017 11:17:53 +0000 (11:17 +0000)]
[ARM] Reapply r296865 "[ARM] fpscr read/write intrinsics not aware of each other""

The original patch r296865 was reverted as it broke the chromium builds for
Android https://bugs.llvm.org/show_bug.cgi?id=32134, this patch reapplies
r296865 with a fix to make sure it doesn't cause the build regression.

The problem was that intrinsic selection on int_arm_get_fpscr was failing in
ISel this was because the code to manually select this intrinsic still thought
it was the version with no side-effects (INTRINSIC_WO_CHAIN) which is wrong as
it doesn't semantically match the definition in the tablegen code which says it
does have side-effects, I've fixed this by updating the intrinsic type to
INTRINSIC_W_CHAIN (has side-effects). I've also added a test for this based on
Hans original reproducer.

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

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

8 years ago[SystemZ] Add check VT.isSimple() in canTreateAsByteVector()
Jonas Paulsson [Tue, 7 Mar 2017 09:49:31 +0000 (09:49 +0000)]
[SystemZ] Add check VT.isSimple() in canTreateAsByteVector()

Since BB-vectorizer can produce vectors of for example 3 elements,
this check is needed.

Review: Ulrich Weigand

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

8 years agoIn Thumb1, materialize a move between low registers as a `movs`, if CPSR isn't live.
Artyom Skrobov [Tue, 7 Mar 2017 09:38:16 +0000 (09:38 +0000)]
In Thumb1, materialize a move between low registers as a `movs`, if CPSR isn't live.

Summary: Previously, it had always been materialized as a push/pop sequence.

Reviewers: labrinea, jroelofs

Reviewed By: jroelofs

Subscribers: llvm-commits, rengolin

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

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

8 years ago[LoopRotate] Update dbg.value intrinsics
Sam Parker [Tue, 7 Mar 2017 09:34:25 +0000 (09:34 +0000)]
[LoopRotate] Update dbg.value intrinsics

Propagate debug info through the newly inserted PHI nodes.

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

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

8 years ago[X86] Quick fix for build bot failure (r297127) due to unused variable.
Ayman Musa [Tue, 7 Mar 2017 08:56:27 +0000 (08:56 +0000)]
[X86] Quick fix for build bot failure (r297127) due to unused variable.

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

8 years ago[X86][AVX512] Adding new LLVM TableGen backend which generates the EVEX2VEX compressi...
Ayman Musa [Tue, 7 Mar 2017 08:11:19 +0000 (08:11 +0000)]
[X86][AVX512] Adding new LLVM TableGen backend which generates the EVEX2VEX compressing tables.

X86EvexToVex machine instruction pass compresses EVEX encoded instructions by replacing them with their identical VEX encoded instructions when possible.
It uses manually supported 2 large tables that map the EVEX instructions to their VEX ideticals.
This TableGen backend replaces the tables by automatically generating them.

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

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

8 years ago[X86][AVX512] Add missing entries to EVEX2VEX tables
Ayman Musa [Tue, 7 Mar 2017 08:05:53 +0000 (08:05 +0000)]
[X86][AVX512] Add missing entries to EVEX2VEX tables

evex2vex pass defines 2 tables which maps EVEX instructions to their VEX identical when possible. Adding all missing entries.

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

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

8 years agoRevert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack frame...
Tim Shen [Tue, 7 Mar 2017 07:40:10 +0000 (07:40 +0000)]
Revert "[PowerPC][ELFv2ABI] Allocate parameter area on-demand to reduce stack frame size"

This reverts commit r296771.

We found some wide spread test failures internally. I'm working on a
testcase. Politely revert the patch in the mean time. :)

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

8 years ago[LoopUnrolling] Fix loop size check for peeling
Sanjoy Das [Tue, 7 Mar 2017 06:03:15 +0000 (06:03 +0000)]
[LoopUnrolling] Fix loop size check for peeling

Summary:
We should check if loop size allows us to peel at least one iteration
before we do so.

Patch by Max Kazantsev!

Reviewers: sanjoy, mkuper, efriedma

Reviewed By: mkuper

Subscribers: llvm-commits

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

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

8 years ago[APInt] Add rvalue reference support to and, or, xor operations to allow their memory...
Craig Topper [Tue, 7 Mar 2017 05:36:19 +0000 (05:36 +0000)]
[APInt] Add rvalue reference support to and, or, xor operations to allow their memory allocation to be reused when possible

This extends an earlier change that did similar for add and sub operations.

With this first patch we lose the fastpath for the single word case as operator&= and friends don't support it. This can be added there if we think that's important.

I had to change some functions in the APInt class since the operator overloads were moved out of the class and can't be used inside the class now. The getBitsSet change collides with another outstanding patch to implement it with setBits. But I didn't want to make this patch dependent on that series.

I've also removed the Or, And, Xor functions which were rarely or never used. I already commited two changes to remove the only uses of Or that existed.

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

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

8 years agoRevert "AMDGPU: Set MCAsmInfo::PointerSize"
Konstantin Zhuravlyov [Tue, 7 Mar 2017 04:44:33 +0000 (04:44 +0000)]
Revert "AMDGPU: Set MCAsmInfo::PointerSize"

It breaks line tables because the patch is not complete, working on a complete one at the moment

This reverts commit r294031.

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

8 years agoUse LLVM for all stat-related functionality.
Zachary Turner [Tue, 7 Mar 2017 03:43:17 +0000 (03:43 +0000)]
Use LLVM for all stat-related functionality.

This deletes LLDB's FileType enumeration and replaces all
users, and all calls to functions that check whether a file
exists etc with corresponding calls to LLVM.

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

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

8 years ago[APInt] Fix test names in unittest to match functions being tested. NFC
Craig Topper [Tue, 7 Mar 2017 03:16:37 +0000 (03:16 +0000)]
[APInt] Fix test names in unittest to match functions being tested. NFC

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

8 years ago[APInt] Add getBitsSetFrom and setBitsFrom to set upper bits starting at a bit
Craig Topper [Tue, 7 Mar 2017 02:58:36 +0000 (02:58 +0000)]
[APInt] Add getBitsSetFrom and setBitsFrom to set upper bits starting at a bit

We currently have methods to set a specified number of low bits, a specified number of high bits, or a range of bits. But looking at some existing code it seems sometimes we want to set the high bits starting from a certain bit. Currently we do this with something like getHighBits(BitWidth, BitWidth - StartBit). Or once we start switching to setHighBits, setHighBits(BitWidth - StartBit) or setHighBits(getBitWidth() - StartBit).

Particularly for the latter case it would be better to have a convenience method like setBitsFrom(StartBit) so we don't need to mention the bit width that's already known to the APInt object.

I considered just making setBits have a default value of UINT_MAX for the hiBit argument and we would internally MIN it with the bit width. So if it wasn't specified it would be treated as bit width. This would require removing the assertion we currently have on the value of hiBit and may not be as readable.

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

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

8 years agoAdd a testcase for r297072.
Adrian Prantl [Tue, 7 Mar 2017 02:49:57 +0000 (02:49 +0000)]
Add a testcase for r297072.

Check that missing debug locations on inlinable calls are a
recoverable error.

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

8 years ago[APInt] Implement getLowBitsSet/getHighBitsSet/getBitsSet using setLowBits/setHighBit...
Craig Topper [Tue, 7 Mar 2017 02:19:45 +0000 (02:19 +0000)]
[APInt] Implement getLowBitsSet/getHighBitsSet/getBitsSet using setLowBits/setHighBits/setBits

This patch implements getLowBitsSet/getHighBitsSet/getBitsSet in terms of the new setLowBits/setHighBits/setBits methods by making an all 0s APInt and then calling the appropriate set method.

This also adds support to setBits to allow loBits/hiBits to be in the other order to match with getBitsSet behavior.

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

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

8 years ago[APInt] Add setLowBits/setHighBits methods to APInt.
Craig Topper [Tue, 7 Mar 2017 01:56:01 +0000 (01:56 +0000)]
[APInt] Add setLowBits/setHighBits methods to APInt.

Summary:
There are quite a few places in the code base that do something like the following to set the high or low bits in an APInt.

KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);

For BitWidths larger than 64 this creates a short lived APInt with malloced storage. I think it might even call malloc twice. Its better to just provide methods that can set the necessary bits without the temporary APInt.

I'll update usages that benefit in a separate patch.

Reviewers: majnemer, MatzeB, davide, RKSimon, hans

Reviewed By: hans

Subscribers: llvm-commits

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

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

8 years agoUn-XFAIL Fuzzer/test/dump_coverage.test. This now passes on Darwin (after r297094).
Kuba Mracek [Tue, 7 Mar 2017 01:01:38 +0000 (01:01 +0000)]
Un-XFAIL Fuzzer/test/dump_coverage.test.  This now passes on Darwin (after r297094).

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

8 years agoremove Cmake option for LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
Bob Wilson [Tue, 7 Mar 2017 00:51:07 +0000 (00:51 +0000)]
remove Cmake option for LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING

This is a follow-up to my change in r295090, which added support for
disabling these checks selectively based on setting the preprocessor
macro without relying on the Cmake setting. Swift has moved over to use
that approach, so we can clean up here and remove the Cmake setting.

https://reviews.llvm.org/D30578

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

8 years ago[SLP] Revert r296863 due to miscompiles.
Michael Kuperstein [Mon, 6 Mar 2017 23:54:51 +0000 (23:54 +0000)]
[SLP] Revert r296863 due to miscompiles.

Details and reproducer are on the email thread for r296863.

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

8 years agoGlobalISel: restrict G_EXTRACT instruction to just one operand.
Tim Northover [Mon, 6 Mar 2017 23:50:28 +0000 (23:50 +0000)]
GlobalISel: restrict G_EXTRACT instruction to just one operand.

A bit more painful than G_INSERT because it was more widely used, but this
should simplify the handling of extract operations in most locations.

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

8 years ago[libfuzzer] do not use xargs for shell expansion
Mike Aizatsky [Mon, 6 Mar 2017 23:42:14 +0000 (23:42 +0000)]
[libfuzzer] do not use xargs for shell expansion

Summary:
After https://reviews.llvm.org/rL296904 xargs shouldn't be necesssary.

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

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

8 years ago[InstCombine] use dyn_cast instead of isa+cast; NFCI
Sanjay Patel [Mon, 6 Mar 2017 23:25:28 +0000 (23:25 +0000)]
[InstCombine] use dyn_cast instead of isa+cast; NFCI

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

8 years ago[ObjectYAML] Support for DW_FORM_implicit_const DWARF5 form
Chris Bieneman [Mon, 6 Mar 2017 23:22:49 +0000 (23:22 +0000)]
[ObjectYAML] Support for DW_FORM_implicit_const DWARF5 form

This patch adds support to the DWARF YAML reader and writer for the new DWARF5 abbreviation form, DW_FORM_implicit_const.

The attribute was added in r291599.

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

8 years ago[GlobalISel] Fix G_FPEXT’s description. NFC.
Volkan Keles [Mon, 6 Mar 2017 22:47:19 +0000 (22:47 +0000)]
[GlobalISel] Fix G_FPEXT’s description. NFC.

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

8 years ago[DAG] refactor related div/rem folds; NFCI
Sanjay Patel [Mon, 6 Mar 2017 22:32:40 +0000 (22:32 +0000)]
[DAG] refactor related div/rem folds; NFCI

This is known incomplete and not called in the right order relative to
other folds, but that's the current behavior. I'm just trying to clean
this up before making actual functional changes to make the patch smaller.

The logic here should mimic the IR equivalents that are in InstSimplify's
simplifyDivRem().

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

8 years ago[DWARFv5] Update definitions to match published spec.
Paul Robinson [Mon, 6 Mar 2017 22:20:03 +0000 (22:20 +0000)]
[DWARFv5] Update definitions to match published spec.

Some late additions to DWARF v5 were not in Dwarf.def; also one form
was redefined.  Add the new cases to relevant switches in different
parts of LLVM.  Replace DW_FORM_ref_sup with DW_FORM_ref_sup[4,8].

I did not add support for DW_FORM_strx3/addrx3 other that defining the
constants. We don't have any infrastructure to support these.

Differential Revision: http://reviews.llvm.org/D30664

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

8 years ago[Outliner] Fixed Asan bot failure in r296418
Jessica Paquette [Mon, 6 Mar 2017 21:31:18 +0000 (21:31 +0000)]
[Outliner] Fixed Asan bot failure in r296418

Fixed the asan bot failure which led to the last commit of the outliner being reverted.
The change is in lib/CodeGen/MachineOutliner.cpp in the SuffixTree's constructor. LeafVector
is no longer initialized using reserve but just a standard constructor.

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

8 years ago[TableGen] Ensure proper ordering of subtarget feature names
Krzysztof Parzyszek [Mon, 6 Mar 2017 21:26:49 +0000 (21:26 +0000)]
[TableGen] Ensure proper ordering of subtarget feature names

Recommit r297039 without the testcase. The MIR testcase did not work
well with MC code emitter.

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

8 years ago[AArch64][Redundant Copy Elim] Add support for CMN and shifted imm.
Chad Rosier [Mon, 6 Mar 2017 21:20:00 +0000 (21:20 +0000)]
[AArch64][Redundant Copy Elim] Add support for CMN and shifted imm.

This patch extends the current functionality of the AArch64 redundant copy
elimination pass to handle CMN instructions as well as a shifted
immediates.

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

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

8 years agoDisable gvn-hoist (PR32153)
Hans Wennborg [Mon, 6 Mar 2017 21:10:40 +0000 (21:10 +0000)]
Disable gvn-hoist (PR32153)

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

8 years agoVerifier: Change Assert to AssertDI.
Adrian Prantl [Mon, 6 Mar 2017 21:05:14 +0000 (21:05 +0000)]
Verifier: Change Assert to AssertDI.
This error can be recovered from by stripping debug info.
This is NFC for +asserts builds.

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

8 years ago[ObjectYAML] NFC. Refactor DWARFYAML CompileUnit dump code
Chris Bieneman [Mon, 6 Mar 2017 20:52:12 +0000 (20:52 +0000)]
[ObjectYAML] NFC. Refactor DWARFYAML CompileUnit dump code

Summary: This patch refactors the DWARFYAML code for dumping compile units to use a visitor pattern. Using this design will, in the future, enable the DWARF YAML code to perform analysis and mutations of the DWARF DIEs. An example of such mutations would be calculating the length of a compile unit and updating the CU's Length field before writing the DIE. This support will make it easier to craft or modify DWARF tests by hand.

Reviewers: lhames

Subscribers: mgorny, fhahn, jgosnell, aprantl, llvm-commits

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

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

8 years agoTest commit. Added a blank line.
Jessica Paquette [Mon, 6 Mar 2017 20:45:33 +0000 (20:45 +0000)]
Test commit. Added a blank line.

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

8 years agoRevert r297039, it's causing some mysterious buildbot failures
Krzysztof Parzyszek [Mon, 6 Mar 2017 20:24:21 +0000 (20:24 +0000)]
Revert r297039, it's causing some mysterious buildbot failures

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

8 years agoAMDGPU/R600: Fix ALU clause markers use detection
Jan Vesely [Mon, 6 Mar 2017 20:10:05 +0000 (20:10 +0000)]
AMDGPU/R600: Fix ALU clause markers use detection

also exit early on kill instead of redefinition.

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

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

8 years agoNewGVN: We were not really failing this testcase, because the instructions it was...
Daniel Berlin [Mon, 6 Mar 2017 20:01:31 +0000 (20:01 +0000)]
NewGVN: We were not really failing this testcase, because the instructions it was looking for are unused. GVN value numbers unused instructions, NewGVN does not.  Fix the instructions to be used, so we eliminate the redundancies it's checking for, and un-XFAIL it

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

8 years ago[DWARF] NFC. A few bits of minor code cleanup.
Chris Bieneman [Mon, 6 Mar 2017 19:25:07 +0000 (19:25 +0000)]
[DWARF] NFC. A few bits of minor code cleanup.

David Blaikie pointed out that the `setForceChildren` API is no longer needed and should be removed from the DWARF Generator APIs.

Also the DWARFDebugInfoTest file had some copy pasted comments that are not relevant. I've removed them.

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

8 years ago[opt-diff] Fix the case when the script is invoked with directories
Adam Nemet [Mon, 6 Mar 2017 19:15:22 +0000 (19:15 +0000)]
[opt-diff] Fix the case when the script is invoked with directories

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