OSDN Git Service

android-x86/external-llvm.git
7 years ago[InstCombine] Move portion of SimplifyDemandedUseBits that deals with instructions...
Craig Topper [Wed, 12 Apr 2017 18:05:21 +0000 (18:05 +0000)]
[InstCombine] Move portion of SimplifyDemandedUseBits that deals with instructions with multiple uses out to a separate method. NFCI

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

7 years ago[SystemZ] Fix more target specific tests
Renato Golin [Wed, 12 Apr 2017 18:03:09 +0000 (18:03 +0000)]
[SystemZ] Fix more target specific tests

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

7 years ago[SystemZ] Fix target specific tests
Renato Golin [Wed, 12 Apr 2017 17:14:46 +0000 (17:14 +0000)]
[SystemZ] Fix target specific tests

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

7 years ago[AMDGPU][MC] Added support for several VI-specific opcodes (s_wakeup, etc)
Dmitry Preobrazhensky [Wed, 12 Apr 2017 17:10:07 +0000 (17:10 +0000)]
[AMDGPU][MC] Added support for several VI-specific opcodes (s_wakeup, etc)

Added support for VI:

- s_endpgm_saved
- s_wakeup
- s_rfe_restore_b64
- v_perm_b32

Enabled for VI:

- v_mov_fed_b32
- v_mov_fed_b32_e64

See bug 32593: https://bugs.llvm.org//show_bug.cgi?id=32593

Reviewers: artem.tamazov, vpykhtin

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

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

7 years agoTeach SimplifyDemandedUseBits that adding or subtractings 0s from every bit below...
Craig Topper [Wed, 12 Apr 2017 16:49:59 +0000 (16:49 +0000)]
Teach SimplifyDemandedUseBits that adding or subtractings 0s from every bit below the highest demanded bit can be simplified

If we are adding/subtractings 0s below the highest demanded bit we can just use the other operand and remove the operation.

My primary motivation is observing that we can call ShrinkDemandedConstant for the add/sub and create a 0 constant, rather than removing the add completely. In the case I saw, we modified the constant on an add instruction to a 0, but the add is not put into the worklist. So we didn't revisit it until the next InstCombine iteration. This caused an IR modification to remove add and a subsequent iteration to be ran.

With this change we get bypass the add in the first iteration and prevent the second iteration from changing anything.

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

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

7 years ago[AMDGPU][MC] Corrected parsing of v_cmp_class* and v_cmpx_class*
Dmitry Preobrazhensky [Wed, 12 Apr 2017 16:31:18 +0000 (16:31 +0000)]
[AMDGPU][MC] Corrected parsing of v_cmp_class* and v_cmpx_class*

Fixed bug 32565: https://bugs.llvm.org//show_bug.cgi?id=32565

Reviewers: vpykhtin

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

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

7 years ago[WebAssembly] Update use of Attributes after r299875
Derek Schuff [Wed, 12 Apr 2017 16:03:00 +0000 (16:03 +0000)]
[WebAssembly] Update use of Attributes after r299875

This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests

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

7 years ago[AMDGPU][MC] Corrected encoding of V_MQSAD_U32_U8 for CI
Dmitry Preobrazhensky [Wed, 12 Apr 2017 15:36:09 +0000 (15:36 +0000)]
[AMDGPU][MC] Corrected encoding of V_MQSAD_U32_U8 for CI

Corrected encoding of V_MQSAD_U32_U8 for CI

See bug 32552: https://bugs.llvm.org//show_bug.cgi?id=32552

Reviewers: vpykhtin

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

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

7 years agoFix the bootstrap failure caused by r299986.
Easwaran Raman [Wed, 12 Apr 2017 15:26:15 +0000 (15:26 +0000)]
Fix the bootstrap failure caused by r299986.

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

7 years ago[InstCombine] morph an existing instruction instead of creating a new one
Sanjay Patel [Wed, 12 Apr 2017 15:11:33 +0000 (15:11 +0000)]
[InstCombine] morph an existing instruction instead of creating a new one

One potential way to make InstCombine (very slightly?) faster is to recycle instructions
when possible instead of creating new ones. It's not explicitly stated AFAIK, but we don't
consider this an "InstSimplify". We could, however, make a new layer to house transforms
like this if that makes InstCombine more manageable (just throwing out an idea; not sure
how much opportunity is actually here).

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

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

7 years ago[AMDGPU][MC] Corrected ds_wrxchg2* to support two offsets
Dmitry Preobrazhensky [Wed, 12 Apr 2017 14:29:45 +0000 (14:29 +0000)]
[AMDGPU][MC] Corrected ds_wrxchg2* to support two offsets

Fixed bug 28227: https://bugs.llvm.org//show_bug.cgi?id=28227

Reviewers: vpykhtin

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

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

7 years agoFix a RUN line in new test.
Jonas Paulsson [Wed, 12 Apr 2017 14:25:08 +0000 (14:25 +0000)]
Fix a RUN line in new test.

Use '2>&1 |' and not '|&' to pipe debug output to FileCheck

Hopefully handles a "shell parser error" on
llvm-clang-x86_64-expensive-checks-win

test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll

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

7 years agoRemove redundant type casts
Serge Pavlov [Wed, 12 Apr 2017 14:13:00 +0000 (14:13 +0000)]
Remove redundant type casts

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

7 years agoFix detection of backtrace() availability on FreeBSD
Ed Maste [Wed, 12 Apr 2017 13:51:00 +0000 (13:51 +0000)]
Fix detection of backtrace() availability on FreeBSD

On FreeBSD backtrace is not part of libc and depends on libexecinfo
being available. Instead of using manual checks we can use the builtin
CMake module FindBacktrace.cmake to detect availability of backtrace()
in a portable way.

Patch By: Alex Richardson
Differential Revision: https://reviews.llvm.org/D27143

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

7 years ago[SLPVectorizer] Pass the right type argument to getCmpSelInstrCost()
Jonas Paulsson [Wed, 12 Apr 2017 13:29:25 +0000 (13:29 +0000)]
[SLPVectorizer]  Pass the right type argument to getCmpSelInstrCost()

In getEntryCost(), make the scalar type for a compare instruction that of the
operands, not i1. This is needed in order to call getCmpSelInstrCost() for a
compare in a sensible way, the same way as the LoopVectorizer does.

New test: test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll

Review: Matthew Simpson
https://reviews.llvm.org/D31601

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

7 years ago[MachineBlockPlacment] Add an assert to ensure there is no order dependency on DenseM...
Benjamin Kramer [Wed, 12 Apr 2017 13:26:31 +0000 (13:26 +0000)]
[MachineBlockPlacment] Add an assert to ensure there is no order dependency on DenseMap iteration order.

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

7 years ago[MachineBlockPlacement] Clean up data structures a bit.
Benjamin Kramer [Wed, 12 Apr 2017 13:26:28 +0000 (13:26 +0000)]
[MachineBlockPlacement] Clean up data structures a bit.

No functionality change intended.

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

7 years ago[LoopVectorizer] Improve handling of branches during cost estimation.
Jonas Paulsson [Wed, 12 Apr 2017 13:13:15 +0000 (13:13 +0000)]
[LoopVectorizer]  Improve handling of branches during cost estimation.

The cost for a branch after vectorization is very different depending on if
the vectorizer will if-convert the block (branch is eliminated), or if
scalarized and predicated blocks will be produced (branch duplicated before
each block). There is also the case of remaining scalar branches, such as the
back-edge branch.

This patch handles these cases differently with TTI based cost estimates.

Review: Matthew Simpson
https://reviews.llvm.org/D31175

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

7 years ago[GlobalIsel][X86] support G_CONSTANT selection.
Igor Breger [Wed, 12 Apr 2017 12:54:54 +0000 (12:54 +0000)]
[GlobalIsel][X86] support G_CONSTANT selection.

Summary: [GlobalISel][X86] support G_CONSTANT selection. Add regbank select tests.

Reviewers: zvi, guyblank

Reviewed By: guyblank

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

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

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

7 years ago[LoopVectorizer, TTI] New method supportsEfficientVectorElementLoadStore()
Jonas Paulsson [Wed, 12 Apr 2017 12:41:37 +0000 (12:41 +0000)]
[LoopVectorizer, TTI]  New method supportsEfficientVectorElementLoadStore()

Since SystemZ supports vector element load/store instructions, there is no
need for extracts/inserts if a vector load/store gets scalarized.

This patch lets Target specify that it supports such instructions by means of
a new TTI hook that defaults to false.

The use for this is in the LoopVectorizer getScalarizationOverhead() method,
which will with this patch produce a smaller sum for a vector load/store on
SystemZ.

New test: test/Transforms/LoopVectorize/SystemZ/load-store-scalarization-cost.ll

Review: Adam Nemet
https://reviews.llvm.org/D30680

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

7 years ago[AMDGPU][MC] Corrected src0 size for s_cbranch_join
Dmitry Preobrazhensky [Wed, 12 Apr 2017 12:40:19 +0000 (12:40 +0000)]
[AMDGPU][MC] Corrected src0 size for s_cbranch_join

Fix for bug 28159: https://bugs.llvm.org//show_bug.cgi?id=28159

Reviewers: vpykhtin, arsenm

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

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

7 years ago[SystemZ] Updated test fp-cast.ll
Jonas Paulsson [Wed, 12 Apr 2017 12:11:41 +0000 (12:11 +0000)]
[SystemZ]  Updated test fp-cast.ll

This did not get included in the previous commit for SystemZ cost functions.

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

7 years ago[SystemZ] TargetTransformInfo cost functions implemented.
Jonas Paulsson [Wed, 12 Apr 2017 11:49:08 +0000 (11:49 +0000)]
[SystemZ]  TargetTransformInfo cost functions implemented.

getArithmeticInstrCost(), getShuffleCost(), getCastInstrCost(),
getCmpSelInstrCost(), getVectorInstrCost(), getMemoryOpCost(),
getInterleavedMemoryOpCost() implemented.

Interleaved access vectorization enabled.

BasicTTIImpl::getCastInstrCost() improved to check for legal extending loads,
in which case the cost of the z/sext instruction becomes 0.

Review: Ulrich Weigand, Renato Golin.
https://reviews.llvm.org/D29631

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

7 years ago[DWARF] Fix compiler warnings in DWARFContext.cpp, NFCi
Krasimir Georgiev [Wed, 12 Apr 2017 11:33:26 +0000 (11:33 +0000)]
[DWARF] Fix compiler warnings in DWARFContext.cpp, NFCi

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

7 years ago[LangRef] fix documentation
Piotr Padlewski [Wed, 12 Apr 2017 11:18:19 +0000 (11:18 +0000)]
[LangRef] fix documentation

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

7 years ago[AMDGPU] SDWA: make pass global
Sam Kolton [Wed, 12 Apr 2017 09:36:05 +0000 (09:36 +0000)]
[AMDGPU] SDWA: make pass global

Summary: Remove checks for basic blocks.

Reviewers: vpykhtin, rampitec, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

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

7 years ago[DWARF] - Refactoring of DWARFContextInMemory implementation.
George Rimar [Wed, 12 Apr 2017 08:59:15 +0000 (08:59 +0000)]
[DWARF] - Refactoring of DWARFContextInMemory implementation.

This change is basically relative to D31136, where I initially wanted to
implement some relocations handling optimization which shows it can give
significant boost. Though even without any caching algorithm looks
code can have some cleanup at first.

Refactoring separates out code for taking symbol address, used in relocations
computation.

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

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

7 years ago[IR] Rename the class templates for the case iterator and case handle to
Chandler Carruth [Wed, 12 Apr 2017 08:48:39 +0000 (08:48 +0000)]
[IR] Rename the class templates for the case iterator and case handle to
not collide with the naming convention for template *arguments*. In at
least one case they actually collided and this confuses MSVC.

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

7 years ago[globalisel][tablegen] Add experimental support for OperandWithDefaultOps, PredicateO...
Daniel Sanders [Wed, 12 Apr 2017 08:23:08 +0000 (08:23 +0000)]
[globalisel][tablegen] Add experimental support for OperandWithDefaultOps, PredicateOperand, and OptionalDefOperand

Summary:
As far as instruction selection is concerned, all three appear to be same thing.

Support for these operands is experimental since AArch64 doesn't make use
of them and the in-tree targets that do use them (AMDGPU for
OperandWithDefaultOps, AMDGPU/ARM/Hexagon/Lanai for PredicateOperand, and ARM
for OperandWithDefaultOps) are not using tablegen-erated GlobalISel yet.

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

Reviewed By: rovka

Subscribers: inglorion, aemerson, rengolin, mehdi_amini, dberris, kristof.beyls, igorb, tpr, llvm-commits

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

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

7 years ago[LoadCombine] Avoid analysing dead basic blocks
Bjorn Pettersson [Wed, 12 Apr 2017 08:07:55 +0000 (08:07 +0000)]
[LoadCombine] Avoid analysing dead basic blocks

Summary:
Dead basic blocks may be forming a loop, for which SSA form is
fulfilled, but with a circular def-use chain. LoadCombine could
enter an infinite loop when analysing such dead code. This patch
solves the problem by simply avoiding to analyse all basic blocks
that aren't forward reachable, from function entry, in LoadCombine.

Fixes https://bugs.llvm.org/show_bug.cgi?id=27065

Reviewers: mehdi_amini, chandlerc, grosser, Bigcheese, davide

Reviewed By: davide

Subscribers: dberlin, zzheng, bjope, grandinj, Ka-Ka, materi, jholewinski, llvm-commits, mzolotukhin

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

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

7 years agoInvariant.group and mustalias docs fixes
Piotr Padlewski [Wed, 12 Apr 2017 07:59:35 +0000 (07:59 +0000)]
Invariant.group and mustalias docs fixes

Summary:
Alias analysis would like to know that
invariant.group.barrier returns pointer that mustalias,
but this can't imply that we can replace one pointer with another

Reviewers: dberlin, sanjoy

Subscribers: llvm-commits, chandlerc, hfinkel, nlewycky, amharc

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

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

7 years ago[IR] Redesign the case iterator in SwitchInst to actually be an iterator
Chandler Carruth [Wed, 12 Apr 2017 07:27:28 +0000 (07:27 +0000)]
[IR] Redesign the case iterator in SwitchInst to actually be an iterator
and to expose a handle to represent the actual case rather than having
the iterator return a reference to itself.

All of this allows the iterator to be used with common STL facilities,
standard algorithms, etc.

Doing this exposed some missing facilities in the iterator facade that
I've fixed and required some work to the actual iterator to fully
support the necessary API.

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

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

7 years ago[IR] Fix copy and paste mistake in comment. NFC
Craig Topper [Wed, 12 Apr 2017 05:57:46 +0000 (05:57 +0000)]
[IR] Fix copy and paste mistake in comment. NFC

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

7 years ago[InstCombine][IR] Add a commutable BinOp matcher. Use it to reduce some code. NFC
Craig Topper [Wed, 12 Apr 2017 05:49:28 +0000 (05:49 +0000)]
[InstCombine][IR] Add a commutable BinOp matcher. Use it to reduce some code. NFC

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

7 years ago[BPI] Refactor post domination calculation and simple fix for ColdCall
Serguei Katkov [Wed, 12 Apr 2017 05:42:14 +0000 (05:42 +0000)]
[BPI] Refactor post domination calculation and simple fix for ColdCall

Collection of PostDominatedByUnreachable and PostDominatedByColdCall have been
split out of heuristics itself. Update of the data happens now for each basic
block (before update for PostDominatedByColdCall might be skipped if
unreachable or matadata heuristic handled this basic block).

This separation allows re-ordering of heuristics without loosing
the post-domination information.

Reviewers: sanjoy, junbuml, vsk, chandlerc, reames

Reviewed By: chandlerc

Subscribers: llvm-commits

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

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

7 years ago[INC] Test commit. NFC.
Serguei Katkov [Wed, 12 Apr 2017 04:41:35 +0000 (04:41 +0000)]
[INC] Test commit. NFC.

Just an update of comment.

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

7 years ago[AMDGPU] Add a new pass to insert waitcnts. Leave under an option for testing.
Kannan Narayanan [Wed, 12 Apr 2017 03:25:12 +0000 (03:25 +0000)]
[AMDGPU] Add a new pass to insert waitcnts. Leave under an option for testing.

Based on comments in https://reviews.llvm.org/D31161.

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

7 years agoCodeGen: BlockPlacement: Clear ComputedEdges between functions.
Kyle Butt [Wed, 12 Apr 2017 03:18:20 +0000 (03:18 +0000)]
CodeGen: BlockPlacement: Clear ComputedEdges between functions.

Not clearing was causing non-deterministic compiles for large files. Addresses
for MachineBasicBlocks would end up colliding and we would lay out a block that
we assumed had been pre-computed when it had not been.

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

7 years agoThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed
Bob Haarman [Wed, 12 Apr 2017 01:43:07 +0000 (01:43 +0000)]
ThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed

Summary:
COFF requires that every comdat contain a symbol with the same name as
the comdat. ThinLTOBitcodeWriter renames symbols, which may cause this
requirement to be violated. This change avoids such violations by
renaming comdats if their leaders are renamed. It also keeps comdats
together when splitting modules.

Reviewers: pcc, mehdi_amini, tejohnson

Reviewed By: pcc

Subscribers: rnk, Prazek, llvm-commits

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

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

7 years agoRevert "[WebAssembly] Update use of Attributes after r299875"
Derek Schuff [Wed, 12 Apr 2017 01:17:31 +0000 (01:17 +0000)]
Revert "[WebAssembly] Update use of Attributes after r299875"

This reverts commit 2a0eb61dcccb15058d5b2a572bb3da0cf47fd550, r300015

I raced with rnk on the commit.

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

7 years ago[WebAssembly] Update use of Attributes after r299875
Derek Schuff [Wed, 12 Apr 2017 01:09:34 +0000 (01:09 +0000)]
[WebAssembly] Update use of Attributes after r299875

This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests

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

7 years ago[IR] Add AttributeSet to hide AttributeSetNode* again, NFC
Reid Kleckner [Wed, 12 Apr 2017 00:38:00 +0000 (00:38 +0000)]
[IR] Add AttributeSet to hide AttributeSetNode* again, NFC

Summary:
For now, it just wraps AttributeSetNode*. Eventually, it will hold
AvailableAttrs as an inline bitset, and adding and removing enum
attributes will be super cheap.

This sinks AttributeSetNode back down to lib/IR/AttributeImpl.h.

Reviewers: pete, chandlerc

Subscribers: llvm-commits, jfb

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

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

7 years agoRemove xgene1 from host detection
Yi Kong [Tue, 11 Apr 2017 22:39:55 +0000 (22:39 +0000)]
Remove xgene1 from host detection

This is not a supported mcpu tuning option. We should treat it as
"generic" variant.

Also, add record for cortex-a35.

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

7 years agoAMDGPU: Insert wait at start of callee functions
Matt Arsenault [Tue, 11 Apr 2017 22:29:31 +0000 (22:29 +0000)]
AMDGPU: Insert wait at start of callee functions

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

7 years agoAMDGPU: Refactor SIMachineFunctionInfo slightly
Matt Arsenault [Tue, 11 Apr 2017 22:29:28 +0000 (22:29 +0000)]
AMDGPU: Refactor SIMachineFunctionInfo slightly

Prepare for handling non-entry functions.

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

7 years agoAMDGPU: Refactor argument lowering
Matt Arsenault [Tue, 11 Apr 2017 22:29:24 +0000 (22:29 +0000)]
AMDGPU: Refactor argument lowering

Split into smaller functions and prepare for handling
non-entry functions.

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

7 years agoAMDGPU: Fix folding reg_sequence into copy to phys reg
Matt Arsenault [Tue, 11 Apr 2017 22:29:19 +0000 (22:29 +0000)]
AMDGPU: Fix folding reg_sequence into copy to phys reg

This was producing an illegal reg_sequence defining
a physical register with virtual register inputs.

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

7 years agoAMDGPU: Prune unecessary include
Matt Arsenault [Tue, 11 Apr 2017 22:29:16 +0000 (22:29 +0000)]
AMDGPU: Prune unecessary include

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

7 years ago[asan] Give global metadata private linkage.
Evgeniy Stepanov [Tue, 11 Apr 2017 22:28:13 +0000 (22:28 +0000)]
[asan] Give global metadata private linkage.

Internal linkage preserves names like "__asan_global_foo" which may
account to 2% of unstripped binary size.

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

7 years ago[AArch64] Fix scheduling info for INS(vector, general) instruction.
Balaram Makam [Tue, 11 Apr 2017 22:14:10 +0000 (22:14 +0000)]
[AArch64] Fix scheduling info for INS(vector, general) instruction.

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

7 years agoAvoid some string copies, NFC
Vedant Kumar [Tue, 11 Apr 2017 22:11:46 +0000 (22:11 +0000)]
Avoid some string copies, NFC

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

7 years agoMinor updates to floating point intrinsic documentation
Andrew Kaylor [Tue, 11 Apr 2017 21:52:40 +0000 (21:52 +0000)]
Minor updates to floating point intrinsic documentation

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

7 years agoInstSimplify: A shuffle of a splat is always the splat itself
Zvi Rackover [Tue, 11 Apr 2017 21:37:02 +0000 (21:37 +0000)]
InstSimplify:  A shuffle of a splat is always the splat itself

Summary:
Fold:
 shuffle (splat-shuffle), undef, M --> splat-shuffle

Reviewers: spatel, RKSimon, craig.topper

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

7 years ago[DAGCombine] Add more test cases for shuffle of splat. NFC.
Zvi Rackover [Tue, 11 Apr 2017 21:16:59 +0000 (21:16 +0000)]
[DAGCombine] Add more test cases for shuffle of splat. NFC.

Tests added contain splat-masks with undef elements.

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

7 years ago[x86] Relax the check in areLoadsFromSameBasePtr
Easwaran Raman [Tue, 11 Apr 2017 21:05:02 +0000 (21:05 +0000)]
[x86] Relax the check in areLoadsFromSameBasePtr

Check if the scale operand is identical (doesn't have to be 1) and
do not check the chaain operand.

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

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

7 years ago[LV] Avoid vectorizing first order recurrence when phi uses are outside loop
Anna Thomas [Tue, 11 Apr 2017 21:02:00 +0000 (21:02 +0000)]
[LV] Avoid vectorizing first order recurrence when phi uses are outside loop

In the vectorization of first order recurrence, we vectorize such
that the last element in the vector will be the one extracted to pass into the
scalar remainder loop. However, this is not true when there is a phi (other
than the primary induction variable) is used outside the loop.
In such a case, we need the value from the second last iteration (i.e.
the phi value), not the last iteration (which would be the phi update).
I've added a test case for this. Also see PR32396.

A follow up patch would generate the correct code gen for such cases,
and turn this vectorization on.

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

Reviewers: mssimpso

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

7 years ago[InstSimplify] add tests for chains of shuffles; NFC
Sanjay Patel [Tue, 11 Apr 2017 20:54:57 +0000 (20:54 +0000)]
[InstSimplify] add tests for chains of shuffles; NFC

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

7 years agoMemorySSA: Move to Analysis, from Transforms/Utils. It's used as
Daniel Berlin [Tue, 11 Apr 2017 20:06:36 +0000 (20:06 +0000)]
MemorySSA: Move to Analysis, from Transforms/Utils. It's used as
Analysis, it has Analysis passes, and once NewGVN is made an Analysis,
this removes the cross dependency from Analysis to Transform/Utils.
NFC.

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

7 years agoMIR: Allow parsing of empty machine functions
Justin Bogner [Tue, 11 Apr 2017 19:32:41 +0000 (19:32 +0000)]
MIR: Allow parsing of empty machine functions

If you run llc -stop-after=codegenprepare and feed the resulting MIR
to llc -start-after=codegenprepare, you'll have an empty machine
function since we haven't run any isel yet. Of course, this only works
if the MIRParser believes you that this is okay.

This is essentially a revert of r241862 with a fix for the problem it
was papering over.

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

7 years ago[AArch64] Simplify MacroFusion
Evandro Menezes [Tue, 11 Apr 2017 19:13:11 +0000 (19:13 +0000)]
[AArch64] Simplify MacroFusion

This patch assumes that the dependents to be scanned for the ExitSU are its
predecessors; otherwise, the successors of the instr are scanned.

Furthermore, sometimes the ExitSU was being fused twice, since it may be
fused once when scanning the successors from the beginning of the BB and
then again when scanning the predecessors of ExitSU.  Thus, when scanning
the successors of an instr, skip the ExitSU.

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

7 years ago[X86] Create the correct ADC/SBB SDNode when lowering add.
Davide Italiano [Tue, 11 Apr 2017 19:11:20 +0000 (19:11 +0000)]
[X86] Create the correct ADC/SBB SDNode when lowering add.

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

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

7 years ago[AddDiscriminators] Assign discriminators to MemIntrinsic calls.
Andrea Di Biagio [Tue, 11 Apr 2017 19:07:30 +0000 (19:07 +0000)]
[AddDiscriminators] Assign discriminators to MemIntrinsic calls.

Before this patch, pass AddDiscriminators always avoided to assign
discriminators to intrinsic calls. This was done mainly for two reasons:
 1) We wanted to minimize the number of based discriminators used.
 2) We wanted to avoid non-deterministic discriminator assignment for
    different debug levels.

Unfortunately, that approach was problematic for MemIntrinsic calls.
MemIntrinsic calls can be split by SROA into loads and stores, and each new
load/store instruction would obtain the debug location from the original
intrinsic call.
If we don't assign a discriminator to MemIntrinsic calls, then we cannot
correctly set the discriminator for the newly created loads and stores.
This may have a negative impact on the basic block weight computation
performed by the SampleLoader.

This patch fixes the issue by letting MemIntrinsic calls have a discriminator.

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

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

7 years ago[InstCombine] Add testcases for (B&A)^A -> ~B & A and (B|A)^A -> B & ~A
Craig Topper [Tue, 11 Apr 2017 18:50:48 +0000 (18:50 +0000)]
[InstCombine] Add testcases for (B&A)^A -> ~B & A and (B|A)^A -> B & ~A

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

7 years agoFix spelling compliment->complement. Mostly refering to 2s complement. NFC
Craig Topper [Tue, 11 Apr 2017 18:47:58 +0000 (18:47 +0000)]
Fix spelling compliment->complement. Mostly refering to 2s complement. NFC

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

7 years ago[LV] Move first order recurrence test to common folder. NFC
Anna Thomas [Tue, 11 Apr 2017 18:31:42 +0000 (18:31 +0000)]
[LV] Move first order recurrence test to common folder. NFC

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

7 years ago[libFuzzer] fix type in signal name.
Vitaly Buka [Tue, 11 Apr 2017 18:20:05 +0000 (18:20 +0000)]
[libFuzzer] fix type in signal name.

Fixes PR32576.

Patch by Jakub Zawadzki.

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

7 years agollvm-lto2: Move the LTO::run() action behind a subcommand.
Peter Collingbourne [Tue, 11 Apr 2017 18:12:00 +0000 (18:12 +0000)]
llvm-lto2: Move the LTO::run() action behind a subcommand.

Move LTO::run() to a "run" subcommand so that we can introduce new subcommands
for testing different parts of the LTO implementation.

This doesn't use llvm::cl subcommands because it doesn't appear to be currently
possible to pass an argument not associated with a subcommand to a subcommand
(e.g. -lto-use-new-pm, -mcpu=yonah).

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

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

7 years ago[InstCombine] Use ConstantExpr::getBinOpIdentity to implement getIdentityValue.
Craig Topper [Tue, 11 Apr 2017 17:42:40 +0000 (17:42 +0000)]
[InstCombine] Use ConstantExpr::getBinOpIdentity to implement getIdentityValue.

This removes a TODO in getIdentityValue and may allow some transforms to occur earlier. But I was unable to find any transforms we didn't already handle.

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

7 years ago[AMDGPU] Add A5 to data layout for amdgiz environment
Yaxun Liu [Tue, 11 Apr 2017 17:18:13 +0000 (17:18 +0000)]
[AMDGPU] Add A5 to data layout for amdgiz environment

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

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

7 years agoRevert 299953 : test failure needs to be fixed
Xinliang David Li [Tue, 11 Apr 2017 16:27:20 +0000 (16:27 +0000)]
Revert 299953 : test failure needs to be fixed

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

7 years ago[PDB] Emit index/offset pairs for TPI and IPI streams
Reid Kleckner [Tue, 11 Apr 2017 16:26:15 +0000 (16:26 +0000)]
[PDB] Emit index/offset pairs for TPI and IPI streams

Summary:
This lets PDB readers lookup type record data by type index in O(log n)
time. It also enables makes `cvdump -t` work on PDBs produced by LLD.
cvdump will not dump a PDB that doesn't have an index-to-offset table.

The table is sorted by type index, and has an entry every 8KB. Looking
up a type record by index is a binary search of this table, followed by
a scan of at most 8KB.

Reviewers: ruiu, zturner, inglorion

Subscribers: llvm-commits

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

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

7 years agorevert r299851 - [InstCombine] fix matching of or-of-icmps constants (PR32524)
Sanjay Patel [Tue, 11 Apr 2017 15:57:32 +0000 (15:57 +0000)]
revert r299851 - [InstCombine] fix matching of or-of-icmps constants (PR32524)

This is a candidate culprit for multiple bot fails, so reverting pending investigation.

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

7 years ago[Profile] PE binary coverage bug fix
Xinliang David Li [Tue, 11 Apr 2017 15:51:32 +0000 (15:51 +0000)]
[Profile] PE binary coverage bug fix

PR/32584

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

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

7 years agoModule::getOrInsertFunction is using C-style vararg instead of variadic templates.
Serge Guelton [Tue, 11 Apr 2017 15:01:18 +0000 (15:01 +0000)]
Module::getOrInsertFunction is using C-style vararg instead of variadic templates.

From a user prospective, it forces the use of an annoying nullptr to mark the end of the vararg, and there's not type checking on the arguments.
The variadic template is an obvious solution to both issues.

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

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

7 years agoRemove unused functions. Remove static qualifier from functions in header files....
Vassil Vassilev [Tue, 11 Apr 2017 14:55:32 +0000 (14:55 +0000)]
Remove unused functions. Remove static qualifier from functions in header files. NFC.

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

7 years ago[AVR] Migrate to new MCAsmBackend applyFixup
Jonathan Roelofs [Tue, 11 Apr 2017 14:51:49 +0000 (14:51 +0000)]
[AVR] Migrate to new MCAsmBackend applyFixup

https://reviews.llvm.org/D31875

Patch by Leslie Zhai!

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

7 years ago[ARM] Refactor Thumb2 sat instructions
Sam Parker [Tue, 11 Apr 2017 14:42:08 +0000 (14:42 +0000)]
[ARM] Refactor Thumb2 sat instructions

Refactor the USAT, SSAT, USAT16 and SSAT16 instruction descriptions
for Thumb2.

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

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

7 years ago[GVNHoist] Re-enable GVNHoist by default
Geoff Berry [Tue, 11 Apr 2017 14:36:30 +0000 (14:36 +0000)]
[GVNHoist] Re-enable GVNHoist by default

Turn GVNHoist back on by default now that PR32153 has been fixed.

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

7 years ago[SDAG] Factor CandidateMatch check into lambda. NFC.
Nirav Dave [Tue, 11 Apr 2017 13:41:19 +0000 (13:41 +0000)]
[SDAG] Factor CandidateMatch check into lambda. NFC.

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

7 years ago[SDAG] Factor ChainMerge into helper function NFCI.
Nirav Dave [Tue, 11 Apr 2017 13:41:17 +0000 (13:41 +0000)]
[SDAG] Factor ChainMerge into helper function NFCI.

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

7 years ago[SDAG] Reorder expensive StoreMerge Check after cheaper one. NFC
Nirav Dave [Tue, 11 Apr 2017 13:41:16 +0000 (13:41 +0000)]
[SDAG] Reorder expensive StoreMerge Check after cheaper one. NFC

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

7 years ago[StripDeadDebug/DIFinder] Track inlined SPs
Keno Fischer [Tue, 11 Apr 2017 13:32:11 +0000 (13:32 +0000)]
[StripDeadDebug/DIFinder] Track inlined SPs

Summary:
In rL299692 I improved strip-dead-debug-info's ability to drop CUs that are not
referenced from the current module. However, in doing so I neglected to realize
that some SPs could be referenced entirely from inlined functions. It appears
I was not the only one to make this mistake, because DebugInfoFinder, doesn't
find those SPs either. Fix this in DebugInfoFinder and then use that to make
sure not to drop those CUs in strip-dead-debug-info.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: llvm-commits

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

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

7 years agoAdd MachineRegionInfoPassID to Passes.h.
Jan Sjodin [Tue, 11 Apr 2017 11:40:55 +0000 (11:40 +0000)]
Add MachineRegionInfoPassID to Passes.h.

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

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

7 years agoGlobalISel: Allow legalizing G_FADD to a libcall
Diana Picus [Tue, 11 Apr 2017 10:52:34 +0000 (10:52 +0000)]
GlobalISel: Allow legalizing G_FADD to a libcall

Use the same handling in the generic legalizer code as for the other
libcalls (G_FREM, G_FPOW).

Enable it on ARM for float and double so we can test it.

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

7 years ago[GlobalISel] LegalizerInfo: Enable legalization of non-power-of-2 types
Volkan Keles [Tue, 11 Apr 2017 10:10:14 +0000 (10:10 +0000)]
[GlobalISel] LegalizerInfo: Enable legalization of non-power-of-2 types

Summary: Legalize only if the type is marked as Legal or Custom. If not, return Unsupported as LegalizerHelper is not able to handle non-power-of-2 types right now.

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

Reviewed By: kristof.beyls, ab

Subscribers: dberris, rovka, igorb, llvm-commits

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

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

7 years agoRevert "Turn some C-style vararg into variadic templates"
Diana Picus [Tue, 11 Apr 2017 10:07:12 +0000 (10:07 +0000)]
Revert "Turn some C-style vararg into variadic templates"

This reverts commit r299925 because it broke the buildbots. See e.g.
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/6008

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

7 years ago[SelectionDAG] Check CALLSEQ_BEGIN nodes in DelayForLiveRegs
Sam Parker [Tue, 11 Apr 2017 08:43:32 +0000 (08:43 +0000)]
[SelectionDAG] Check CALLSEQ_BEGIN nodes in DelayForLiveRegs

A fix for the bug reported in PR30911.

The issue arises when multiple CALLSEQ_BEGIN nodes are unscheduled as
the last node to be unscheduled will gain access to the CallResource
register. But when a node is being picked, only CALLSEQ_END nodes are
checked against the CallResource and have their chains evaluated.
This then means that other CALLSEQ_BEGIN nodes can be scheduled
before the existing call sequence has been finalised. This patch adds
a check against the FrameSetup nodes in DelayForLiveRegs to prevent
this from happening.

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

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

7 years agoTurn some C-style vararg into variadic templates
Serge Guelton [Tue, 11 Apr 2017 08:36:52 +0000 (08:36 +0000)]
Turn some C-style vararg into variadic templates

Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.

From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.

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

7 years agoSimplify the code and remove dead code
Sylvestre Ledru [Tue, 11 Apr 2017 08:21:27 +0000 (08:21 +0000)]
Simplify the code and remove dead code

Summary: Fix coverity cid 1374240

Reviewers: dberlin

Reviewed By: dberlin

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

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

7 years ago[IR] Fix a typo in a comment. NFC
Craig Topper [Tue, 11 Apr 2017 06:41:55 +0000 (06:41 +0000)]
[IR] Fix a typo in a comment. NFC

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

7 years ago[InstCombine] Refinement of r299915. Only consider a ConstantVector for Neg if all...
Craig Topper [Tue, 11 Apr 2017 06:32:48 +0000 (06:32 +0000)]
[InstCombine] Refinement of r299915. Only consider a ConstantVector for Neg if all the elements are Undef or ConstantInt.

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

7 years ago[InstCombine] Support weird size element types in dyn_castNegVal.
Craig Topper [Tue, 11 Apr 2017 05:42:47 +0000 (05:42 +0000)]
[InstCombine] Support weird size element types in dyn_castNegVal.

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

7 years ago[LoopUnswitch] Fix a test case
Sanjoy Das [Tue, 11 Apr 2017 04:11:47 +0000 (04:11 +0000)]
[LoopUnswitch] Fix a test case

(h/t to Chandler for pointing this out)

The test in question was not at all testing what it was supposed to
test.  We do not //care// about placing `!make.implicit` in inner
constant branch (since it will be folded away anyway).  We care about
placing `!make.implicit` in the outer branch that switches between
either version of the loop.

Having said that, it is _correct_ to leave behind the `!make.implicit`
in the inner branch, but there is no need to do so.

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

7 years ago[LICM] Hoist fp division from the loops and replace by a reciprocal
Hal Finkel [Tue, 11 Apr 2017 02:22:54 +0000 (02:22 +0000)]
[LICM] Hoist fp division from the loops and replace by a reciprocal

When allowed, we can hoist a division out of a loop in favor of a
multiplication by the reciprocal. Fixes PR32157.

Patch by vit9696!

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

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

7 years ago[PowerPC] multiply-with-overflow might use the CTR register
Hal Finkel [Tue, 11 Apr 2017 02:03:17 +0000 (02:03 +0000)]
[PowerPC] multiply-with-overflow might use the CTR register

Check the legality of ISD::[US]MULO to see whether
Intrinsic::[us]mul_with_overflow will legalize into a function call (and, thus,
will use the CTR register).  Fixes PR32485.

Patch by Tim Neumann!

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

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

7 years ago[bugpoint] Also remove comdat's from externalized GVs
Hal Finkel [Tue, 11 Apr 2017 00:18:42 +0000 (00:18 +0000)]
[bugpoint] Also remove comdat's from externalized GVs

We were removing comdats from externalized functions (function declarations
can't be comdat), but were not doing the same for variable. Failure to do this
would cause bugpoint to fail ("Declaration may not be in a Comdat!").

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

7 years ago[IR] Sink some AttributeListImpl methods out of headers NFC
Reid Kleckner [Tue, 11 Apr 2017 00:16:00 +0000 (00:16 +0000)]
[IR] Sink some AttributeListImpl methods out of headers NFC

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

7 years agoRevert "NewGVN: Don't propagate over phi backedges where undef causes us to have...
Daniel Berlin [Tue, 11 Apr 2017 00:07:26 +0000 (00:07 +0000)]
Revert "NewGVN: Don't propagate over phi backedges where undef causes us to have >1 value."
It's not ready yet this was an accidental commit :(

This reverts r299903

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

7 years agoNewGVN: Don't propagate over phi backedges where undef causes us to have >1 value.
Daniel Berlin [Tue, 11 Apr 2017 00:02:38 +0000 (00:02 +0000)]
NewGVN: Don't propagate over phi backedges where undef causes us to have >1 value.

Fixes PR 32607.

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

7 years agoRemove AttributeSetNode::get(AttributeList, unsigned) and sink constructor
Reid Kleckner [Mon, 10 Apr 2017 23:46:08 +0000 (23:46 +0000)]
Remove AttributeSetNode::get(AttributeList, unsigned) and sink constructor

The getter was equivalent to AttributeList::getAttributes(unsigned),
which seems like a better way to express getting the AttributeSet for a
given index. This static helper was only used in one place anyway.

The constructor doesn't benefit from inlining and doesn't need to be in
a header.

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