137028 Commits

Author SHA1 Message Date
David Majnemer
9c509583cc Don't passively concatenate MDNodes
I have audited all the callers of concatenate and none require duplicate
entries to service concatenation.
These duplicates serve no purpose but to needlessly embiggen the IR.

N.B. Layering getMostGenericAliasScope on top of concatenate makes it
O(nlogn + mlogm) instead of O(n*m).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:48:34 +00:00
Krzysztof Parzyszek
d179884eca [Hexagon] Standardize next batch of pseudo instructions
ALIGNA          PS_aligna
ALLOCA          PS_alloca
TFR_FI          PS_fi
TFR_FIA         PS_fia
TFR_PdFalse     PS_false
TFR_PdTrue      PS_true
VMULW           PS_vmulw
VMULW_ACC       PS_vmulw_acc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:08:40 +00:00
Gor Nishanov
6795b93241 [Coroutines] Part 7: Split coroutine into subfunctions
Summary:
This patch adds simple coroutine splitting logic to CoroSplit pass.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
...
7. Split coroutine into subfunctions <= we are here
8. Coroutine Frame Building algorithm
9. Handle coroutine with unwinds
10+. The rest of the logic

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:04:14 +00:00
Sanjay Patel
3127862b89 [InstCombine] add helper functions for foldICmpWithConstant; NFCI
Besides breaking up a 700 line function to improve readability,
this sinks the 'FIXME: ConstantInt' check into each helper. So 
now we can independently break that restriction within any of the
helper functions.

As much as possible, the code was only {cut/paste/clang-format}'ed 
to minimize risk (no functional changes intended), so several more
readability improvements are still possible. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 17:54:36 +00:00
Kostya Serebryany
b4d6119096 [libFuzzer] refactoring around PCMap, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 17:37:13 +00:00
Simon Dardis
d382882e66 [mips] Enforce compact branch restrictions
Check both operands for use of the $zero register which cannot be used with
a compact branch instruction.

Reviewers: dsanders, vkalintris

Differential Review: https://reviews.llvm.org/D23547


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 17:16:11 +00:00
Krzysztof Parzyszek
84668a064a [Hexagon] Clean up some miscellaneous V60 intrinsics a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 17:14:44 +00:00
Wolfgang Pieb
659db1fca2 When the inline spiller rematerializes an instruction, take the debug location from the instruction
that immediately follows the rematerialization point.

Patch by Andrea DiBiagio.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 17:12:50 +00:00
Wei Mi
4bec1232a1 Remove a stale comment from the test, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 16:57:15 +00:00
Vitaly Buka
fc819213c1 [Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag
Summary: PR27453

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 16:24:10 +00:00
Sanjay Patel
0084b4209f [InstCombine] use m_APInt in foldICmpWithConstant; NFCI
There's some formatting and pointer deref ugliness here that I intend to fix in
subsequent patches. The overall goal is to refactor the obnoxiously long switch
and incrementally remove the restriction to scalar types (allow folds for vector
splats). This patch introduces the use of m_APInt which means the RHSV reference
is now a pointer (and may have matched a vector splat), but the check of 'RHS' 
remains, so vector folds are disallowed and no functional change is intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 16:08:11 +00:00
Krzysztof Parzyszek
0ebd4a8ba5 [Hexagon] Standardize vector predicate load/store pseudo instructions
- Remove unused instructions: LDriq_pred_vec_V6, STriq_pred_vec_V6, and
  the 128B counterparts.
- Rename:
    LDriq_pred_V6         PS_vloadrq_ai
    LDriq_pred_V6_128B    PS_vloadrq_ai_128B
    STriq_pred_V6         PS_vstorerq_ai
    STriq_pred_V6_128B    PS_vstorerq_ai_128B


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 15:43:54 +00:00
Ahmed Bougacha
cefc0d378a [AArch64][GlobalISel] Select G_MUL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:37:46 +00:00
Ahmed Bougacha
c57071eb5c [GlobalISel] Fix G_MUL comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:37:43 +00:00
Ahmed Bougacha
a791148e4d [AArch64][GlobalISel] Factor out unsupported binop check. NFC.
We're going to need it for G_MUL, and, if other targets end up using
something similar, we can easily put it in the generic selector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:37:40 +00:00
David Callahan
7b9ac36e89 [ADCE] Modify data structures to support removing control flow
Summary:
This is part of a serious of patches to evolve ADCE.cpp to support
removing of unnecessary control flow.

This patch changes the data structures to hold liveness information to
support the additional information we will eventually need. In
particular we now have a notion of basic blocks being live because
they contain a live operations. This will eventually feed into control
dependence analysis of which branches are live. We cater to getting
from instructions to associated block information and from blocks to
information about their terminators.

This patch also changes the structure of the main loop of the
algorithm so that it alternates propagating liveness between
instructions and usign control dependence information to mark branches
live.

We force all terminators live for now until we add code to handlinge
removing control flow in a later patch.

No changes to effective behavior with this patch

Previous patches:

D23065 [ADCE] Refactor anticipating new functionality (NFC)
D23102 [ADCE] Refactoring for new functionality (NFC)

Reviewers: nadav, majnemer, mehdi_amini

Subscribers: freik, twoh, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:31:51 +00:00
Brendon Cahoon
89aeadc84e [Pipeliner] Fix an asssert due to invalid Phi in the epilog
The pipeliner was generating an invalid Phi name for an operand
in the epilog block, which caused an assert in the live variable
analysis pass. The fix is to the code that generates new Phis
in the epilog block. In this case, there is an existing Phi that
needs to be reused rather than creating a new Phi instruction.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:29:24 +00:00
Ahmed Bougacha
e2e7ab2c1d [AArch64][GlobalISel] Select (variable) shifts.
For now, no support for immediates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:02:47 +00:00
Ahmed Bougacha
9e3f48dcc7 [AArch64][GlobalISel] Robustize select tests. NFC.
Using the same register means nothing was checking for operand order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:02:44 +00:00
Ahmed Bougacha
b92cbd8f41 [AArch64][GlobalISel] Select p0 G_FRAME_INDEX.
And mark it as legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:02:42 +00:00
Ahmed Bougacha
9b17aaaba8 [GlobalISel] Mention pointers in LowLevelType.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 14:02:36 +00:00
Pierre Gousseau
349838b560 [x86] Refactor a PowerPC specific ctlz/srl transformation (NFC).
Following the discussion on D22038, this refactors a PowerPC specific setcc -> srl(ctlz) transformation so it can be used by other targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 13:53:53 +00:00
Simon Pilgrim
8cd8a7e585 [X86][AVX] Fixed typo in zero element insertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 13:33:33 +00:00
Ron Lieberman
12dc55cb60 [Hexagon] Improve test to check for @PCREL, only run llc, not opt -> llc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 13:10:09 +00:00
Sagar Thakur
ecd478b7fc [MemorySanitizer] [MIPS] Changed memory mapping to support pie executable.
Reviewed by eugenis
Differential: D22994


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 12:55:38 +00:00
Simon Pilgrim
066b7e86f7 [X86][SSE] Add support for combining v2f64 target shuffles to VZEXT_MOVL byte rotations
The combine was only matching v2i64 as it assumed lowering to MOVQ - but we have v2f64 patterns that match in a similar fashion


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 12:52:06 +00:00
Simon Pilgrim
fcc2de8d54 [X86][AVX512BW] Updated tests to demonstrate AVX512BW's inability to vectorize v64i8 shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 11:05:47 +00:00
Prakhar Bahuguna
7461b8a6d7 Correct the upper bound for a CBZ/CBNZ branch target.
Summary:
Fix for the upper bound check that was causing a build failure.

Reviewers: olista01, rengolin, t.p.northover

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 10:41:56 +00:00
Prakhar Bahuguna
6e45500a57 [Thumb] Validate branch target for CBZ/CBNZ instructions.
Summary:
The assembler currently does not check the branch target for CBZ/CBNZ
instructions, which only permit branching forwards with a positive offset. This
adds validation for the branch target to ensure negative PC-relative offsets are
not encoded into the instruction, whether specified as a literal or as an
assembler symbol.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 10:41:52 +00:00
Simon Pilgrim
a14491aa36 [X86][SSE] Add support for combining target shuffles to PALIGNR byte rotations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 10:03:23 +00:00
Job Noorman
9d30d1b1e5 [AVR] Fix compile errors
Differential Revision: https://reviews.llvm.org/D23450


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 08:41:35 +00:00
Guy Blank
6f26a8e23e [X86] Add xgetbv/xsetbv intrinsics to non-windows platforms
Differential Revision: https://reviews.llvm.org/D21958

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 06:41:00 +00:00
David Majnemer
0bf24e0333 [InstSimplify] Fold gep (gep V, C), (xor V, -1) to C-1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 06:13:46 +00:00
Mehdi Amini
2a393a5758 FunctionImport: missed one occurence of ImportListForModule to rename (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 05:49:12 +00:00
Mehdi Amini
22277af930 FunctionImport: rename ImportsForModule to ImportList for consistency (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 05:47:12 +00:00
Mehdi Amini
055f556eae [LTO] Simplify APIs and constify (NFC)
Summary:
Multiple APIs were taking a StringMap for the ImportLists containing
the entries for for all the modules while operating on a single entry
for the current module. Instead we can pass the desired ModuleImport
directly. Also some of the APIs were not const, I believe just to be
able to use operator[] on the StringMap.

Reviewers: tejohnson

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 05:46:05 +00:00
Sanjay Patel
8454221022 [InstCombine] add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 00:48:38 +00:00
Mehdi Amini
cbcae43747 [LTO] Rename variables with meaningul names, i.e. more than one character (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 00:44:46 +00:00
Sanjay Patel
8e443cd8d1 [InstCombine] add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 00:27:12 +00:00
Reid Kleckner
ca77873b47 [AMDGPU] Give enum an explicit 64-bit type to fix MSVC 2013 failures
Recall that MSVC always gives enums the type 'int', nothing else.  MSVC
2015 does not appear to have this problem anymore.

Clang-cl -Wmicrosoft-enum-value flags this, FWIW, so now I have a true
positive for my warning. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 23:54:44 +00:00
Teresa Johnson
3d6b718ec1 [ThinLTO] Fix temp file dumping, enable via llvm-lto and test it
Summary:
Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine
needs to be passed directly as an argument, or a copy saved into a
std::string.

It doesn't seem there are any consumers of this, so I added a new option
to llvm-lto to enable saving of temp files during ThinLTO, and augmented
a test to use it to check post-import but pre-opt bitcode.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 23:24:57 +00:00
Reid Kleckner
d7f4d1124d Don't use %llc_dwarf with -mtriple, they don't combine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:54:26 +00:00
Sanjay Patel
dfacb43d50 [InstCombine] add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:43:52 +00:00
Justin Bogner
d6a48b16f6 Linker: Avoid some ridiculous indentation by using a temporary. NFC
This was indented really awkwardly, and clang-format didn't seem to
know how to do any better. Avoid the issue with a temporary variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:41:42 +00:00
Wolfgang Pieb
5912e9a50d Adding the triple for test comitted with r278703.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:39:39 +00:00
Mike Aizatsky
f514d2f83e [sancov] extracting AArch64 test to a separate file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:30:37 +00:00
Tim Shen
eeadbe0f8f [ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs
Summary: This is similiar to r278752, where I found that the std::iterator<...> base can be normal.

Reviewers: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:07:30 +00:00
Tim Shen
36b7d78473 [ADT] Change PostOrderIterator to use NodeRef. NFC.
Reviewers: dblaikie

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 21:52:54 +00:00
Sanjay Patel
caa310554b [InstCombine] add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 21:47:50 +00:00
Eli Friedman
29e5e147c7 Fix typo in lowering for fp128 ueq.
Regression from r259791.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 21:46:19 +00:00