128306 Commits

Author SHA1 Message Date
Sanjay Patel
3a7e753170 [x86, InstCombine] transform x86 AVX masked loads to LLVM intrinsics
The intended effect of this patch in conjunction with:
http://reviews.llvm.org/rL259392
http://reviews.llvm.org/rL260145

is that customers using the AVX intrinsics in C will benefit from combines when
the load mask is constant:

__m128 mload_zeros(float *f) {
  return _mm_maskload_ps(f, _mm_set1_epi32(0));
}

__m128 mload_fakeones(float *f) {
  return _mm_maskload_ps(f, _mm_set1_epi32(1));
}

__m128 mload_ones(float *f) {
  return _mm_maskload_ps(f, _mm_set1_epi32(0x80000000));
}

__m128 mload_oneset(float *f) {
  return _mm_maskload_ps(f, _mm_set_epi32(0x80000000, 0, 0, 0));
}

...so none of the above will actually generate a masked load for optimized code.

This is the masked load counterpart to:
http://reviews.llvm.org/rL262064



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 23:16:48 +00:00
David Majnemer
87e4278b8c [Verifier] Handle more funclet edge cases
This change makes the verifier a little more paranoid.  It was possible
to trick the verifier into crashing or infinite looping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:56:36 +00:00
Adam Nemet
2e073f55eb [LLE] Fix SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper with Polly
We can actually have dependences between accesses with different
underlying types.  Bail in this case.

A test will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:53:59 +00:00
Eric Christopher
912dbc9d0e Simplify some boolean conditional return statements in AArch64.
http://reviews.llvm.org/D9979

Patch by Richard Thomson (and some conflict resolution by me).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:50:49 +00:00
Adrian Prantl
388c01f356 Improve the debug output of DwarfDebug::buildLocationList().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:28:22 +00:00
Adrian Prantl
692e80bd5c Document an anomaly in this testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:28:16 +00:00
Paul Robinson
5dc46f59dd Reapply r262092: [FileCheck] Abort if -NOT is combined with another suffix.
Combinations of suffixes that look useful are actually ignored;
complaining about them will avoid mistakes.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:13:03 +00:00
Sanjoy Das
bfc5df0cb4 [Verifier] Minor fix to error message; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:04:25 +00:00
Colin LeMahieu
6e4a4d849c [Hexagon] As a size optimization, not lazy extending TPREL or DTPREL variants since they're usually in range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 21:21:56 +00:00
Colin LeMahieu
adaa70afa6 [Hexagon] Missed member initialization causing ubsan failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 20:42:25 +00:00
Adam Nemet
7ff3ae62d2 Enable LoopLoadElimination by default
Summary:
I re-benchmarked this and results are similar to original results in
D13259:

On ARM64:
  SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog -59.27%
  SingleSource/Benchmarks/Polybench/stencils/adi                   -19.78%

On x86:
  SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog  -27.14%

And of course the original ~20% gain on SPECint_2006/456.hmmer with Loop
Distribution.

In terms of compile time, there is ~5% increase on both
SingleSource/Benchmarks/Misc/oourafft and
SingleSource/Benchmarks/Linkpack/linkpack-pc.  These are both very tiny
loop-intensive programs where SCEV computations dominates compile time.

The reason that time spent in SCEV increases has to do with the design
of the old pass manager.  If a transform pass does not preserve an
analysis we *invalidate* the analysis even if there was *no*
modification made by the transform pass.

This means that currently we don't take advantage of LLE and LV sharing
the same analysis (LAA) and unfortunately we recompute LAA *and* SCEV
for LLE.

(There should be a way to work around this limitation in the case of
SCEV and LAA since both compute things on demand and internally cache
their result.  Thus we could pretend that transform passes preserve
these analyses and manually invalidate them upon actual modification.
On the other hand the new pass manager is supposed to solve so I am not
sure if this is worthwhile.)

Reviewers: hfinkel, dberlin

Subscribers: dberlin, reames, mssimpso, aemerson, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 20:35:11 +00:00
Adrian Prantl
30c4a7d4ae Fixup MIPS testcase after r262247 and make it a little more robust.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 20:25:10 +00:00
Geoff Berry
049269de72 [AArch64] Fix isLegalAddImmediate() to return true for valid negative values.
Reviewers: t.p.northover, jmolloy

Subscribers: mcrosier, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:53:22 +00:00
Adrian Prantl
be45c68b8b Fix PR26585 by improving the promotion of DBG_VALUEs to DW_AT_locations.
When a variable is described by a single DBG_VALUE instruction we can
often use a more efficient inline DW_AT_location instead of using a
location list.

This commit makes the heuristic that decides when to apply this
optimization stricter by also verifying that the DBG_VALUE is live at the
entry of the function (instead of just checking that it is valid until
the end of the function).

<rdar://problem/24611008>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:49:46 +00:00
Steven Wu
b9de197a7a Rename embedded bitcode section in MachO
Summary:
Rename the section embeds bitcode from ".llvmbc,.llvmbc" to "__LLVM,__bitcode".
The new name matches MachO section naming convention.

Reviewers: rafael, pcc

Subscribers: davide, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:40:10 +00:00
Ahmed Bougacha
462318cb2d [X86] Move the ATOMIC_LOAD_OP ISel from DAGToDAG to ISelLowering. NFCI.
This is long-standing dirtiness, as acknowledged by r77582:

    The current trick is to select it into a merge_values with
    the first definition being an implicit_def. The proper solution is
    to add new ISD opcodes for the no-output variant.

Doing this before selection will let us combine away some constructs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:28:07 +00:00
Colin LeMahieu
4a487ecba9 [Hexagon] Setting sign mismatch flag on expression instead of using bit tricks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:17:56 +00:00
Rong Xu
0158e00998 Minor code cleanup. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:16:04 +00:00
David Majnemer
ace061bc34 [WinEH] Make setjmp work correctly with EH
32-bit X86 EH on Windows utilizes a stack of registration nodes
allocated and deallocated on entry/exit.  A registration node contains a
bunch of EH personality specific information like which try-state we are
currently in.

Because a setjmp target allows control flow from arbitrary program
points, there is no way to ensure that the try-state we are in is
correctly updated once we transfer control.

MSVC compatible compilers, like MSVC and ICC, utilize runtime helpers to
reinitialize the try-state when a longjmp occurs.  This is implemented
by adding additional arguments to _setjmp3: the desired try-state and
a helper routine to update the try-state.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 19:16:03 +00:00
Dehao Chen
eb295ed84e Move discriminator assignment to the right place.
Summary: Now discriminator is assigned per-function instead of per-module.

Reviewers: davidxl, dnovillo

Subscribers: dblaikie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 18:59:48 +00:00
Colin LeMahieu
45a6a62865 [Hexagon] Using MustExtend flag on expression instead of passing around bools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 18:39:51 +00:00
Adrian Prantl
66fcf8f3c3 fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 17:06:46 +00:00
Nemanja Ivanovic
9411e53a30 Fix for PR26180
Corresponds to Phabricator review:
http://reviews.llvm.org/D16592

This fix includes both an update to how we handle the "generic" CPU on LE
systems as well as Anton's fix for the Fast Isel issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 16:42:27 +00:00
Daniel Sanders
e4011df11c [mips] Range check uimm20 and fixed a bug this revealed.
Summary:
The bug was that dextu's operand 3 would print 0-31 instead of 32-63 when
printing assembly. This came up when replacing
MipsInstPrinter::printUnsignedImm() with a version that could handle arbitrary
bit widths.

MipsAsmPrinter::printUnsignedImm*() don't seem to be used so they have been
removed.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 16:06:38 +00:00
Vasileios Kalintiris
0b84c67b0b [mips] Do not use SLL for ANY_EXTEND nodes as the high bits are undefined.
Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 15:58:12 +00:00
Daniel Sanders
0178becd87 [mips] Make isel select the correct DEXT variant up front.
Summary:
Previously, it would always select DEXT and substitute any invalid matches
for DEXTU/DEXTM during MipsMCCodeEmitter::encodeInstruction(). This works
but causes problems when adding range checked immediates to IAS.

Now isel selects the correct variant up front.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 15:26:54 +00:00
Rafael Espindola
78ddd2d003 IRObject: Mark extern_weak as weak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 14:26:06 +00:00
Benjamin Kramer
cb7bae1ff0 [InstSimplify] Restore fsub 0.0, (fsub 0.0, X) ==> X optzn
I accidentally removed this in r262212 but there was no test coverage to
detect it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 12:18:25 +00:00
Daniel Sanders
e2fd561543 [mips] Make symbols an acceptable branch target when expanding compare-to-immediate-and-branch macros.
Reviewers: vkalintiris

Subscribers: llvm-commits, vkalintiris, dim, seanbruno, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 11:24:49 +00:00
Benjamin Kramer
e8af9d944e [InstSimplify] fsub 0.0, (fsub -0.0, X) ==> X is only safe if signed zeros are ignored.
Only allow fsub -0.0, (fsub -0.0, X) ==> X without nsz. PR26746.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 11:12:23 +00:00
Daniel Sanders
0562fb318f [test-release.sh] Add lldb to list of projects (disabled by default)
Reviewers: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 11:04:39 +00:00
Chandler Carruth
f7ae2f50a0 [PM] Wire up optimization levels and default pipeline construction APIs
in the PassBuilder.

These are really just stubs for now, but they give a nice API surface
that Clang or other tools can start learning about and enabling for
experimentation.

I've also wired up parsing various synthetic module pass names to
generate these set pipelines. This allows the pipelines to be combined
with other passes and have their order controlled, with clear separation
between the *kind* of canned pipeline, and the *level* of optimization
to be used within that canned pipeline.

The most interesting part of this patch is almost certainly the spec for
the different optimization levels. I don't think we can ever have hard
and fast rules that would make it easy to determine whether a particular
optimization makes sense at a particular level -- it will always be in
large part a judgement call. But hopefully this will outline the
expected rationale that should be used, and the direction that the
pipelines should be taken. Much of this was based on a long llvm-dev
discussion I started years ago to try and crystalize the intent behind
these pipelines, and now, at long long last I'm returning to the task of
actually writing it down somewhere that we can cite and try to be
consistent with.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 22:16:03 +00:00
NAKAMURA Takumi
d9b6afb249 [PM] Appease mingw32's auto-import DLL build with minimal tweaks, with fix for clang.
char AnalysisBase::ID should be declared as extern and defined in one module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 17:17:00 +00:00
Vasileios Kalintiris
fe64ace935 [mips] Remove unused function declarations from MipsRegisterInfo.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 16:55:28 +00:00
NAKAMURA Takumi
bebf4a6f9d Revert r262185, "[PM] Appease mingw32's auto-import DLL build with minimal tweaks."
I'll rework soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 16:54:06 +00:00
NAKAMURA Takumi
fd32a56bfa [PM] Appease mingw32's auto-import DLL build with minimal tweaks.
char AnalysisBase::ID should be declared as extern and defined in one module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 16:38:46 +00:00
JF Bastien
f65b510d67 WebAssembly: fix test
Operand order seems to have changed, the new one is nicer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 15:44:54 +00:00
JF Bastien
df4c0fa9a0 WebAssembly: fix build
More API churn, experimental target got sad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 15:33:53 +00:00
Michael Zuckerman
f4f0450819 [AVX512][PSLLW ][PSLLV] Change imm8 to int
Differential Revision: http://reviews.llvm.org/D17684




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 07:32:10 +00:00
Xinliang David Li
cbdb39cfd0 [PGO] Remove redundant counter copies for avail_extern functions.
Differential Revision: http://reviews.llvm.org/D17654


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 23:11:30 +00:00
Duncan P. N. Exon Smith
88bff1c24a CodeGen: Remove an iterator => pointer conversion, NFC
Part of PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 20:27:44 +00:00
Matt Arsenault
26419a11ad AMDGPU: More bits of frame index are known to be zero
The maximum private allocation for the whole GPU is 4G,
so the maximum possible index for a single workitem is the
maximum size divided by the smallest granularity for a dispatch.

This increases the number of known zero high bits, which
enables more offset folding. The maximum private size per
workitem with this is 128M but may be smaller still.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 20:26:57 +00:00
Duncan P. N. Exon Smith
cc3610dedb CodeGen: Use MachineInstr& in InlineSpiller::rematerializeFor()
InlineSpiller::rematerializeFor() never uses its parameter as an
iterator, so take it by reference instead.  This removes an implicit
conversion from MachineBasicBlock::iterator to MachineInstr*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 20:23:14 +00:00
Duncan P. N. Exon Smith
5144d3546c CodeGen: Update LiveIntervalAnalysis API to use MachineInstr&, NFC
These parameters aren't expected to be null, so take them by reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 20:14:29 +00:00
Duncan P. N. Exon Smith
1d75c8d9ec CodeGen: Change MachineInstr to use MachineInstr&, NFC
Change MachineInstr API to prefer MachineInstr& over MachineInstr*
whenever the parameter is expected to be non-null.  Slowly inching
toward being able to fix PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 20:01:33 +00:00
Matt Arsenault
2bc40a1dbd DAGCombiner: Don't unnecessarily swap operands in ReassociateOps
In the case where op = add, y = base_ptr, and x = offset, this
transform:

(op y, (op x, c1)) -> (op (op x, y), c1)

breaks the canonical form of add by putting the base pointer in the
second operand and the offset in the first.

This fix is important for the R600 target, because for some address
spaces the base pointer and the offset are stored in separate register
classes. The old pattern caused the ISel code for matching addressing
modes to put the base pointer and offset in the wrong register classes,
which required no-trivial code transformations to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 19:57:45 +00:00
Duncan P. N. Exon Smith
7dd408db9a CodeGen: Use MachineInstr& in HashMachineInstr, NFC
Also update HashEndOfMBB to take MachineBasicBlock&.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 19:48:01 +00:00
Duncan P. N. Exon Smith
a26cd9c5ba CodeGen: Use MachineInstr& in AntiDepBreaker API, NFC
Take parameters as MachineInstr& instead of MachineInstr* in
AntiDepBreaker API, since these are required to be non-null.  No
functionality change intended.  Looking toward PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 19:33:37 +00:00
Duncan P. N. Exon Smith
d7b3cd7a4e CodeGen: Assert valid MI in AntiDepBreaker::UpdateDbgValue
This already assumes a valid MI, since it dereferences the MI in an
assertion before checking for null.  At an explicit assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 19:23:34 +00:00
Duncan P. N. Exon Smith
666629273f AArch64: Use MachineInstr& in guaranteesZeroRegInBlock(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 19:12:54 +00:00