OSDN Git Service

android-x86/external-llvm.git
6 years ago[PowerPC] Use helper functions to check sign-/zero-extended value
Hiroshi Inoue [Wed, 18 Oct 2017 10:31:19 +0000 (10:31 +0000)]
[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

6 years agoImprove lookThroughCast function.
Nikolai Bozhenov [Wed, 18 Oct 2017 09:28:09 +0000 (09:28 +0000)]
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

6 years agoFixing bug issue https://bugs.llvm.org/show_bug.cgi?id=34978
Michael Zuckerman [Wed, 18 Oct 2017 08:04:31 +0000 (08:04 +0000)]
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

6 years agoFix the incorrect detection of ICONV_LIBRARY_PATH
Serguei Katkov [Wed, 18 Oct 2017 06:26:39 +0000 (06:26 +0000)]
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

6 years agoupdate_mir_test_checks: Support '-' in function names
Justin Bogner [Wed, 18 Oct 2017 05:52:56 +0000 (05:52 +0000)]
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

6 years agoupdate_mir_test_checks: Fix a typo I made while preparing for commit
Justin Bogner [Wed, 18 Oct 2017 05:39:22 +0000 (05:39 +0000)]
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

6 years agoStatically link llvm-cfi-verify's libraries.
Vlad Tsyrklevich [Wed, 18 Oct 2017 04:27:53 +0000 (04:27 +0000)]
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

6 years agoAdd a utility to update MIR checks, similar to update_llc_test_checks
Justin Bogner [Wed, 18 Oct 2017 02:20:31 +0000 (02:20 +0000)]
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

6 years ago[ScalarEvolution] Handling for ICmp occuring in the evolution chain.
Jatin Bhateja [Wed, 18 Oct 2017 01:36:16 +0000 (01:36 +0000)]
[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

6 years agoVerifier: Ignore CUs pulled in by ODR-uniqued types.
Adrian Prantl [Wed, 18 Oct 2017 01:11:01 +0000 (01:11 +0000)]
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

6 years agoRevert "Verifier: Ignore CUs pulled in by ODR-uniqued types."
Adrian Prantl [Wed, 18 Oct 2017 00:54:31 +0000 (00:54 +0000)]
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

6 years agoVerifier: Ignore CUs pulled in by ODR-uniqued types.
Adrian Prantl [Wed, 18 Oct 2017 00:49:31 +0000 (00:49 +0000)]
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

6 years ago[aarch64][globalisel] Register banks and classes should have distinct names.
Daniel Sanders [Wed, 18 Oct 2017 00:12:43 +0000 (00:12 +0000)]
[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

6 years ago[GlobalDCE] Use DenseMap instead of unordered_multimap for GVDependencies.
Michael Zolotukhin [Tue, 17 Oct 2017 23:47:06 +0000 (23:47 +0000)]
[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

6 years agolit: Improve %: normalization.
Peter Collingbourne [Tue, 17 Oct 2017 23:46:34 +0000 (23:46 +0000)]
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

6 years agoAMDGPU : Fix an error for the llvm.cttz implementation.
Wei Ding [Tue, 17 Oct 2017 21:49:52 +0000 (21:49 +0000)]
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

6 years agoAArch64: Enable AES instruction fusion on Cyclone.
Matthias Braun [Tue, 17 Oct 2017 21:46:15 +0000 (21:46 +0000)]
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

6 years agoAArch64: account for possible frame index operand in compares.
Tim Northover [Tue, 17 Oct 2017 21:43:52 +0000 (21:43 +0000)]
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

6 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Tue, 17 Oct 2017 21:27:42 +0000 (21:27 +0000)]
[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

6 years ago[X86][SSE] Tests packuswb/truncation codegen from PR34773
Simon Pilgrim [Tue, 17 Oct 2017 21:14:53 +0000 (21:14 +0000)]
[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

6 years ago[MachineOutliner][NFC] Clean up prune logic a bit
Jessica Paquette [Tue, 17 Oct 2017 21:11:58 +0000 (21:11 +0000)]
[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

6 years agoRevert "[cmake] Use find_package to discover zlib"
Vassil Vassilev [Tue, 17 Oct 2017 20:51:25 +0000 (20:51 +0000)]
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

6 years agoFix typo in checkTwoLevelHintsCommand
Jessica Paquette [Tue, 17 Oct 2017 20:43:33 +0000 (20:43 +0000)]
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

6 years ago[cmake] Use find_package to discover zlib
Vassil Vassilev [Tue, 17 Oct 2017 20:32:27 +0000 (20:32 +0000)]
[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

6 years agoAMDGPU: Start generating metadata for MaxFlatWorkGroupSize
Konstantin Zhuravlyov [Tue, 17 Oct 2017 20:03:21 +0000 (20:03 +0000)]
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

6 years ago[MachineOutliner][NFC] Move decrement logic to OutlinedFunction
Jessica Paquette [Tue, 17 Oct 2017 19:03:23 +0000 (19:03 +0000)]
[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

6 years ago[MachineOutliner][NFC] Move end index calculation into Candidate
Jessica Paquette [Tue, 17 Oct 2017 18:43:15 +0000 (18:43 +0000)]
[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

6 years agoFix signed overflow detected by ubsan
Vitaly Buka [Tue, 17 Oct 2017 18:33:15 +0000 (18:33 +0000)]
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

6 years ago[DAGCombine] Add SCALAR_TO_VECTOR undef handling to simplifyShuffleMask.
Simon Pilgrim [Tue, 17 Oct 2017 18:14:48 +0000 (18:14 +0000)]
[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

6 years ago[llvm-special-case-list-fuzzer] Add fuzz target.
Matt Morehouse [Tue, 17 Oct 2017 17:43:34 +0000 (17:43 +0000)]
[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

6 years ago[ARM, AArch64] adjust tests trying to maintain their objective; NFC
Sanjay Patel [Tue, 17 Oct 2017 16:54:56 +0000 (16:54 +0000)]
[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

6 years ago[SimplifyCFG] add test for part of PR34471 (switch squashing); NFC
Sanjay Patel [Tue, 17 Oct 2017 15:56:42 +0000 (15:56 +0000)]
[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

6 years ago[SimplifyCFG] update test to use auto-generated FileCheck asserts; NFC
Sanjay Patel [Tue, 17 Oct 2017 15:50:47 +0000 (15:50 +0000)]
[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

6 years agoFix pthread_[gs]etname_np detection
Sam McCall [Tue, 17 Oct 2017 15:32:17 +0000 (15:32 +0000)]
Fix pthread_[gs]etname_np detection

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316005 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][Broadwell] Added the broadwell cpu to the scheduling regression tests.<NFC>
Gadi Haber [Tue, 17 Oct 2017 13:45:39 +0000 (13:45 +0000)]
[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

6 years agoImprove clamp recognition in ValueTracking.
Nikolai Bozhenov [Tue, 17 Oct 2017 11:50:48 +0000 (11:50 +0000)]
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

6 years agoFix implicit null check with negative offset
Yichao Yu [Tue, 17 Oct 2017 11:47:36 +0000 (11:47 +0000)]
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

6 years agoFix `FaultMaps` crash when the out streamer is reused
Yichao Yu [Tue, 17 Oct 2017 11:44:34 +0000 (11:44 +0000)]
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

6 years ago[X86][Skylake] fixed/updated regression test mmx-schedule.ll which failed after r315978.
Gadi Haber [Tue, 17 Oct 2017 10:00:08 +0000 (10:00 +0000)]
[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

6 years agoMore tests with x86 prefixes which work after rL315899 commit
Andrew V. Tischenko [Tue, 17 Oct 2017 08:49:47 +0000 (08:49 +0000)]
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

6 years ago[X86][SKL] Updated scheduling information for the SkylakeClient target
Gadi Haber [Tue, 17 Oct 2017 06:47:04 +0000 (06:47 +0000)]
[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

6 years agoRemove a test after revert of rL315440
Max Kazantsev [Tue, 17 Oct 2017 06:43:31 +0000 (06:43 +0000)]
Remove a test after revert of rL315440

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315977 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Add test from bug 34937
Max Kazantsev [Tue, 17 Oct 2017 06:37:58 +0000 (06:37 +0000)]
[NFC] Add test from bug 34937

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315976 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert 315440 on behalf of mkazantsev
Philip Reames [Tue, 17 Oct 2017 06:21:07 +0000 (06:21 +0000)]
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

6 years ago[globalisel][tablegen] Add a GIM_CheckIsSameOperand test where OtherInsnID and OtherO...
Daniel Sanders [Tue, 17 Oct 2017 05:24:44 +0000 (05:24 +0000)]
[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

6 years ago[X86] Add masked palignr tests to vector-shuffle-masked.ll
Craig Topper [Tue, 17 Oct 2017 04:17:56 +0000 (04:17 +0000)]
[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

6 years ago[X86] Add AVX512BW to the vector-shuffle-masked test to prepare for an upcoming commit.
Craig Topper [Tue, 17 Oct 2017 04:17:55 +0000 (04:17 +0000)]
[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

6 years ago[X86] Fix typo in comment. NFC
Craig Topper [Tue, 17 Oct 2017 04:17:54 +0000 (04:17 +0000)]
[X86] Fix typo in comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315969 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFuzzMutate: Fix arch parsing in FuzzerCLI
Justin Bogner [Tue, 17 Oct 2017 02:39:40 +0000 (02:39 +0000)]
FuzzMutate: Fix arch parsing in FuzzerCLI

The right way to parse arch names is by creating a triple. This was
using getArchTypeForLLVMName before, which doesn't really do the right
thing here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315965 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ExecutionEngine] Correct the size of a write in a COFF i386 relocation
Shoaib Meenai [Tue, 17 Oct 2017 01:41:14 +0000 (01:41 +0000)]
[ExecutionEngine] Correct the size of a write in a COFF i386 relocation

We want to be writing a 32bit value, so we should be writing 4 bytes
instead of 2.

Patch by Alex Langford <apl@fb.com>.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315964 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Add one correction to r315960 (PR34962)
Vedant Kumar [Tue, 17 Oct 2017 01:34:41 +0000 (01:34 +0000)]
[llvm-cov] Add one correction to r315960 (PR34962)

In r315960, I accidentally assumed that the first line segment is
guaranteed to be the non-gap region entry segment (given that one is
present). It can actually be any segment on the line, and the test I
checked in demonstrates that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315963 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[SCEV] Maintain and use a loop->loop invalidation dependency"
Sanjoy Das [Tue, 17 Oct 2017 01:03:56 +0000 (01:03 +0000)]
Revert "[SCEV] Maintain and use a loop->loop invalidation dependency"

This reverts commit r315713.  It causes PR34968.

I think I know what the problem is, but I don't think I'll have time to fix it
this week.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315962 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTry to make crlf portable to other printf implementations
Reid Kleckner [Tue, 17 Oct 2017 00:27:31 +0000 (00:27 +0000)]
Try to make crlf portable to other printf implementations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315961 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Remove workaround in line execution count calculation (PR34962)
Vedant Kumar [Mon, 16 Oct 2017 23:47:10 +0000 (23:47 +0000)]
[llvm-cov] Remove workaround in line execution count calculation (PR34962)

Gap areas make it possible to correctly determine when to use counts
from deferred regions. Before gap areas were introduced, llvm-cov needed
to use a heuristic to do this: it ignored counts from segments that
start, but do not end, on a line. This heuristic breaks down on a simple
example (see PR34962).

This patch removes the heuristic and picks counts from any region entry
segment which isn't a gap area.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315960 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUse the return value of UpdateNodeOperands(); in some cases, UpdateNodeOperands(...
Mark Searles [Mon, 16 Oct 2017 23:38:53 +0000 (23:38 +0000)]
Use the return value of UpdateNodeOperands(); in some cases, UpdateNodeOperands() modifies the node in-place and using the return value isn’t strictly necessary. However, it does not necessarily modify the node, but may return a resultant node if it already exists in the DAG. See comments in UpdateNodeOperands(). In that case, the return value must be used to avoid such scenarios as an infinite loop (node is assumed to have been updated, so added back to the worklist, and re-processed; however, node hasn’t changed so it is once again passed to UpdateNodeOperands(), assumed modified, added back to worklist; cycle infinitely repeats).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315957 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] Add v4x64 vector shuffle test for <0,2,1,3> mask
Simon Pilgrim [Mon, 16 Oct 2017 23:20:16 +0000 (23:20 +0000)]
[X86][AVX] Add v4x64 vector shuffle test for <0,2,1,3> mask

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315955 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agocmake: BSD: Mark /usr/local/include as system include directory
Matthias Braun [Mon, 16 Oct 2017 23:03:21 +0000 (23:03 +0000)]
cmake: BSD: Mark /usr/local/include as system include directory

We add /usr/local/include to the include directory list for some BSD
systems. We should mark this as a system directory to avoid files from
/usr/local/include getting picked over files shipping with llvm.

This typically manifested as gtest headers installed with the system
getting picked over the ones shipping with llvm.

Patch by Petr Penzin <penzin.dev@gmail.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315952 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-apply [AArch64][RegisterBankInfo] Use the statically computed mappings for COPY
Quentin Colombet [Mon, 16 Oct 2017 22:28:40 +0000 (22:28 +0000)]
Re-apply [AArch64][RegisterBankInfo] Use the statically computed mappings for COPY

This reverts commit r315823, thus re-applying r315781.

Also make sure we don't use G_BITCAST mapping for non-generic registers.
Non-generic registers don't have a type but do have a reg bank.
Something the COPY mapping now how to deal with but the G_BITCAST
mapping don't.

-- Original Commit Message --
We use to resort on the generic implementation to get the mappings for
COPYs. The generic implementation resorts on table lookup and
dynamically allocated objects to get the valid mappings.

Given we already know how to map G_BITCAST and have the static mappings
for them, use that code path for COPY as well. This is much more
efficient.

Improve the compile time of RegBankSelect by up to 20%.

Note: When we eventually generate all the mappings via TableGen, we
wouldn't have to do that dance to shave compile time. The intent of this
change was to make sure that moving to static structure really pays off.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315947 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][RegisterBankInfo] Add mapping support for G_BITCAST of s128
Quentin Colombet [Mon, 16 Oct 2017 22:28:38 +0000 (22:28 +0000)]
[AArch64][RegisterBankInfo] Add mapping support for G_BITCAST of s128

Anything bigger than 64-bit just map to FPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315946 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][LegalizerInfo] Mark s128 G_BITCAST legal
Quentin Colombet [Mon, 16 Oct 2017 22:28:27 +0000 (22:28 +0000)]
[AArch64][LegalizerInfo] Mark s128 G_BITCAST legal

We used to mark all G_BITCAST of 128-bit legal but only for vector
types. Scalars of this size are just fine as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315945 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd !callees metadata
Matthew Simpson [Mon, 16 Oct 2017 22:22:11 +0000 (22:22 +0000)]
Add !callees metadata

This patch adds a new kind of metadata that indicates the possible callees of
indirect calls.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315944 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC] Lex CRLF as one token
Reid Kleckner [Mon, 16 Oct 2017 22:20:03 +0000 (22:20 +0000)]
[MC] Lex CRLF as one token

This will prevent doubling of line endings when parsing assembly and
emitting assembly.

Otherwise we'd parse the directive, consume the end of statement, hit
the next end of statement, and emit a fresh newline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315943 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][3DNow] Add scheduling latency/throughput tests for 3DNow! instructions
Simon Pilgrim [Mon, 16 Oct 2017 21:55:09 +0000 (21:55 +0000)]
[X86][3DNow] Add scheduling latency/throughput tests for 3DNow! instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315942 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[JumpThreading] Move two PredValueInfoTy vectors to a scope closer to their usage...
Craig Topper [Mon, 16 Oct 2017 21:54:13 +0000 (21:54 +0000)]
[JumpThreading] Move two PredValueInfoTy vectors to a scope closer to their usage. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315941 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Mon, 16 Oct 2017 21:34:24 +0000 (21:34 +0000)]
[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@315940 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][MMX] Add scheduling latency/throughput tests for MMX instructions
Simon Pilgrim [Mon, 16 Oct 2017 21:29:29 +0000 (21:29 +0000)]
[X86][MMX] Add scheduling latency/throughput tests for MMX instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315939 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReplace make_range in MachineRegisterInfo with ArrayRef, NFC
Krzysztof Parzyszek [Mon, 16 Oct 2017 21:19:40 +0000 (21:19 +0000)]
Replace make_range in MachineRegisterInfo with ArrayRef, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315938 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[libFuzzer] Delete llvm/lib/Fuzzer
Vitaly Buka [Mon, 16 Oct 2017 20:48:19 +0000 (20:48 +0000)]
[libFuzzer] Delete llvm/lib/Fuzzer

Summary: Code is already in compiler-rt

Reviewers: kcc

Subscribers: krytarowski, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315937 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd base relative relocation record that can be used for the following case (OpenCL...
Tony Tye [Mon, 16 Oct 2017 20:44:29 +0000 (20:44 +0000)]
Add base relative relocation record that can be used for the following case (OpenCL example):

static __global int Var = 0;
__global int* Ptr[] = {&Var};
...

In this case Var is a non premptable symbol and so its address can be used as the value of Ptr, with a base relative relocation that will add the delta between the ELF address and the actual load address. Such relocations do not require a symbol.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315935 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agofix llvm-isel-fuzzer: LLVMFuzzerTestOneInput should never return non-zero (according...
Kostya Serebryany [Mon, 16 Oct 2017 20:36:57 +0000 (20:36 +0000)]
fix  llvm-isel-fuzzer: LLVMFuzzerTestOneInput should never return non-zero (according to the contract)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315933 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert MSVC 2017 build fix and fix it by moving the method that implicitly instantiat...
Reid Kleckner [Mon, 16 Oct 2017 20:31:16 +0000 (20:31 +0000)]
Revert MSVC 2017 build fix and fix it by moving the method that implicitly instantiates addPredicate out of line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315932 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix the build of GlobalISelEmitter with MSVC 2017 by specializing earlier
Reid Kleckner [Mon, 16 Oct 2017 20:23:16 +0000 (20:23 +0000)]
Fix the build of GlobalISelEmitter with MSVC 2017 by specializing earlier

MSVC doesn't seem to like implicitly instantiating addPredicate and then
explicitly specializing it later. It causes an internal compiler error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315930 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd iterator range MachineRegisterInfo::liveins(), adopt users, NFC
Krzysztof Parzyszek [Mon, 16 Oct 2017 19:08:41 +0000 (19:08 +0000)]
Add iterator range MachineRegisterInfo::liveins(), adopt users, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315927 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Rangify some loops, NFC
Krzysztof Parzyszek [Mon, 16 Oct 2017 18:43:08 +0000 (18:43 +0000)]
[Hexagon] Rangify some loops, NFC

Recommit r315763 with a fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315925 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SCEV] Rename getMaxBECount and update comments. NFC
Anna Thomas [Mon, 16 Oct 2017 17:47:17 +0000 (17:47 +0000)]
[SCEV] Rename getMaxBECount and update comments. NFC

Post commit review comments at D38825.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315920 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SparsePropagation] Enable interprocedural analysis
Matthew Simpson [Mon, 16 Oct 2017 17:44:17 +0000 (17:44 +0000)]
[SparsePropagation] Enable interprocedural analysis

This patch adds the ability to perform IPSCCP-like interprocedural analysis to
the generic sparse propagation solver. The patch gives clients the ability to
define their own custom LatticeKey types that the generic solver maps to custom
LatticeVal types. The custom lattice keys can be used, for example, to
distinguish among mappings for regular values, values returned from functions,
and values stored in global variables. Clients are responsible for defining how
to convert between LatticeKeys and LLVM Values by providing a specialization of
the LatticeKeyInfo template.

The added unit tests demonstrate how the generic solver can be used to perform
a simplified version of interprocedural constant propagation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315919 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] : revert r315908
Alexander Timofeev [Mon, 16 Oct 2017 16:57:37 +0000 (16:57 +0000)]
[AMDGPU] : revert r315908

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315916 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ObjCARC] Do not move a release that has the clang.imprecise_release tag
Akira Hatanaka [Mon, 16 Oct 2017 16:46:59 +0000 (16:46 +0000)]
[ObjCARC] Do not move a release that has the clang.imprecise_release tag
above PHI instructions.

ARC optimizer has an optimization that moves a call to an ObjC runtime
function above a phi instruction when the phi has a null operand and is
an argument passed to the function call. This optimization should not
kick in when the runtime function is an objc_release that releases an
object with precise lifetime semantics.

rdar://problem/34959669

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315914 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] add minmax tests with more predicate coverage; NFC
Sanjay Patel [Mon, 16 Oct 2017 15:20:00 +0000 (15:20 +0000)]
[x86] add minmax tests with more predicate coverage; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315913 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen] Simplify CallingConvEmitter.cpp. NFC.
Javed Absar [Mon, 16 Oct 2017 14:52:26 +0000 (14:52 +0000)]
[TableGen] Simplify CallingConvEmitter.cpp. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315911 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] don't unnecessarily generate a constant; NFCI
Sanjay Patel [Mon, 16 Oct 2017 14:47:24 +0000 (14:47 +0000)]
[InstCombine] don't unnecessarily generate a constant; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315910 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ValueTracking] fix typos, formatting; NFC
Sanjay Patel [Mon, 16 Oct 2017 14:46:37 +0000 (14:46 +0000)]
[ValueTracking] fix typos, formatting; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315909 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Prevent Machine Copy Propagation from replacing live copy with the dead one
Alexander Timofeev [Mon, 16 Oct 2017 14:35:29 +0000 (14:35 +0000)]
[AMDGPU] Prevent Machine Copy Propagation from replacing live copy with the dead one

Differential revision: https://reviews.llvm.org/D38754

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315908 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix test name typo.
Simon Pilgrim [Mon, 16 Oct 2017 14:33:51 +0000 (14:33 +0000)]
Fix test name typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315907 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Added additional PACKUS shuffle tests
Simon Pilgrim [Mon, 16 Oct 2017 14:32:41 +0000 (14:32 +0000)]
[X86][SSE] Added additional PACKUS shuffle tests

Mainly inspired by PR34773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315906 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips][micromips] Fix (dis)assembly of bc1(t|f)
Simon Dardis [Mon, 16 Oct 2017 14:20:22 +0000 (14:20 +0000)]
[mips][micromips] Fix (dis)assembly of bc1(t|f)

Previously these instructions were marked codegen only and had
an under-specified instruction description that did not record the
fcc register.

Reviewers: atanasyan, abeserminji

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315905 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoISel type legalizer: debug messages. NFC.
Sjoerd Meijer [Mon, 16 Oct 2017 14:07:30 +0000 (14:07 +0000)]
ISel type legalizer: debug messages. NFC.

Minor addition and follow up of r314773 and r311533: this adds more
debug messages to the type legalizer. For each node, it dumps
legalization info for results and operands nodes, rather than just the
final legalized node.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315904 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix or vs || typo.
Simon Pilgrim [Mon, 16 Oct 2017 14:01:59 +0000 (14:01 +0000)]
Fix or vs || typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315903 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Provide alternate predicates for constant synthesis
Stefan Maksimovic [Mon, 16 Oct 2017 13:18:21 +0000 (13:18 +0000)]
[mips] Provide alternate predicates for constant synthesis

Ordering of patterns should not be of importance anymore
since the predicates used are mutually exclusive now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315901 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] fix up in sign-/zero-extension elimination
Hiroshi Inoue [Mon, 16 Oct 2017 12:11:15 +0000 (12:11 +0000)]
[PowerPC] fix up in sign-/zero-extension elimination

This patch fixes a potential problem in my previous commit (https://reviews.llvm.org/rL315888) by adding a null check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315900 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoThis patch is a result of D37262: The issues with X86 prefixes. It closes PR7709...
Andrew V. Tischenko [Mon, 16 Oct 2017 11:14:29 +0000 (11:14 +0000)]
This patch is a result of D37262: The issues with X86 prefixes. It closes  PR7709, PR17697, PR19251, PR32809 and PR21640. There could be other bugs closed by this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315899 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-dwarfdump] - Teach tool to parse DW_CFA_GNU_args_size.
George Rimar [Mon, 16 Oct 2017 10:26:17 +0000 (10:26 +0000)]
[llvm-dwarfdump] - Teach tool to parse DW_CFA_GNU_args_size.

Currently llvm-dwarfdump runs into llvm_unreachable when
faces DW_CFA_GNU_args_size. Patch implements the support.

Differential revision: https://reviews.llvm.org/D38879

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315897 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert rL315894, "SLPVectorizer.cpp: Try to appease stage2-3 difference. (D38586)"
NAKAMURA Takumi [Mon, 16 Oct 2017 09:50:01 +0000 (09:50 +0000)]
Revert rL315894, "SLPVectorizer.cpp: Try to appease stage2-3 difference. (D38586)"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315896 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMove folding of icmp with zero after checking for min/max idioms.
Nikolai Bozhenov [Mon, 16 Oct 2017 09:19:21 +0000 (09:19 +0000)]
Move folding of icmp with zero after checking for min/max idioms.

Summary:
The following transformation for cmp instruction:

  icmp smin(x, PositiveValue), 0 -> icmp x, 0

should only be done after checking for min/max to prevent infinite
looping caused by a reverse canonicalization. That is why this
transformation was moved to place after the mentioned check.

Reviewers: spatel, efriedma

Subscribers: llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315895 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSLPVectorizer.cpp: Try to appease stage2-3 difference. (D38586)
NAKAMURA Takumi [Mon, 16 Oct 2017 09:15:23 +0000 (09:15 +0000)]
SLPVectorizer.cpp: Try to appease stage2-3 difference. (D38586)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315894 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen] Range loopify DAGISelMatcher. NFC.
Javed Absar [Mon, 16 Oct 2017 06:43:54 +0000 (06:43 +0000)]
[TableGen] Range loopify DAGISelMatcher. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315891 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[aarch64][globalisel] Fix a crash in selectAddrModeIndexed() caused by incorrect...
Daniel Sanders [Mon, 16 Oct 2017 05:39:30 +0000 (05:39 +0000)]
[aarch64][globalisel] Fix a crash in selectAddrModeIndexed() caused by incorrect G_FRAME_INDEX handling

The wrong operand was being rendered to the result instruction.

The crash was detected by Bitcode/simd_ops/AArch64_halide_runtime.bc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315890 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: fix bug on silently truncating 64-bit immediate
Yonghong Song [Mon, 16 Oct 2017 04:14:53 +0000 (04:14 +0000)]
bpf: fix bug on silently truncating 64-bit immediate

We came across an llvm bug when compiling some testcases that 64-bit
immediates are silently truncated into 32-bit and then packed into
BPF_JMP | BPF_K encoding.  This caused comparison with wrong value.

This bug looks to be introduced by r308080.  The Select_Ri pattern is
supposed to be lowered into J*_Ri while the latter only support 32-bit
immediate encoding, therefore Select_Ri should have similar immediate
predicate check as what J*_Ri are doing.

Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315889 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Eliminate sign- and zero-extensions if already sign- or zero-extended
Hiroshi Inoue [Mon, 16 Oct 2017 04:12:57 +0000 (04:12 +0000)]
[PowerPC] Eliminate sign- and zero-extensions if already sign- or zero-extended

This patch enables redundant sign- and zero-extension elimination in PowerPC MI Peephole pass.
If the input value of a sign- or zero-extension is known to be already sign- or zero-extended, the operation is redundant and can be eliminated.
One common case is sign-extensions for a method parameter or for a method return value; they must be sign- or zero-extended as defined in PPC ELF ABI.
For example of the following simple code, two extsw instructions are generated before the invocation of int_func and before the return. With this patch, both extsw are eliminated.

void int_func(int);
void ii_test(int a) {
    if (a & 1) return int_func(a);
}

Such redundant sign- or zero-extensions are quite common in many programs; e.g. I observed about 60,000 occurrences of the elimination while compiling the LLVM+CLANG.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315888 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-commit r315885: [globalisel][tblgen] Add support for iPTR and implement am_unscale...
Daniel Sanders [Mon, 16 Oct 2017 03:36:29 +0000 (03:36 +0000)]
Re-commit r315885: [globalisel][tblgen] Add support for iPTR and implement am_unscaled* and am_indexed*

Summary:
iPTR is a pointer of subtarget-specific size to any address space. Therefore
type checks on this size derive the SizeInBits from a subtarget hook.

At this point, we can import the simplests G_LOAD rules and select load
instructions using them. Further patches will support for the predicates to
enable additional loads as well as the stores.

The previous commit failed on MSVC due to a failure to convert an
initializer_list to a std::vector. Hopefully, MSVC will accept this version.

Depends on D37457

Reviewers: ab, qcolombet, t.p.northover, rovka, aditya_nandakumar

Reviewed By: qcolombet

Subscribers: kristof.beyls, javed.absar, llvm-commits, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315887 91177308-0d34-0410-b5e6-96231b3b80d8