OSDN Git Service

android-x86/external-llvm.git
7 years agoAMDGPU/SI: Handle hazard with > 8 byte VMEM stores
Tom Stellard [Thu, 27 Oct 2016 23:05:31 +0000 (23:05 +0000)]
AMDGPU/SI: Handle hazard with > 8 byte VMEM stores

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

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

7 years agoReapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." with
Tim Shen [Thu, 27 Oct 2016 22:52:40 +0000 (22:52 +0000)]
Reapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." with
a workaround for old clang.

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

7 years agoUpdate .debug_line section version information to match DWARF version.
Ekaterina Romanova [Thu, 27 Oct 2016 22:37:25 +0000 (22:37 +0000)]
Update .debug_line section version information to match DWARF version.

In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler.

This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted.

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

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

7 years agoRevert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."
Tim Shen [Thu, 27 Oct 2016 21:54:29 +0000 (21:54 +0000)]
Revert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."

This reverts r285351, since it breaks the build.

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

7 years ago[libFuzzer] enable use_cmp by default
Kostya Serebryany [Thu, 27 Oct 2016 21:44:37 +0000 (21:44 +0000)]
[libFuzzer] enable use_cmp by default

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

7 years ago[APFloat] Add DoubleAPFloat mode to APFloat. NFC.
Tim Shen [Thu, 27 Oct 2016 21:39:51 +0000 (21:39 +0000)]
[APFloat] Add DoubleAPFloat mode to APFloat. NFC.

Summary:
This patch adds DoubleAPFloat mode to APFloat.

Now, an APFloat with semantics PPCDoubleDouble will have DoubleAPFloat layout
(APFloat.U.Double), which contains two underlying APFloats as
PPCDoubleDoubleImpl and IEEEdouble semantics. Currently the IEEEdouble APFloat
is not used, and the first APFloat behaves exactly the same before this change.

This patch consists of three kinds of logics:
1) Construction and destruction of APFloat. Now the ctors, dtor, assign
   opertors and factory functions construct different underlying layout
   based on the semantics passed in.
2) s/IEEE/getIEEE()/ for normal, lifetime-unrelated computation functions.
   These functions only access Floats[0] in DoubleAPFloat, which is the
   same as today's semantic.
3) A "Double dispatch" function, APFloat::convert. Converting between two
   different layouts requires appropriate logic.

Neither of these change the external behavior.

Reviewers: hfinkel, kbarton, echristo, iteratee

Subscribers: mehdi_amini, llvm-commits

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

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

7 years agoBitcodeReader: Require clients to read the block info block at most once.
Peter Collingbourne [Thu, 27 Oct 2016 21:39:28 +0000 (21:39 +0000)]
BitcodeReader: Require clients to read the block info block at most once.

This change makes it the client's responsibility to call ReadBlockInfoBlock()
at most once. This is in preparation for a future change that will allow
there to be multiple block info blocks.

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106512.html

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

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

7 years agoCodeGen: Handle missed case of block removal during BlockPlacement.
Kyle Butt [Thu, 27 Oct 2016 21:37:20 +0000 (21:37 +0000)]
CodeGen: Handle missed case of block removal during BlockPlacement.

There is a use after free bug in the existing code. Loop layout selects
a preferred exit block, and then lays out the loop. If this block is
removed during layout, it needs to be invalidated to prevent a use after
free.

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

7 years ago[InstCombine] fix foldSPFofSPF() to handle vector splats
Sanjay Patel [Thu, 27 Oct 2016 21:19:40 +0000 (21:19 +0000)]
[InstCombine] fix foldSPFofSPF() to handle vector splats

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

7 years ago[libFuzzer] docs: update the examples
Kostya Serebryany [Thu, 27 Oct 2016 21:03:48 +0000 (21:03 +0000)]
[libFuzzer] docs: update the examples

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

7 years agoAnother additional error check for invalid Mach-O files for the
Kevin Enderby [Thu, 27 Oct 2016 20:59:10 +0000 (20:59 +0000)]
Another additional error check for invalid Mach-O files for the
obsolete load commands.

Again the philosophy of the error checking in libObject for
Mach-O files, the idea behind the checking is that we never
will return a Mach-O file out of libObject that contains unknown
things the library code can’t operate on.  So known obsolete
load commands will cause a hard error.

Also to make things clear I have added comments to the
values and structures in Support/Mach-O.h and
Support/MachO.def as to what is obsolete.

As noted in a TODO in the code, there may need to be a
non-default mode to allow some unknown values for well
structured Mach-O files with things like unknown load
load commands.  So things like using an old lldb on a newer
Mach-O file could still provide some limited functionality.

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

7 years ago[InstCombine] add vector tests for foldSPFofSPF to show missing folds
Sanjay Patel [Thu, 27 Oct 2016 20:51:03 +0000 (20:51 +0000)]
[InstCombine] add vector tests for foldSPFofSPF to show missing folds

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

7 years ago[libFuzzer] docs: separate section for fuzz target
Kostya Serebryany [Thu, 27 Oct 2016 20:45:35 +0000 (20:45 +0000)]
[libFuzzer] docs: separate section for fuzz target

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

7 years agoAMDGPU/SI: Handle s_setreg hazard in GCNHazardRecognizer
Tom Stellard [Thu, 27 Oct 2016 20:39:09 +0000 (20:39 +0000)]
AMDGPU/SI: Handle s_setreg hazard in GCNHazardRecognizer

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

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

7 years ago[libFuzzer] remove large examples from the libFuzzer docs and link to the libFuzzer...
Kostya Serebryany [Thu, 27 Oct 2016 20:14:03 +0000 (20:14 +0000)]
[libFuzzer] remove large examples from the libFuzzer docs and link to the libFuzzer tutorial instead; also fix a build error in another file

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

7 years ago[InstCombine] auto-generate checks for min/max tests
Sanjay Patel [Thu, 27 Oct 2016 19:54:15 +0000 (19:54 +0000)]
[InstCombine] auto-generate checks for min/max tests

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

7 years ago[PPC] Adding the removed testcase again
Ehsan Amiri [Thu, 27 Oct 2016 19:10:09 +0000 (19:10 +0000)]
[PPC] Adding the removed testcase again

This testcase was originally part of r284995, but I put it in a wrong directory.
So I removed it. Before adding it back I did some small enhancements. Also I
changed the assertions a little bit, to take into account the impact of some
changes performed since code review is done.

This is similar to changes done for another testcase in the original commit.
See: https://reviews.llvm.org/D23614#577749
Basically for instead of vxor we now generate xxlxor in some cases, which is
better.

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

7 years ago[LoopUnroll] Check partial unrolling is enabled before initialization. NFC.
Haicheng Wu [Thu, 27 Oct 2016 18:40:02 +0000 (18:40 +0000)]
[LoopUnroll] Check partial unrolling is enabled before initialization. NFC.

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

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

7 years ago[X86][AVX512] Fix MUL v8i64 costs on non-AVX512DQ targets
Simon Pilgrim [Thu, 27 Oct 2016 18:32:06 +0000 (18:32 +0000)]
[X86][AVX512] Fix MUL v8i64 costs on non-AVX512DQ targets

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

7 years ago[InstCombine] handle simple vector integer constants in IsFreeToInvert
Sanjay Patel [Thu, 27 Oct 2016 17:30:50 +0000 (17:30 +0000)]
[InstCombine] handle simple vector integer constants in IsFreeToInvert

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

7 years ago[X86][AVX512DQ] Move v2i64 and v4i64 MUL lowering to tablegen
Simon Pilgrim [Thu, 27 Oct 2016 17:07:40 +0000 (17:07 +0000)]
[X86][AVX512DQ] Move v2i64 and v4i64 MUL lowering to tablegen

As suggested by @igorb on D26011

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

7 years agoARM: ensure that the Windows DBZ check is in range
Saleem Abdulrasool [Thu, 27 Oct 2016 16:59:22 +0000 (16:59 +0000)]
ARM: ensure that the Windows DBZ check is in range

The Windows ARM target expects the compiler to emit a division-by-zero check.
The check would use the form of:

    cmp r?, #0
    cbz .Ltrap
    b .Lbody
  .Lbody:
    ...
  .Ltrap:
    udf #249 @ __brkdiv0

This works great most of the time.  However, if the body of the function is
greater than 127 bytes, the branch target limitation of cbz becomes an issue.
This occurs in the unoptimized code generation cases sometimes (like in
compiler-rt).

Since this is a matter of correctness, possibly pay a small penalty instead.  We
now form this slightly differently:

    cbnz .Lbody
    udf #249 @ __brkdiv0
  .Lbody:
    ...

The positive case is through the branch instead of being the next instruction.
However, because of the basic block layout, the negated branch is going to be
a short distance always (2 bytes away, after the inserted __brkdiv0).

The new t__brkdiv0 instruction is required to explicitly mark the instruction as
a terminator as the generic UDF instruction is not a terminator.

Addresses PR30532!

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

7 years agoSwitch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf...
Greg Clayton [Thu, 27 Oct 2016 16:32:04 +0000 (16:32 +0000)]
Switch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf enumerations instead of using raw uint16_t values. This allows easier debugging as users can see the values of the enumerations in the variables view that will show the enumeration string instead of just a number.

https://reviews.llvm.org/D26013

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

7 years agoAdd Loop Sink pass to reverse the LICM based of basic block frequency.
Dehao Chen [Thu, 27 Oct 2016 16:30:08 +0000 (16:30 +0000)]
Add Loop Sink pass to reverse the LICM based of basic block frequency.

Summary: LICM may hoist instructions to preheader speculatively. Before code generation, we need to sink down the hoisted instructions inside to loop if it's beneficial. This pass is a reverse of LICM: looking at instructions in preheader and sinks the instruction to basic blocks inside the loop body if basic block frequency is smaller than the preheader frequency.

Reviewers: hfinkel, davidxl, chandlerc

Subscribers: anna, modocache, mgorny, beanz, reames, dberlin, chandlerc, mcrosier, junbuml, sanjoy, mzolotukhin, llvm-commits

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

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

7 years ago[mips] Do not allow -opt-bisect-limit to skip the PIC call optimization pass.
Vasileios Kalintiris [Thu, 27 Oct 2016 15:50:36 +0000 (15:50 +0000)]
[mips] Do not allow -opt-bisect-limit to skip the PIC call optimization pass.

r282428 added the MipsOptimizePICCall as an opt-in pass that can be
skipped when using the -opt-bisect-limit option. However, this pass is
needed because it generates code that conforms to the o32 ABI
specification by using the $t9 register for PIC calls with JALR
instructions.

This bug was exposed by the fact that skipFunction() also checks for
the "optnone" attribute. This caused functions with that attribute to
break the requirements of the o32 ABI.

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

7 years ago[X86][AVX512DQ] Improve lowering of MUL v2i64 and v4i64
Simon Pilgrim [Thu, 27 Oct 2016 15:27:00 +0000 (15:27 +0000)]
[X86][AVX512DQ] Improve lowering of MUL v2i64 and v4i64

With DQI but without VLX, lower v2i64 and v4i64 MUL operations with v8i64 MUL (vpmullq).

Updated cost table accordingly.

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

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

7 years ago[ValueTracking] fix matchSelectPattern to allow vector splat folds of min/max/abs...
Sanjay Patel [Thu, 27 Oct 2016 15:26:10 +0000 (15:26 +0000)]
[ValueTracking] fix matchSelectPattern to allow vector splat folds of min/max/abs/nabs

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

7 years agoRemove duplicated default move ctors/move assign. No functional change.
Benjamin Kramer [Thu, 27 Oct 2016 15:23:44 +0000 (15:23 +0000)]
Remove duplicated default move ctors/move assign. No functional change.

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

7 years ago[InstCombine] add tests for missing folds of vector abs/nabs/min/max
Sanjay Patel [Thu, 27 Oct 2016 15:02:45 +0000 (15:02 +0000)]
[InstCombine] add tests for missing folds of vector abs/nabs/min/max

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

7 years agoFix memory issue in AttrBuilder::removeAttribute uses.
Bjorn Pettersson [Thu, 27 Oct 2016 14:48:09 +0000 (14:48 +0000)]
Fix memory issue in AttrBuilder::removeAttribute uses.

Summary:
Found when running Valgrind.

This removes two unnecessary assignments when using
AttrBuilder::removeAttribute.

AttrBuilder::removeAttribute returns a reference to the object.
As the LHSes were the same as the callees, the assignments
resulted in memcpy calls where dst = src.

Commited on behalf-of: dstenb (David Stenberg)

Reviewers: mkuper, rnk

Subscribers: llvm-commits

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

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

7 years ago[Hexagon] Do not expand ISD::SELECT for HVX vectors
Krzysztof Parzyszek [Thu, 27 Oct 2016 14:30:16 +0000 (14:30 +0000)]
[Hexagon] Do not expand ISD::SELECT for HVX vectors

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

7 years ago[DAGCombiner] Add vector demanded elements support to computeKnownBits
Simon Pilgrim [Thu, 27 Oct 2016 14:29:28 +0000 (14:29 +0000)]
[DAGCombiner] Add vector demanded elements support to computeKnownBits

Currently computeKnownBits returns the common known zero/one bits for all elements of vector data, when we may only be interested in one/some of the elements.

This patch adds a DemandedElts argument that allows us to specify the elements we actually care about. The original computeKnownBits implementation calls with a DemandedElts demanding all elements to match current behaviour. Scalar types set this to 1.

The approach was found to be easier than trying to add a per-element known bits solution, for a similar usefulness given the combines where computeKnownBits is typically used.

I've only added support for a few opcodes so far (the ones that have proven straightforward to test), all others will default to demanding all elements but can be updated in due course.

DemandedElts support could similarly be added to computeKnownBitsForTargetNode in a future commit.

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

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

7 years ago[InstCombine] auto-generate better checks; NFC
Sanjay Patel [Thu, 27 Oct 2016 13:55:37 +0000 (13:55 +0000)]
[InstCombine] auto-generate better checks; NFC

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

7 years agoRevert r285285 "[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is...
George Rimar [Thu, 27 Oct 2016 12:18:50 +0000 (12:18 +0000)]
Revert r285285 "[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large."
It broke BB.

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

7 years ago[SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.
Alexey Bataev [Thu, 27 Oct 2016 12:02:28 +0000 (12:02 +0000)]
[SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.

After successfull horizontal reduction vectorization attempt for PHI node
vectorizer tries to update root binary op by combining vectorized tree
and the ReductionPHI node. But during vectorization this ReductionPHI
can be vectorized itself and replaced by the `undef` value, while the
instruction itself is marked for deletion. This 'marked for deletion'
PHI node then can be used in new binary operation, causing "Use still
stuck around after Def is destroyed" crash upon PHI node deletion.

Also the test is fixed to make it perform actual testing.

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

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

7 years ago[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.
George Rimar [Thu, 27 Oct 2016 11:50:04 +0000 (11:50 +0000)]
[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.

Elf.h already has code checking that section table does not go past end of file.
Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize
because of calculation overflow.

Parch fixes the issue.

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

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

7 years ago[Object/ELF] - Do not allow overflow when checking section size/offset.
George Rimar [Thu, 27 Oct 2016 11:44:56 +0000 (11:44 +0000)]
[Object/ELF] - Do not allow overflow when checking section size/offset.

Overflow was the reason of incorrect passing the check,
patch fixes the case.

Differentail revision: https://reviews.llvm.org/D25514

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

7 years ago[Object/ELF] - Do not crash if string table sh_size is equal to zero.
George Rimar [Thu, 27 Oct 2016 11:41:57 +0000 (11:41 +0000)]
[Object/ELF] - Do not crash if string table sh_size is equal to zero.

Revealed using "id_000038,sig_11,src_000015,op_havoc,rep_16" from PR30540,
when sh_size was 0, crash happened.

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

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

7 years ago[ARM] Add newline char to test.
Sam Parker [Thu, 27 Oct 2016 10:43:02 +0000 (10:43 +0000)]
[ARM] Add newline char to test.

Missed a newline in the previous commit.

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

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

7 years ago[ARM] Predicate UMAAL selection on hasDSP.
Sam Parker [Thu, 27 Oct 2016 09:47:10 +0000 (09:47 +0000)]
[ARM] Predicate UMAAL selection on hasDSP.

UMAAL is a DSP instruction and it is not available on thumbv7m
(Cortex-M3) and thumbv6m (Cortex-M0+1) targets. Also fix wrong
CHECK prefix in longMAC.ll test.

Patch by Vadzim Dambrouski.

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

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

7 years ago[AVR] Generate all of the TableGen files we need
Dylan McKay [Thu, 27 Oct 2016 08:20:47 +0000 (08:20 +0000)]
[AVR] Generate all of the TableGen files we need

This enables generation of all of the TableGen files that are used
downstream.

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

7 years agoAMDGPU: Fix SILoadStoreOptimizer when writes cannot be merged due register dependencies
Nicolai Haehnle [Thu, 27 Oct 2016 08:15:07 +0000 (08:15 +0000)]
AMDGPU: Fix SILoadStoreOptimizer when writes cannot be merged due register dependencies

Summary:
When finding a match for a merge and collecting the instructions that must
be moved, keep in mind that the instruction we merge might actually use one
of the defs that are being moved.

Fixes piglit spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-load-output[-indirect].

The fact that the ds_read in the test case is not eliminated suggests that
there might be another problem related to alias analysis, but that's a
separate problem: this pass should still work correctly even when earlier
optimization passes missed something or were disabled.

Reviewers: tstellarAMD, arsenm

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

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

7 years ago[AVR] Compile the disassembler
Dylan McKay [Thu, 27 Oct 2016 08:09:15 +0000 (08:09 +0000)]
[AVR] Compile the disassembler

This also updates references of 'TheAVRTarget' to the new
'getTheAVRTarget()' method.

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

7 years ago[AVR] Add AVRISelDAGToDAG.cpp
Dylan McKay [Thu, 27 Oct 2016 07:03:47 +0000 (07:03 +0000)]
[AVR] Add AVRISelDAGToDAG.cpp

Summary: This pulls the AVR instruction selector in-tree.

Reviewers: arsenm, kparzysz

Subscribers: llvm-commits, wdng, beanz, japaric, mgorny

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

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

7 years ago[AVR] Add the machine code emitter
Dylan McKay [Thu, 27 Oct 2016 06:56:46 +0000 (06:56 +0000)]
[AVR] Add the machine code emitter

Reviewers: arsenm, kparzysz

Subscribers: wdng, beanz, japaric, llvm-commits, mgorny

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

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

7 years ago[PowerPC] - No SExt/ZExt needed for count trailing zeros
Nemanja Ivanovic [Thu, 27 Oct 2016 05:17:58 +0000 (05:17 +0000)]
[PowerPC] - No SExt/ZExt needed for count trailing zeros

This patch corresponds to review:
https://reviews.llvm.org/D25896

It just eliminates the redundant ZExt after a count trailing zeros instruction.

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

7 years ago[libFuzzer] speculatively trying to fix the Mac build; second attempt
Kostya Serebryany [Thu, 27 Oct 2016 00:36:38 +0000 (00:36 +0000)]
[libFuzzer] speculatively trying to fix the Mac build; second attempt

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

7 years agoxray-extract.cc: Quick fix for mingw, to avoid errc::protocol_error.
NAKAMURA Takumi [Thu, 27 Oct 2016 00:34:24 +0000 (00:34 +0000)]
xray-extract.cc: Quick fix for mingw, to avoid errc::protocol_error.

errc::protocol_error is winsock-oriented and mingw doesn't include it. (MS does, though)

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

7 years ago[libFuzzer] revert 285259 -- hit commit too soon
Kostya Serebryany [Thu, 27 Oct 2016 00:24:34 +0000 (00:24 +0000)]
[libFuzzer] revert 285259 -- hit commit too soon

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

7 years ago[libFuzzer] speculatively trying to fix the Mac build
Kostya Serebryany [Thu, 27 Oct 2016 00:22:39 +0000 (00:22 +0000)]
[libFuzzer] speculatively trying to fix the Mac build

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

7 years ago[IR] Retire unused getGEPReturnType overload. NFCI.
Davide Italiano [Wed, 26 Oct 2016 23:46:16 +0000 (23:46 +0000)]
[IR] Retire unused getGEPReturnType overload. NFCI.

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

7 years ago[APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regressio...
Tim Shen [Wed, 26 Oct 2016 23:31:41 +0000 (23:31 +0000)]
[APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regression introduced by r285105.

Reviewers: kbarton, echristo, iteratee, eugenis

Subscribers: llvm-commits, mehdi_amini

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

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

7 years agollvm-objdump: Make some error messages more consistent
Justin Bogner [Wed, 26 Oct 2016 22:37:52 +0000 (22:37 +0000)]
llvm-objdump: Make some error messages more consistent

Most of the version of report_error were quoting the filename and
printing a colon between the file name and the error message, but this
one wasn't doing either of those. Fix the output to be more
consistent.

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

7 years ago[utils] Add a '--unified-report' option to the code coverage prep script
Vedant Kumar [Wed, 26 Oct 2016 22:07:39 +0000 (22:07 +0000)]
[utils] Add a '--unified-report' option to the code coverage prep script

In --unified-report mode, a single coverage report is prepared for all
specified binaries and written to *report_dir*. This mode is compatible
with all existing script options, including the --restrict mode which is
used to limit coverage reporting to certain files or directories.

This should not break any existing users of the script.

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

7 years ago[utils] Use print_function in the code coverage prep script, NFC.
Vedant Kumar [Wed, 26 Oct 2016 22:07:37 +0000 (22:07 +0000)]
[utils] Use print_function in the code coverage prep script, NFC.

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

7 years ago[utils] Add an '--only-merge' option to the code coverage prep script
Vedant Kumar [Wed, 26 Oct 2016 22:07:35 +0000 (22:07 +0000)]
[utils] Add an '--only-merge' option to the code coverage prep script

In --only-merge mode, the script terminates after the profile merging
step.  This makes the script less stateful: it's more natural to split
the merge out into a separate step instead of relying on the first
invocation of the script to do it.

This should not break any existing users of the script.

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

7 years ago[AArch64] Create feature set for Samsung Exynos-M2
Evandro Menezes [Wed, 26 Oct 2016 22:06:20 +0000 (22:06 +0000)]
[AArch64] Create feature set for Samsung Exynos-M2

Since Exynos-M2 improved the FP square root unit a bit over the one in
Exynos-M1, it does not benefit from using the Newton series for such
operations.

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

7 years agoDebugInfo: fix incorrect alignment type (NFC)
Victor Leschuk [Wed, 26 Oct 2016 21:32:29 +0000 (21:32 +0000)]
DebugInfo: fix incorrect alignment type (NFC)

Change type of some missed DebugInfo-related alignment variables,
that are still uint64_t, to uint32_t.

Original change introduced in r284482.

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

7 years ago[lit] Work around Windows MSys command line tokenization bug
Reid Kleckner [Wed, 26 Oct 2016 20:29:27 +0000 (20:29 +0000)]
[lit] Work around Windows MSys command line tokenization bug

Summary:
This will allow us to revert LLD r284768, which added spaces to get MSys
echo to print what we want.

Reviewers: ruiu, inglorion, rafael

Subscribers: modocache, llvm-commits

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

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

7 years ago[PPC] Remove testcase from incorrect directory
Ehsan Amiri [Wed, 26 Oct 2016 20:16:59 +0000 (20:16 +0000)]
[PPC] Remove testcase from incorrect directory

During my last commit this testcase was put in an incorrect directory. Removing
it. Will put it in the right directory when I can verify everything is correct.

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

7 years agoARM: don't rely on push/pop reglists being in order when folding SP adjust.
Tim Northover [Wed, 26 Oct 2016 20:01:00 +0000 (20:01 +0000)]
ARM: don't rely on push/pop reglists being in order when folding SP adjust.

It would be a very nice invariant to rely on, but unfortunately it doesn't
necessarily hold (and the causes of mis-sorted reglists appear to be quite
varied) so to be robust the frame lowering code can't assume that the first
register in the list is also the first one that actually gets pushed.

Should fix an issue where we were turning something like:

    push {r8, r4, r7, lr}
    sub sp, #24

into nonsense like:

    push {r2, r3, r4, r5, r6, r7, r8, r4, r7, lr}

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

7 years agoDo not assume that FP vector operands are never legalized by expanding
Nemanja Ivanovic [Wed, 26 Oct 2016 19:51:35 +0000 (19:51 +0000)]
Do not assume that FP vector operands are never legalized by expanding

This patch ensures that if a floating point vector operand is legalized by
expanding, it is legalized through the stack rather than by calling
DAGTypeLegalizer::IntegerToVector which will cause a failure since the operand
is a non-integer type.

This fixes PR 30715.

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

7 years agoSimplify `x >=u x >> y` and `x >=u x udiv y`
Sanjoy Das [Wed, 26 Oct 2016 19:18:43 +0000 (19:18 +0000)]
Simplify `x >=u x >> y` and `x >=u x udiv y`

Summary:
Extends InstSimplify to handle both `x >=u x >> y` and `x >=u x udiv y`.

This is a folloup of rL258422 and
https://github.com/rust-lang/rust/pull/30917 where llvm failed to
optimize away the bounds checking in a binary search.

Patch by Arthur Silva!

Reviewers: sanjoy

Subscribers: llvm-commits

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

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

7 years agoRevert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affec...
Chad Rosier [Wed, 26 Oct 2016 19:18:19 +0000 (19:18 +0000)]
Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory."

This reverts commit r285191.

LICM appears to rely on the Alias Set Tracker hitting lifetime markers to prevent
code from being moved outside of the original scope.

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

7 years ago[PowerPC] Implement vec_insert_exp builtins - llvm portion
Nemanja Ivanovic [Wed, 26 Oct 2016 19:03:40 +0000 (19:03 +0000)]
[PowerPC] Implement vec_insert_exp builtins - llvm portion

This revision corresponds to review: https://reviews.llvm.org/D25957.
Committing on behalf of Zaara Syeda.

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

7 years ago[libFuzzer] simplify TracePC::HandleTrace even further. Also, when dealing with ...
Kostya Serebryany [Wed, 26 Oct 2016 18:52:04 +0000 (18:52 +0000)]
[libFuzzer] simplify TracePC::HandleTrace even further. Also, when dealing with -exit_on_src_pos, symbolize every PC only once

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

7 years agoFix test from r285217.
Chad Rosier [Wed, 26 Oct 2016 18:49:16 +0000 (18:49 +0000)]
Fix test from r285217.

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

7 years ago[AArch64] Avoid materializing constant 1 when generating cneg instructions.
Chad Rosier [Wed, 26 Oct 2016 18:15:32 +0000 (18:15 +0000)]
[AArch64] Avoid materializing constant 1 when generating cneg instructions.

Instead of

 cmp w0, #1
 orr w8, wzr, #0x1
 cneg w0, w8, ne

we now generate

 cmp w0, #1
 csinv w0, w0, wzr, eq

PR28965

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

7 years ago[WebAssembly] Update the README.txt.
Dan Gohman [Wed, 26 Oct 2016 17:44:09 +0000 (17:44 +0000)]
[WebAssembly] Update the README.txt.

Update the README.txt with newer information, add a link to the Emscripten
page explaining the current easiest way to use the LLVM wasm backend, and
mention that other ways of using the LLVM wasm backend are in development.

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

7 years ago[MC] Fix comma typo in .loc parsing
Nirav Dave [Wed, 26 Oct 2016 17:28:58 +0000 (17:28 +0000)]
[MC] Fix comma typo in .loc parsing

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

7 years agoReapply: "Remove debug location from common tail when tail-merging"
Robert Lougher [Wed, 26 Oct 2016 17:01:47 +0000 (17:01 +0000)]
Reapply: "Remove debug location from common tail when tail-merging"

This reapplies revision 285093.  Original commit message:

The branch folding pass tail merges blocks into a common-tail.  However, the
tail retains the debug information from one of the original inputs to the
merge (chosen randomly).  This is a problem for sampled-based PGO, as hits
on the common-tail will be attributed to whichever block was chosen,
irrespective of which path was actually taken to the common-tail.

This patch fixes the issue by nulling the debug location for the common-tail.

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

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

7 years agoAMDGPU: Refactor processor definition to use ISA version features
Yaxun Liu [Wed, 26 Oct 2016 16:37:56 +0000 (16:37 +0000)]
AMDGPU: Refactor processor definition to use ISA version features

Add missing ISA versions 7.0.2/8.0.4/8.1.0. to backend.

Refactor processor definition to use ISA version features.

Fixed ISA version for stoney.

Based on Laurent Morichetti's patch.

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

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

7 years agoIntroduce updateDiscriminator interface to DILocation to make it cleaner assigning...
Dehao Chen [Wed, 26 Oct 2016 15:48:45 +0000 (15:48 +0000)]
Introduce updateDiscriminator interface to DILocation to make it cleaner assigning discriminators.

Summary: This patch introduces updateDiscriminator to DILocation so that it can be directly called by AddDiscriminator. It also makes it easier to update the discriminator later.

Reviewers: dnovillo, dblaikie, aprantl, echristo

Subscribers: mehdi_amini, llvm-commits

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

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

7 years agoReapply "AMDGPU: Don't use offen if it is 0"
Matt Arsenault [Wed, 26 Oct 2016 15:08:16 +0000 (15:08 +0000)]
Reapply "AMDGPU: Don't use offen if it is 0"

This reverts r283003

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

7 years agoAMDGPU: Fix counting si_mask_branch as 4 bytes
Matt Arsenault [Wed, 26 Oct 2016 14:53:54 +0000 (14:53 +0000)]
AMDGPU: Fix counting si_mask_branch as 4 bytes

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

7 years agoFix nondeterministic output in local stack slot alloc pass
Matt Arsenault [Wed, 26 Oct 2016 14:53:50 +0000 (14:53 +0000)]
Fix nondeterministic output in local stack slot alloc pass

This finds all of the references to a frame index in a function, and
sorts by the offset. If multiple instructions use the same offset,
nothing was breaking the tie for sorting.

This avoids the test failures the reverted r282999 introduced.

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

7 years ago[InstCombine] clean up commonCastTransforms; NFC
Sanjay Patel [Wed, 26 Oct 2016 14:52:35 +0000 (14:52 +0000)]
[InstCombine] clean up commonCastTransforms; NFC

1. Use 'auto' with dyn_cast.
2. Variables start with a capital letter.
3. Use proper punctuation in comments.

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

7 years agoLegalizeDAG: Support promoting [US]DIV and [US]REM operations
Tom Stellard [Wed, 26 Oct 2016 14:52:25 +0000 (14:52 +0000)]
LegalizeDAG: Support promoting [US]DIV and [US]REM operations

Summary:
AMDGPU will need this one i16 is added as a legal type.  This is tested by:

test/CodeGen/AMDGPU/sdiv.ll
test/CodeGen/AMDGPU/sdivrem24.ll
test/CodeGen/AMDGPU/udiv.ll
test/CodeGen/AMDGPU/udivrem24.ll

Reviewers: bogner, efriedma

Subscribers: efriedma, wdng, llvm-commits

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

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

7 years agoAMDGPU/SI: Don't emit multi-dword flat memory ops when they might access scratch
Tom Stellard [Wed, 26 Oct 2016 14:38:47 +0000 (14:38 +0000)]
AMDGPU/SI: Don't emit multi-dword flat memory ops when they might access scratch

Summary:
A single flat memory operations that might access the scratch buffer
can only access MaxPrivateElementSize bytes.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

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

7 years agoAMDGPU/SI: Remove unnecessary run lines from test
Tom Stellard [Wed, 26 Oct 2016 14:21:09 +0000 (14:21 +0000)]
AMDGPU/SI: Remove unnecessary run lines from test

Summary:
This test had run lines disabling/enabling the promote alloca pass, but
enabling/disabling promote alloca had no impact on the output.

Reviewers: arsenm

Subscribers: mgrang, kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

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

7 years ago[X86] AVX512 fallback for floating-point scalar selects
Zvi Rackover [Wed, 26 Oct 2016 14:12:46 +0000 (14:12 +0000)]
[X86] AVX512 fallback for floating-point scalar selects

Summary:
In the case where of 'select i1 , f32, f32' or select i1, f64, f64 prefer lowering to masked-moves over branches.

Fixes pr30561

Reviewers: igorb, aymanmus, delena

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

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

7 years ago[InstCombine] consolidate zext tests and auto-generate checks; NFC
Sanjay Patel [Wed, 26 Oct 2016 14:08:49 +0000 (14:08 +0000)]
[InstCombine] consolidate zext tests and auto-generate checks; NFC

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

7 years ago[InstCombine] auto-generate better checks; NFC
Sanjay Patel [Wed, 26 Oct 2016 13:58:22 +0000 (13:58 +0000)]
[InstCombine] auto-generate better checks; NFC

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

7 years ago[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory.
Chad Rosier [Wed, 26 Oct 2016 12:42:11 +0000 (12:42 +0000)]
[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory.

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

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

7 years agoDebugInfo: support for DWARFv5 DW_AT_alignment attribute
Victor Leschuk [Wed, 26 Oct 2016 11:59:03 +0000 (11:59 +0000)]
DebugInfo: support for DWARFv5 DW_AT_alignment attribute

* Assume that clang passes non-zero alignment value to DIBuilder
only in case when it was forced by C++11 'alignas', C11 '_Alignas'
or compiler attribute '__attribute__((aligned (N)))'.

* Emit DW_AT_alignment if alignment is specified for type/object.

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

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

7 years ago[IndVarSimplify][DebugLoc] When widening the exit loop condition, correctly reuse...
Andrea Di Biagio [Wed, 26 Oct 2016 10:28:32 +0000 (10:28 +0000)]
[IndVarSimplify][DebugLoc] When widening the exit loop condition, correctly reuse the debug location of the original comparison.

When the loop exit condition is canonicalized as a != compaison, reuse the
debug location of the original (non canonical) comparison.

Before this patch, the debug location of the new icmp was obtained from the
loop latch terminator. This patch fixes the issue by correctly setting the
IRBuilder's "current debug location" to the location of the original compare.

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

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

7 years agoRevert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".
Vassil Vassilev [Wed, 26 Oct 2016 10:13:47 +0000 (10:13 +0000)]
Revert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".

The commit broke the builds.

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

7 years agoDebugInfo: support for DWARFv5 DW_AT_alignment attribute
Victor Leschuk [Wed, 26 Oct 2016 08:55:27 +0000 (08:55 +0000)]
DebugInfo: support for DWARFv5 DW_AT_alignment attribute

* Assume that clang passes non-zero alignment value to DIBuilder
only in case when it was forced by C++11 'alignas', C11 '_Alignas'
or compiler attribute '__attribute__((aligned (N)))'.

* Emit DW_AT_alignment if alignment is specified for type/object.

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

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

7 years agoDebugInfo: add bitcode upgrade test for alignment
Victor Leschuk [Wed, 26 Oct 2016 08:34:19 +0000 (08:34 +0000)]
DebugInfo: add bitcode upgrade test for alignment

Bitcode format was changed in D25073, this adds bitcode upgrade test.

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

7 years ago[XRay] Be case-insensitive for error strings
Dean Michael Berris [Wed, 26 Oct 2016 05:10:39 +0000 (05:10 +0000)]
[XRay] Be case-insensitive for error strings

On Windows, "no such file or directory" is the default error translation
as opposed to the capitalized form on Linux.

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

7 years ago[AVX-512] Add scalar vfmsub/vfnmsub mask3 intrinsics
Craig Topper [Wed, 26 Oct 2016 04:59:58 +0000 (04:59 +0000)]
[AVX-512] Add scalar vfmsub/vfnmsub mask3 intrinsics

Summary: Clang's intrinsic header currently tries to negate the third operand of a vfmadd mask3 in order to create vfmsub, but this fails isel. This patch adds scalar vfmsub and vfnmsub mask3 that we can use instead to avoid the negate. This is consistent with the packed instructions.

Reviewers: igorb, delena

Subscribers: llvm-commits

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

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

7 years ago[XRay] Remove unnecessary include of <unistd.h>
Dean Michael Berris [Wed, 26 Oct 2016 04:46:50 +0000 (04:46 +0000)]
[XRay] Remove unnecessary include of <unistd.h>

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

7 years ago[XRay] Remove unnecessary include of <unistd.h>
Dean Michael Berris [Wed, 26 Oct 2016 04:36:31 +0000 (04:36 +0000)]
[XRay] Remove unnecessary include of <unistd.h>

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

7 years ago[XRay] Move specialisations into correct namespace
Dean Michael Berris [Wed, 26 Oct 2016 04:26:53 +0000 (04:26 +0000)]
[XRay] Move specialisations into correct namespace

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

7 years ago[XRay] Remove extra `;` to make -wpedantic happy
Dean Michael Berris [Wed, 26 Oct 2016 04:21:17 +0000 (04:21 +0000)]
[XRay] Remove extra `;` to make -wpedantic happy

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

7 years ago[XRay] Add llvm-xray as a dependency to test/CMakeLists.txt
Dean Michael Berris [Wed, 26 Oct 2016 04:16:05 +0000 (04:16 +0000)]
[XRay] Add llvm-xray as a dependency to test/CMakeLists.txt

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

7 years ago[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool
Dean Michael Berris [Wed, 26 Oct 2016 04:14:34 +0000 (04:14 +0000)]
[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool

Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

Diffusion Revision: https://reviews.llvm.org/D21987

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

7 years agoCloning: Also clone global variable attached metadata.
Peter Collingbourne [Wed, 26 Oct 2016 02:57:33 +0000 (02:57 +0000)]
Cloning: Also clone global variable attached metadata.

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

7 years ago[libFuzzer] refresh docs
Kostya Serebryany [Wed, 26 Oct 2016 01:55:17 +0000 (01:55 +0000)]
[libFuzzer] refresh docs

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

7 years agoRevert "[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool"
Dean Michael Berris [Wed, 26 Oct 2016 01:50:59 +0000 (01:50 +0000)]
Revert "[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool"

Reverts r285155 -- misconfigured tests.

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