155961 Commits

Author SHA1 Message Date
NAKAMURA Takumi
d8ff2f49ce Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 13:31:28 +00:00
Dylan McKay
cfa7d5f70f [AVR] Update to current LLVM API
r315410 broke a number of things in the AVR backend, which are now
fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316076 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 12:35:15 +00:00
Michael Zuckerman
a631f93f8a [AVX512][AVX2]Cost calculation for interleave load/store patterns {v8i8,v16i8,v32i8,v64i8}
This patch adds accurate instructions cost.
The formula presents two cases(stride 3 and stride 4) and calculates the cost according to the VF and stride.

Reviewers:
1. delena
2. Farhana
3. zvi
4. dorit
5. Ayal

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

Change-Id: If4cfbd4ac0e63694e8144cb78c7fa34850647ff7

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 11:41:55 +00:00
Hiroshi Inoue
cbd850f350 [PowerPC] Use helper functions to check sign-/zero-extended value
Helper functions to identify sign- and zero-extending machine instruction is introduced in rL315888.
This patch makes PPCInstrInfo::optimizeCompareInstr use the helper functions. It simplifies the code and also makes possible more optimizations since the helper can do more analysis than the original check code; I observed about 5000 more compare instructions are eliminated while building LLVM.

Also, this patch fixes a bug in helpers on ANDIo instruction handling due to the order of checks. This bug causes a failure in an existing test case for optimizeCompareInstr.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 10:31:19 +00:00
Nikolai Bozhenov
42759c20ed Improve lookThroughCast function.
Summary:
When we have the following case:

  %cond = cmp iN %x, CmpConst
  %tr = trunc iN %x to iK
  %narrowsel = select i1 %cond, iK %t, iK C

We could possibly match only min/max pattern after looking through cast.
So it is more profitable if widened C constant will be equal CmpConst.
That is why just set widened C constant equal to CmpConst, because there
is a further check in this function that trunc CmpConst == C.

Also description for lookTroughCast function was added.

Reviewers: spatel

Subscribers: llvm-commits

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

Patch by: Artur Gainullin <artur.gainullin@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 09:28:09 +00:00
Michael Zuckerman
788af5a19b Fixing bug issue https://bugs.llvm.org/show_bug.cgi?id=34978
Change-Id: I7f13d5bcb181be2860377df7b40e1579a8ad4add

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316067 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 08:04:31 +00:00
Serguei Katkov
eb8a5a38be Fix the incorrect detection of ICONV_LIBRARY_PATH
This is introduced in rL308711.
Check for c library is incorrect here just because libc will be found always
and it does not mean that iconv is presented.

Thank to Andrew Krasny for narrowing down the root cause.

Reviewers: ecbeckmann
Reviewed By: ecbeckmann
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D38875

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 06:26:39 +00:00
Justin Bogner
f50103299d update_mir_test_checks: Support '-' in function names
Some AArch64 and AMDGPU tests have functions with hyphens in the names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 05:52:56 +00:00
Justin Bogner
4f42787ca5 update_mir_test_checks: Fix a typo I made while preparing for commit
I accidentally added an extra arg here, so this didn't work at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 05:39:22 +00:00
Vlad Tsyrklevich
61b2faea7e Statically link llvm-cfi-verify's libraries.
Summary:
llvm-cfi-verify (D38379) introduced a potential build failure when compiling with `-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON`. Specific versions of cmake seem to treat the `add_subdirectory()` rule differently. It seems as if old versions of cmake BFS these rules, adding them to the fringe for expansion later. Newer versions of cmake seem to immediately execute CMakeFiles that are present in this subdirectory.

If the subdirectory is expanded through the fringe, the globbing resultant from `llvm_add_implicit_projects()` from `cmake/modules/AddLLVM.cmake:1012` means that `tools/llvm-shlib/CMakeFile.txt` gets executed before `tools/llvm-cfi-verify/lib/CMakeFile.txt`. As the latter CMakeFile adds a new library, this expansion order means that the library files required the unit tests in `unittests/tools/llvm-cfi-verify/` are not present in the dynamic library. This causes unit tests to fail as the required functions can't be found.

This change now ensures that the libraries created by `llvm-cfi-verify` are statically linked into the unit tests. As `tools/llvm-cfi-verify/lib` no longer adds anything to `llvm-shlib`, there should be no concern about the order-of-compilation.

Reviewers: skatkov, pcc

Reviewed By: skatkov, pcc

Subscribers: llvm-commits, kcc, pcc, aheejin, vlad.tsyrklevich, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 04:27:53 +00:00
Justin Bogner
ae96b7ff9f Add a utility to update MIR checks, similar to update_llc_test_checks
This adds update_mir_test_checks, which updates the check lines in mir
tests. This can only update tests that start and end with .mir
currently (ie, -run-pass) but it should be sufficient for updating at
least some of the GlobalISel tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 02:20:31 +00:00
Jatin Bhateja
b8354dd5d8 [ScalarEvolution] Handling for ICmp occuring in the evolution chain.
Summary:
 If a compare instruction is same or inverse of the compare in the
 branch of the loop latch, then return a constant evolution node.
 Currently scope of evaluation is limited to SCEV computation for
 PHI nodes.

 This shall facilitate computations of loop exit counts in cases
 where compare appears in the evolution chain of induction variables.

 Will fix PR 34538
Reviewers: sanjoy, hfinkel, junryoungju

Reviewed By: junryoungju

Subscribers: javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316054 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 01:36:16 +00:00
Adrian Prantl
2b48886830 Verifier: Ignore CUs pulled in by ODR-uniqued types.
When more than one Module is imported into the same context, such as during
an LTO build before linking the modules, ODR type uniquing may cause types
to point to a different CU. This check does not make sense in this case.

This fixes the error reported in PR34944.

https://bugs.llvm.org/show_bug.cgi?id=34944
rdar://problem/34940685

This reapplies a cleaner implementation of r316049.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316052 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 01:11:01 +00:00
Adrian Prantl
fd8ae0e010 Revert "Verifier: Ignore CUs pulled in by ODR-uniqued types."
This reverts commit r316049.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 00:54:31 +00:00
Adrian Prantl
0d976496a0 Verifier: Ignore CUs pulled in by ODR-uniqued types.
When more than one Module is imported into the same context, such as during
an LTO build before linking the modules, ODR type uniquing may cause types
to point to a different CU. This check does not make sense in this case.

This fixes the error reported in PR34944.

https://bugs.llvm.org/show_bug.cgi?id=34944
rdar://problem/34940685

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316049 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 00:49:31 +00:00
Daniel Sanders
55cde5f3de [aarch64][globalisel] Register banks and classes should have distinct names.
Otherwise they are ambiguous in MIR.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 00:12:43 +00:00
Michael Zolotukhin
082d7c4746 [GlobalDCE] Use DenseMap instead of unordered_multimap for GVDependencies.
Summary:
std::unordered_multimap happens to be very slow when the number of elements
grows large. On one of our internal applications we observed a 17x compile time
improvement from changing it to DenseMap.

Reviewers: mehdi_amini, serge-sans-paille, davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316045 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 23:47:06 +00:00
Peter Collingbourne
1eb5c71a5b lit: Improve %: normalization.
The new scheme should match the normalization of embedded paths in
linkrepro tar files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316044 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 23:46:34 +00:00
Wei Ding
607acf30af AMDGPU : Fix an error for the llvm.cttz implementation.
Differential Revision: http://reviews.llvm.org/D39014

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316037 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:49:52 +00:00
Matthias Braun
37790cc1f7 AArch64: Enable AES instruction fusion on Cyclone.
Note that cyclone itself doesn't fuse, but newer apple chips do and we
are using cyclone as the default when targeting apple OSes.

The current code also does not capture all fusion patterns of apple CPUs
yet; I am still looking for ways to refactor the code nicely to extend
it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316036 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:46:15 +00:00
Tim Northover
2f17a1b1cc AArch64: account for possible frame index operand in compares.
If the address of a local is used in a comparison, AArch64 can fold the
address-calculation into the comparison via "adds". Unfortunately, a couple of
places (both hit in this one test) are not ready to deal with that yet and just
assume the first source operand is a register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:43:52 +00:00
Eugene Zelenko
1c51faba7a [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316034 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:27:42 +00:00
Simon Pilgrim
ae2eae7ec5 [X86][SSE] Tests packuswb/truncation codegen from PR34773
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:14:53 +00:00
Jessica Paquette
6c9a284ff3 [MachineOutliner][NFC] Clean up prune logic a bit
Move the prune logic in pruneOverlaps to a new function, prune. This lets us
reuse the prune functionality. Makes the code a bit more readable. It'll also
make it easier to emit remarks/debug statements for pruned functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:11:58 +00:00
Vassil Vassilev
33287ae950 Revert "[cmake] Use find_package to discover zlib"
We are investigating what went wrong.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:51:25 +00:00
Jessica Paquette
b5459573e1 Fix typo in checkTwoLevelHintsCommand
BigSize had a copy/paste typo in it. This fixes that.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:43:33 +00:00
Vassil Vassilev
1c1c256fbc [cmake] Use find_package to discover zlib
This allows us to use standard cmake utilities to point to non-system zlib
locations.

Patch by Oksana Shadura and me (D39002).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316025 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:32:27 +00:00
Konstantin Zhuravlyov
cecf102e0c AMDGPU: Start generating metadata for MaxFlatWorkGroupSize
Differential Revision: https://reviews.llvm.org/D38958


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316024 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:03:21 +00:00
Jessica Paquette
3b848cff06 [MachineOutliner][NFC] Move decrement logic to OutlinedFunction
This commit moves the decrement logic for outlined functions into the class,
and makes OccurrenceCount private. It can now be accessed via
getOccurrenceCount().

This makes it more difficult to accidentally introduce bugs by incorrectly
decrementing the occurrence count on OutlinedFunctions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316020 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 19:03:23 +00:00
Jessica Paquette
6f0af489ee [MachineOutliner][NFC] Move end index calculation into Candidate
Cleanup to Candidate that moves all end index calculations into
Candidate.endIdx(). For the sake of consistency, StartIdx and Len are now
private members, and can be accessed with length() and startIdx() respectively.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 18:43:15 +00:00
Vitaly Buka
a1dafe0b86 Fix signed overflow detected by ubsan
This overflow does not affect algorithm, so just suppress it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 18:33:15 +00:00
Simon Pilgrim
f87901fc84 [DAGCombine] Add SCALAR_TO_VECTOR undef handling to simplifyShuffleMask.
This allows us to simplify later visitVECTOR_SHUFFLE optimizations such as combineShuffleOfScalars.

Noticed whilst working on D38696

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 18:14:48 +00:00
Matt Morehouse
d0a82302e3 [llvm-special-case-list-fuzzer] Add fuzz target.
Summary: Create a fuzzer for sanitizer blacklists.

Patch by: hctim

Reviewers: morehouse

Reviewed By: morehouse

Subscribers: llvm-commits, mgorny, kcc

Differential Revision: https://review.llvm.org/D38981

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 17:43:34 +00:00
Sanjay Patel
eb90eda86f [ARM, AArch64] adjust tests trying to maintain their objective; NFC
A smarter compiler will see that these might be better without a jump table
if we're just using the constant values of the switch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 16:54:56 +00:00
Sanjay Patel
0d8a696ceb [SimplifyCFG] add test for part of PR34471 (switch squashing); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 15:56:42 +00:00
Sanjay Patel
1faba647f4 [SimplifyCFG] update test to use auto-generated FileCheck asserts; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316006 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 15:50:47 +00:00
Sam McCall
e1c43432f0 Fix pthread_[gs]etname_np detection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 15:32:17 +00:00
Gadi Haber
bb8aaf8316 [X86][Broadwell] Added the broadwell cpu to the scheduling regression tests.<NFC>
NFC.
Added the Broadwell cpu and the BROADWELL prefix to all the scheduling regression tests, as part of prepartion for a larger commit of adding all Broadwell scheduiling.

Reviewers: RKSimon, zvi, aaboud
Differential Revision: https://reviews.llvm.org/D38994

Change-Id: I54bc9065168844c107b1729fcdc1d311ce3ea0a9

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315998 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 13:45:39 +00:00
Nikolai Bozhenov
12367d9435 Improve clamp recognition in ValueTracking.
Summary:
ValueTracking was recognizing not all variations of clamp. Swapping of
true value and false value of select was added to fix this problem. This
change breaks the canonical form of cmp inside the matchMinMax function,
that is why additional checks for compare predicates is needed. Added
corresponding test cases.

Reviewers: spatel

Subscribers: llvm-commits

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

Patch by: Artur Gainullin <artur.gainullin@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 11:50:48 +00:00
Yichao Yu
e60981b454 Fix implicit null check with negative offset
Summary:
It seems that negative offset was accidentally allowed in D17967.
AFAICT small negative offset should be valid (always raise segfault) on all archs that I'm aware of (especially x86, which is the only one with this optimization enabled) and such case can be useful when loading hiden metadata from an object.

However, like the positive side, it should only be done within a certain limit.
For now, use the same limit on the positive side for the negative side.
A separate option can be added if needs appear.

Reviewers: mcrosier, skatkov

Reviewed By: skatkov

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 11:47:36 +00:00
Yichao Yu
f500b96fb9 Fix FaultMaps crash when the out streamer is reused
Summary:
Make sure the map is cleared before processing a new module. Similar to what is done on `StackMaps`.

This issue is similar to D38588, though this time for FaultMaps (on x86) rather than ARM/AArch64. Other than possible mixing of information between modules, the crash is caused by the pointers values in the map that was allocated by the bump pointer allocator that is unwinded when emitting the next file. This issue has been around since 3.8.

This issue is likely much harder to write a test for since AFAICT it requires emitting something much more compilcated (and possibly real code) instead of just some random bytes.

Reviewers: skatkov, sanjoy

Reviewed By: skatkov, sanjoy

Subscribers: sanjoy, aemerson, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 11:44:34 +00:00
Gadi Haber
0782a95249 [X86][Skylake] fixed/updated regression test mmx-schedule.ll which failed after r315978.
Change-Id: I60cd7e03ea6c3d9a3dc661a882458e83feca66e3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 10:00:08 +00:00
Andrew V. Tischenko
51e3e44f33 More tests with x86 prefixes which work after rL315899 commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315983 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 08:49:47 +00:00
Gadi Haber
9e68191ef6 [X86][SKL] Updated scheduling information for the SkylakeClient target
Updated the scheduling information for the SkylakeClient target with the following changes:

1. regrouped the instructions after adding load and store latencies.
2. regrouped the instructions after adding identified missing ports in several groups.
The changes were made after revisiting the latencies impact of all the load and store uOps.

Reviewers: zvi, RKSimon, craig.topper
Differential Revision: https://reviews.llvm.org/D38727

Change-Id: I778a308cc11e490e8fa5e27e2047412a1dca029f

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315978 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 06:47:04 +00:00
Max Kazantsev
c596921f1a Remove a test after revert of rL315440
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 06:43:31 +00:00
Max Kazantsev
dd449b37bc [NFC] Add test from bug 34937
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315976 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 06:37:58 +00:00
Philip Reames
812e46fe54 Revert 315440 on behalf of mkazantsev
This patch reverts rL315440 because of the bug described at
https://bugs.llvm.org/show_bug.cgi?id=34937

The fix for the bug is on review as D38944, but not yet ready.  Given this is a regression reverting until a fix is ready is called for.

Max would have done the revert himself, but is having trouble doing a build of fresh LLVM for some reason.  I did the build and test to ensure the revert worked as expected on his behalf.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315974 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 06:21:07 +00:00
Daniel Sanders
b22da5a4dc [globalisel][tablegen] Add a GIM_CheckIsSameOperand test where OtherInsnID and OtherOpIdx differ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 05:24:44 +00:00
Craig Topper
f83df3de21 [X86] Add masked palignr tests to vector-shuffle-masked.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315971 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 04:17:56 +00:00
Craig Topper
971d51cd6f [X86] Add AVX512BW to the vector-shuffle-masked test to prepare for an upcoming commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 04:17:55 +00:00