135422 Commits

Author SHA1 Message Date
Justin Lebar
dbf6ad39ae [LSV] Don't assume that loads/stores appear in address order in the BB.
Summary:
getVectorizablePrefix previously didn't work properly in the face of
aliasing loads/stores.  It unwittingly assumed that the loads/stores
appeared in the BB in address order.  If they didn't, it would do the
wrong thing.

Reviewers: asbirlea, tstellarAMD

Subscribers: arsenm, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 00:55:12 +00:00
Yunzhong Gao
30f6cf738e Fixing a few places in this doc which look like obvious typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 00:40:54 +00:00
Matthias Braun
e3d8cd87b2 Revert "RegScavenging: Add scavengeRegisterBackwards()"
Reverting this commit for now as it seems to be causing failures on
test-suite tests on the clang-ppc64le-linux-lnt bot.

This reverts commit r276044.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 00:21:32 +00:00
Kyle Butt
3d7281b8c9 Codegen: Tail Duplication: Only duplicate into layout pred if it is a CFG Pred.
Add a check that the layout predecessor of a block is an actual CFG
predecssor of the block as well. No current code fails this check, but
upcoming patches can trigger this, and it makes sense to separate it
out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 00:01:51 +00:00
Sean Silva
98e46ef19c Revert r275883 and r275891. They seem to cause PR28608.
Revert "[LoopSimplify] Update LCSSA after separating nested loops."

This reverts commit r275891.

Revert "[LCSSA] Post-process PHI-nodes created by SSAUpdate when constructing LCSSA form."

This reverts commit r275883.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:54:29 +00:00
Sean Silva
d8c90ea6b8 [PM] Port LoopUnroll.
We just set PreserveLCSSA to always true since we don't have an
analogous method `mustPreserveAnalysisID(LCSSA)`.

Also port LoopInfo verifier pass to test LoopUnrollPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:54:23 +00:00
Kyle Butt
ebd8d9a1ff Codegen: Factor out canTailDuplicate
canTailDuplicate accepts two blocks and returns true if the first can be
duplicated into the second successfully. Use this function to
encapsulate the heuristic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:54:21 +00:00
Aaron Ballman
9871423412 This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11925/steps/docs-llvm-html/logs/stdio). Setting the code highlighting to none instead of llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:50:11 +00:00
Justin Lebar
00d973e3f3 [ADT] Warn on unused results from ArrayRef and StringRef functions that read like they might mutate.
Summary:
Functions like "slice" and "drop_front" sound like they might mutate the
underlying object, but they don't.  Warning on unused results would have
saved me an hour yesterday, and I'm sure I'm not the only one.

LLVM and Clang are clean wrt this warning after D22540.

Reviewers: majnemer

Subscribers: sanjoy, chandlerc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:19:25 +00:00
Justin Lebar
7d84cf37c7 Get rid of call to StringRef::substr that's never used.
Summary: substr doesn't modify the string, so this line has no effect.

Reviewers: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:19:22 +00:00
Justin Lebar
85ee7e9487 [LSV] Insert stores at the right point.
Summary:
Previously, the insertion point for stores was the last instruction in
Chain *before calling getVectorizablePrefixEndIdx*.  Thus if
getVectorizablePrefixEndIdx didn't return Chain.size(), we still would
insert at the last instruction in Chain.

This patch changes our internal API a bit in an attempt to make it less
prone to this sort of error.  As a result, we end up recalculating the
Chain's boundary instructions, but I think worrying about the speed hit
of this is a premature optimization right now.

Reviewers: asbirlea, tstellarAMD

Subscribers: mzolotukhin, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:19:20 +00:00
Justin Lebar
abcf9144a5 [LSV] Use make_range, and reformat a DEBUG message. NFC
Summary:
The DEBUG message was hard to read because two Values were being printed
on the same line with only the delimiter "aliases".  This change makes
us print each Value on its own line.

Reviewers: asbirlea

Subscribers: llvm-commits, arsenm, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:19:18 +00:00
Justin Lebar
7e9ef3abf7 [LSV] Nix two global (ish) variables in the LoadStoreVectorizer. NFC
Reviewers: asbirlea

Subscribers: mzolotukhin, llvm-commits, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:19:16 +00:00
Justin Lebar
b2c31893e0 [LSV] Add detail to correct-order.ll test.
Summary:
This helps keep us honest -- there were a number of ways we could screw
up and still have passed this test.

Reviewers: asbirlea

Subscribers: llvm-commits, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:18:59 +00:00
Kostya Serebryany
1f0a7ed0f3 [libFuzzer] extend the messages printed by afl_driver
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:18:28 +00:00
Matt Arsenault
63be72069d AMDGPU: Change fdiv lowering based on !fpmath metadata
If 2.5 ulp is acceptable, denormals are not required, and
isn't a reciprocal which will already be handled, replace
with a faster fdiv.

Simplify the lowering tests by using per function
subtarget features.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:16:53 +00:00
Daniel Berlin
e37b4fdf43 Fix unused variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 23:08:08 +00:00
Paul Robinson
9ab63168a0 Make GVN Hoisting obey optnone/bisect.
Differential Revision: http://reviews.llvm.org/D22545


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:57:14 +00:00
Daniel Berlin
aee8a35ce9 Make MemorySSA::dominates/locallydominates constant time
Summary: Make MemorySSA::dominates/locallydominates constant time

Reviewers: george.burgess.iv, gberry

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:49:43 +00:00
Chandler Carruth
df36f1ccea Add AIX support to Path.inc, Host.h, and CMake.
Patch by Andrew Paprocki!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:46:39 +00:00
Matthias Braun
c5e14e0478 RegScavenging: Add scavengeRegisterBackwards()
This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.

This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276044 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:37:09 +00:00
Matthias Braun
e07c066cdd RegisterScavenger: Introduce backward() mode.
This adds two pieces:
- RegisterScavenger:::enterBasicBlockEnd() which behaves similar to
  enterBasicBlock() but starts tracking at the end of the basic block.
- A RegisterScavenger::backward() method. It is subtly different
  from the existing unprocess() method which only considers uses with
  the kill flag set: If a value is dead at the end of a basic block with
  a last use inside the basic block, unprocess() will fail to mark it as
  live. However we cannot change/fix this behaviour because unprocess()
  needs to perform the exact reverse operation of forward().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:37:02 +00:00
Sanjay Patel
6f62be2e5b regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:32:15 +00:00
Evandro Menezes
bc05d15136 [AArch64] Properly validate the reciprocal estimation.
Add check for legal data types when expanding into a Newton series.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:31:11 +00:00
Sanjay Patel
11faea381f [InstCombine] fold add(zext(xor X, C), C) --> sext X when C is INT_MIN in the source type
The pattern may look more obviously like a sext if written as:

  define i32 @g(i16 %x) {
    %zext = zext i16 %x to i32
    %xor = xor i32 %zext, 32768
    %add = add i32 %xor, -32768
    ret i32 %add
  }

We already have that fold in visitAdd().

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276035 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 22:09:34 +00:00
George Burgess IV
fed9fd5a7a Attempt to appease MSVC buildbots.
Broken by r276026.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 21:35:47 +00:00
Davide Italiano
f36cce1574 [AMDGPU] Remove spurious line (should've been removed in r276029).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 21:16:30 +00:00
Davide Italiano
5012465830 [AMDGPU] Remove dead code.
LGTM'd by Matt Arsenault.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 21:10:49 +00:00
George Burgess IV
bfc580351a [CFLAA] Make a test tell the truth. NFC.
Dishonesty noted by Jia Chen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:56:41 +00:00
George Burgess IV
1caa063db8 [CFLAA] Add some interproc. analysis to CFLAnders.
This patch adds function summary support to CFLAnders. It also comes
with a lot of tests! Woohoo!

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:47:15 +00:00
Kevin Enderby
fa9076153b Next step along the way to getting good error messages for bad archives.
This step builds on Lang Hames work to change Archive::child_iterator
for better interoperation with Error/Expected.  Building on that it is now
possible to return an error message when the size field of an archive
contains non-decimal characters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:47:07 +00:00
Sanjay Patel
5f33cbe2bf add even more missing tests for simplifySelectBitTest()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:47:00 +00:00
George Burgess IV
058f700b77 [CFLAA] Teach CFLAnders to distinguish reads from writes.
This patch adds more specific edges to CFLAndersAliasAnalysis. The goal
of these edges is to give us more information about *how* two values
that MayAlias alias. With this, we can now tell cases like

a = b; // ergo, a may alias b

apart from

a = c;
b = c;

// so, a may alias b, but only because they were both assigned to c.

...And others.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:38:21 +00:00
Aaron Ballman
de4fbfe935 This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11921/steps/docs-llvm-html/logs/stdio). Setting the code highlighting to none instead of llvm to hopefully get the bot stumbling back towards green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:20:03 +00:00
Rafael Espindola
75cca7a098 Use posix_fallocate instead of ftruncate.
This makes sure that space is actually available. With this change
running lld on a full file system causes it to exit with

failed to open foo: No space left on device

instead of crashing with a sigbus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:19:56 +00:00
Vedant Kumar
ea47fc5fc9 [tsan] Don't instrument __llvm_gcov_global_state_pred or __llvm_gcda*
r274801 did not go far enough to allow gcov+tsan to cooperate. With this
commit it's possible to run the following code without false positives:

  std::thread T1(fib), T2(fib);
  T1.join(); T2.join();

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:16:08 +00:00
Tim Northover
b2e69d912a ARM: move feature for Thumb2 pkhbt/pkhtb onto architectures.
There's not much functional change, but it really is an architectural feature
(on v6T2, v7A, v7R and v7EM) rather than something each CPU implements
individually.

The main functional change is the default behaviour you get when specifying
only "-triple".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 19:49:13 +00:00
Ahmed Bougacha
98d2ab3a50 [GlobalISel] Mark newly-created gvregs as having a bank.
Also verify that we never try to set the size of a vreg associated
to a register class.

Report an error when we encounter that in MIR. Fix a testcase that
hit that error and had a size for no reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 19:48:36 +00:00
Ahmed Bougacha
e627715b1b [GlobalISel] Simplify more RegClassOrRegBank is+get. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 19:47:06 +00:00
David Majnemer
baf88b3b1a [FunctionAttrs] Correct the safety analysis for inference of 'returned'
We skipped over ReturnInsts which didn't return an argument which would
lead us to incorrectly conclude that an argument returned by another
ReturnInst was 'returned'.

This reverts commit r275756.

This fixes PR28610.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 18:50:26 +00:00
Davide Italiano
bd7732211f [SCCP] Improve assert messages. NFCI.
I've been hitting those already while working on SCCP and I think
it's be useful to provide a more explanatory diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 18:31:07 +00:00
Kostya Serebryany
3487192114 [libFuzzer] properly intercept memmem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 18:29:06 +00:00
Chad Rosier
fbab381e3c [DSE] Add additional debug output. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 18:11:11 +00:00
David Majnemer
3c8951d73e Add a testcase for r275581
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:52:41 +00:00
David Majnemer
a05b1c3601 [RegionInfo] Some cleanups
- Use unique_ptr instead of managing a container of new'd pointers.
- Use range based for loops.

No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:50:30 +00:00
David Majnemer
2666c82a8d [RegionPass] Some minor cleanups
No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:50:27 +00:00
David Majnemer
55bd48f157 [LoopPass] Some minor cleanups
No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:50:24 +00:00
Aaron Ballman
ce04fe5f8e This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11920/steps/docs-llvm-html/logs/stdio), but I cannot see anything immediately wrong with it and cannot reproduce the diagnostic locally. Setting the code highlighting to none instead of nasm to hopefully get the bot stumbling back towards green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:46:55 +00:00
Sanjay Patel
d9f3c5ebc0 add tests related to PR28466
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:07:35 +00:00
Simon Pilgrim
259dd35565 [X86][AVX512] Added AVX512 subvector broadcast tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 17:04:28 +00:00