Commit Graph

147536 Commits

Author SHA1 Message Date
Reid Kleckner
06090406b0 [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
2017-04-12 00:38:00 +00:00
Yi Kong
824c3767b3 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
2017-04-11 22:39:55 +00:00
Matt Arsenault
8c86ad544b 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
2017-04-11 22:29:31 +00:00
Matt Arsenault
56db90276b 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
2017-04-11 22:29:28 +00:00
Matt Arsenault
938bfaf893 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
2017-04-11 22:29:24 +00:00
Matt Arsenault
651ac56097 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
2017-04-11 22:29:19 +00:00
Matt Arsenault
3bca0534ee AMDGPU: Prune unecessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:29:16 +00:00
Evgeniy Stepanov
adabd2ad34 [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
2017-04-11 22:28:13 +00:00
Balaram Makam
7feea4e245 [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
2017-04-11 22:14:10 +00:00
Vedant Kumar
15d522b811 Avoid some string copies, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 22:11:46 +00:00
Andrew Kaylor
b66309b465 Minor updates to floating point intrinsic documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:52:40 +00:00
Zvi Rackover
f14c498699 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
2017-04-11 21:37:02 +00:00
Zvi Rackover
4fb7a1861e [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
2017-04-11 21:16:59 +00:00
Easwaran Raman
9a12eacf3d [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
2017-04-11 21:05:02 +00:00
Anna Thomas
3d57035bd9 [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
2017-04-11 21:02:00 +00:00
Sanjay Patel
530eee5579 [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
2017-04-11 20:54:57 +00:00
Daniel Berlin
e0f5ddbc01 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
2017-04-11 20:06:36 +00:00
Justin Bogner
b86967b006 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
2017-04-11 19:32:41 +00:00
Evandro Menezes
4e34a0eb57 [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
2017-04-11 19:13:11 +00:00
Davide Italiano
d7dec945d0 [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
2017-04-11 19:11:20 +00:00
Andrea Di Biagio
2ef157559b [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
2017-04-11 19:07:30 +00:00
Craig Topper
94a0ddaec9 [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
2017-04-11 18:50:48 +00:00
Craig Topper
a031d73f8b 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
2017-04-11 18:47:58 +00:00
Anna Thomas
c3ff31ab3f [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
2017-04-11 18:31:42 +00:00
Vitaly Buka
f79a56c244 [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
2017-04-11 18:20:05 +00:00
Peter Collingbourne
be0ad757ca 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
2017-04-11 18:12:00 +00:00
Craig Topper
3a60ccfe45 [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
2017-04-11 17:42:40 +00:00
Yaxun Liu
9015ee5fc7 [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
2017-04-11 17:18:13 +00:00
Xinliang David Li
385894b5b5 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
2017-04-11 16:27:20 +00:00
Reid Kleckner
3129c622b3 [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
2017-04-11 16:26:15 +00:00
Sanjay Patel
4efddeefbf 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
2017-04-11 15:57:32 +00:00
Xinliang David Li
c9b31391b3 [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
2017-04-11 15:51:32 +00:00
Serge Guelton
9d54400bba 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
2017-04-11 15:01:18 +00:00
Vassil Vassilev
afa9824a92 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
2017-04-11 14:55:32 +00:00
Jonathan Roelofs
6fb757e574 [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
2017-04-11 14:51:49 +00:00
Sam Parker
8cc8cfefdf [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
2017-04-11 14:42:08 +00:00
Geoff Berry
22bc776233 [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
2017-04-11 14:36:30 +00:00
Nirav Dave
020cbfba48 [SDAG] Factor CandidateMatch check into lambda. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 13:41:19 +00:00
Nirav Dave
da18b45fd0 [SDAG] Factor ChainMerge into helper function NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299938 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 13:41:17 +00:00
Nirav Dave
5074c86cc6 [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
2017-04-11 13:41:16 +00:00
Keno Fischer
1a173576c9 [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
2017-04-11 13:32:11 +00:00
Jan Sjodin
465e205500 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
2017-04-11 11:40:55 +00:00
Diana Picus
0a032476a5 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
2017-04-11 10:52:34 +00:00
Volkan Keles
e49d0dbf86 [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
2017-04-11 10:10:14 +00:00
Diana Picus
1d02724c71 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
2017-04-11 10:07:12 +00:00
Sam Parker
4714fdf595 [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
2017-04-11 08:43:32 +00:00
Serge Guelton
ec124b3a6f 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
2017-04-11 08:36:52 +00:00
Sylvestre Ledru
262869e2bf 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
2017-04-11 08:21:27 +00:00
Craig Topper
cd0241d19a [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
2017-04-11 06:41:55 +00:00
Craig Topper
c2741201b5 [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
2017-04-11 06:32:48 +00:00