143246 Commits

Author SHA1 Message Date
Craig Topper
373d814f41 [AVX-512] Add masked forms of the alternate MOVDDUP patterns.
I'm not too sure how to get isel to select even all of the unmasked forms, but at least we have a consistent set now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291368 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 22:20:23 +00:00
Simon Pilgrim
ee6faf574a [CostModel][X86] Fix AVX2 v16i16 shift 'splat' costs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 22:08:09 +00:00
Simon Pilgrim
371d289738 [CostModel][X86] Match 256-bit vector shift 'splat' costs for AVX2 and above
We were matching against general vector shift costs before the uniform splat costs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 21:47:10 +00:00
Simon Pilgrim
e1ddc8e7d2 [CostModel][X86] Generalized cost calculation of SHL by constant -> MUL conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291364 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 21:33:00 +00:00
Simon Pilgrim
efd0114329 [X86][AVX2] Regenerate arithmetic tests
Fixed missing checks for tests that used a '-' in the name, which was messing with update_llc_test_checks.py

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291363 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 20:38:36 +00:00
Mehdi Amini
fd47fbc5dc [ThinLTO] Fix assertions on lazy-loading of Metadata TBAA attachments
Summary:
The issue happens with:

 %0 = ....., !tbaa !0
 %1 = ....., !tbaa !1

With !0 that references !1.

In this case when loading !0 we generates a temporary for the
operand !1. We now flush it immediately and trigger the load of
!1 before moving on. If we don't we get the temporary when
attaching to %1. This is usually not an issue except that we
eagerly try to update TBAA MDNodes, which is obviously not possible
if we only have a temporary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 20:24:23 +00:00
Hal Finkel
41b81eb904 [llvm-opt-report] Fix context-sensitive lines where nothing happened
Don't print a line multiple times, each for different inlining contexts, if
nothing happened in any context. This prevents situations like this:

 [[
  > main:
 65     |       if ((i * ni + j) % 20 == 0) fprintf
  > print_array:
 65     |       if ((i * ni + j) % 20 == 0) fprintf
 ]]

which could happen if different optimizations were missed in different inlining
contexts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 20:21:17 +00:00
Matt Arsenault
071eccb255 SimplifyLibCalls: Remove incorrect optimization of fabs
fabs(x * x) is not generally safe to assume x is positive if x is a NaN.
This is also less general than it could be, so this will be replaced
with a transformation on the intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 19:55:12 +00:00
Daniel Berlin
91a00349ed Update update_test_checks to work properly with phi nodes and other fun things.
Summary:
Prior to this change, phi nodes were never considered defs, and so we ended up with undefined variables for any loop.  Now, instead of trying to find just defs, we iterate over each actual IR value in the line, and replace them one by one with either a definition or a use.

We also don't try to match anything in the comment portions of the line.

I've tested it even on things like function pointer calls, etc, and against existing test cases uses update_test_checks
With this change, we are able to use update_tests on the cyclic cases in newgvn.

The only case i'm aware of that will misfire is if you have a string with which contains a valid token.
However, this is the same as it is now, with a slightly larger set of strings that may misfire.
Prior to this change, a test with the string " %a =" would be replaced.

Reviewers: spatel, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 19:04:59 +00:00
Mehdi Amini
497eca1e74 [Bitcode] Remove unused PlaceHolder parameter to lazyLoadModuleMetadataBlock()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 18:31:38 +00:00
Simon Pilgrim
129141ec2f [CostModel][X86] Merge separate AVX1 cost LUTs. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 18:19:25 +00:00
Simon Pilgrim
21886bd4a8 [CostModel][AVX512BW] Add v32i16 vector shift costs for avx512bw targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291354 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 17:54:10 +00:00
Simon Pilgrim
5988cea66b [CostModel][X86] Added missing AVX2 arithmetic costs.
Allows us to correctly fall through to the lower AVX1 costs if look up failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 17:27:39 +00:00
Simon Pilgrim
9724d35716 [CostModel][X86] Reordered AVX1 arithmetic cost LUT into descending target order. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 17:03:51 +00:00
Daniel Berlin
a783424031 NewGVN: Make sure we properly lookup operand leaders while creating
congruence classes for stores, and then keep them up to date.  Add
testcases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 16:55:14 +00:00
Simon Pilgrim
f9fdf76b96 [X86][AVX512] Use lowerShuffleAsRepeatedMaskAndLanePermute for non-VBMI v64i8 shuffles (PR31470)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291347 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 15:37:50 +00:00
Rui Ueyama
edd4534a45 TarWriter: Use fitsInUstar function.
This change should have been commit as part of r291340.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291341 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 08:32:07 +00:00
Rui Ueyama
8d4b4e6f8a TarWriter: Use Ustar header's "prefix" field to store long filenames.
Tar's Ustar header has the "prefix" field to store a directory
part of a filename. It is not as flexible as the PAX-extended
filename because there's still a limitation on the maximum filename
size, but it mitigates the situation.

This patch should unbreak some Windows buildbots that uses very
old tar command.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291340 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 08:28:56 +00:00
Craig Topper
7be24b7e92 [X86] Disable load unfolding for 128-bit MOVDDUP instructions since the load size is smaller than the register size so unfolding would increase the load size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 06:56:54 +00:00
Xin Tong
197d59a562 Fix a typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291335 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 04:30:58 +00:00
Daniel Berlin
aded1359b6 NewGVN: Reformat and fix a few newlines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291334 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 03:23:47 +00:00
Davide Italiano
d43425f87b [NewGVN] Prefer auto over explicit type. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 02:05:50 +00:00
Dan Gohman
e877be12b2 [WebAssembly] Don't abort on code with UB.
Gracefully leave code that performs function-pointer bitcasts implying
non-trivial pointer conversions alone, rather than aborting, since it's
just undefined behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291326 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 01:50:01 +00:00
Dan Gohman
45b889b776 [WebAssembly] Move a SmallVector to a more specific scope. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 01:31:18 +00:00
Peter Collingbourne
260cfbc963 LowerTypeTests: Thread summary and action from the API and command line into the pass.
Also move command line handling out of the pass constructor and into
a separate function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291323 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 01:17:24 +00:00
Mehdi Amini
9cb6a18769 Remove useless Forward Declaration from header (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:57:43 +00:00
Dylan McKay
900001e180 [AVR] Parenthesize a boolean expression
Without the parentheses, clang would emit warnings while compiling the
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:55:28 +00:00
Quentin Colombet
d87ddcb9f0 [MachineBasicBlock] Add a non-assert live-in accessor for debug mode.
With r291169, it is now not possible to access the live-in information
when the liveness is not properly tracked. Although this is want we want
in general, for debugging purpose we may want to still be able to
traverse this information even if it may not be accurate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291317 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:46:30 +00:00
Dan Gohman
91f4652a9e [WebAssembly] Add a pass to create wrappers for function bitcasts.
WebAssembly requires caller and callee signatures to match exactly. In LLVM,
there are a variety of circumstances where signatures may be mismatched in
practice, and one can bitcast a function address to another type to call it
as that type. This patch adds a pass which replaces bitcasted function
addresses with wrappers to replace the bitcasts.

This doesn't catch everything, but it does match many common cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291315 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:34:54 +00:00
Jacob Gravelle
da319ede9a Test commit. Comment formatting, it's -> its.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:22:31 +00:00
Daniel Berlin
45b7d44c62 NewGVN: Fix PR 31501.
Summary: LLVM's non-standard notion of phi nodes means we can't both try to substitute for undef in phi nodes *and* use phi nodes as leaders all the time. This changes NewGVN to use the same semantics as SimplifyPHINode to decide which phi nodes are equivalent.

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:01:42 +00:00
Peter Collingbourne
64d3b81d23 ModuleSummaryIndexYAML: Make a few fields optional to make it easier to write tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:00:22 +00:00
Teresa Johnson
17b59bf192 [ThinLTO] Handle conflicting local names gracefully
Summary:
r285871 introduced an assert that was overly aggressive in the case
of a same-named local in different same-named files (in different
directories), where the source name and therefore the GUID ended up
the same because the files were compiled in their own directory without
any leading path. Change the handling in the promotion logic to get
the summary for the version in that module.

This also exposed an issue where we are not always importing the
right copy, which is a performance not correctness issue (because
the renaming is based on the module hash which must be different,
see the bug report for details). I will fix that as a follow-on.

Fixes PR31561.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291304 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:38:41 +00:00
Teresa Johnson
12722f7e6c [ThinLTO] Optionally ignore empty index file
Summary:
In order to simplify distributed build system integration, where actions
may be scheduled before the Thin Link which determines the list of
objects selected by the linker. The gold plugin currently will emit
0-sized index files for objects not selected by the link, to enable
checking for expected output files by the build system. If the build
system then schedules a backend action for these bitcode files, we want
to be able to fall back to normal compilation instead of failing.

This is the LLVM side support for optionally enabling fallback
instead of issuing an error. Return a null CombinedIndex from
llvm::getModuleSummaryIndexForFile under the option when the file
is empty. Clang can then ignore the index when it is null.

Clang patch is D28362.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291302 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:37:17 +00:00
Justin Lebar
41b68ffb50 [PM] Edit comments on PM Proxy and utility classes.
Reviewers: chandlerc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:32:02 +00:00
Chandler Carruth
2ff6bc0d1d [gtest] Detect warning flags using the positive spelling.
Some GCC versions will accept any warning flag name after a '-Wno-',
which would cause us to try to disable warnings with names GCC didn't
understand. This will silently succeed unless there is some other output
from GCC in which case we get weird cc1plus warnings about the warning
name being bogus.

There is still the issue that gtest sets warning flags for building
gtest-all.cc using weird 'add_definitions' and the fact that there is
a GCC version which warns on the variadic macro usage in gtest under
-pedantic, but has no flag analogous to Clang's
-Wgnu-zero-variadic-macro-argumnets to suppress this warning. I haven't
been able to come up with any good solution here. The closest is to turn
off -pedantic for those versions of GCC, but that seems really nasty.
For now, those versinos of GCC aren't warning clean. If anyone is broken
by this, I'll work on CMake logic to detect and disable -pedantic in
these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:16:00 +00:00
Eugene Zelenko
85430657b9 [BPF] 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@291297 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:06:25 +00:00
David Majnemer
dae3654635 [InstSimplify] Optimize away udivs in the presence of range metadata
We know that udiv %V, C can be optimized away to 0 if %V is ult C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 22:58:02 +00:00
Kuba Mracek
7b4e5275af Follow-up for r291289: Fix failing global_metadata_darwin.ll test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 22:22:22 +00:00
Zachary Turner
ef3cdbf49f Convert MSF Stream iterators to use llvm iterator facade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 22:05:12 +00:00
Kuba Mracek
daead831a2 [asan] Change the visibility of ___asan_globals_registered to hidden
This flag is used to track global registration in Mach-O and it doesn't need to be exported and visible.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 22:02:58 +00:00
Xin Tong
e48df7daf0 Fix use after free
Summary: Fix use after free in LoopUnswitch

Reviewers: chenli, atrick, hfinkel, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:49:08 +00:00
Michal Gorny
4d3523945d [llvm-config] Print --system-libs only when static linking
Modify the --system-libs option in llvm-config to print system libs only
when using static linking. The system libraries are irrelevant when
linking to a shared library since the library has appropriate library
dependencies embedded.

Modify the --system-libs test appropriately to force static linking, and
disable it if static libs are not available (i.e. BUILD_SHARED_LIBS is
enabled).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:33:54 +00:00
Michal Gorny
1159e42199 [cmake] Canonicalize CMake booleans to 0/1 for lit interop
Canonicalize all CMake booleans to 0/1 before passing them to lit, to
ensure that the Python side handles all of them consistently
and correctly. 0/1 is a safe choice of values that trigger the same
boolean interpretation in CMake, Python and C++.

Furthermore, using them without quotes improves the chance Python will
explicitly fail when an incorrect value (such as ON/OFF, TRUE/FALSE,
YES/NO) is accidentally passed, rather than silently misinterpreting
the value.

This replaces a lot of different logics spread around lit site files,
attempting to partially reproduce the boolean logic used in CMake
and usually silently failing when an uncommon value was used instead.
In fact, some of them were never working correctly since different
values were assigned in CMake and checked in Python.

The alternative solution could be to create a common parser for CMake
booleans in lit and use it consistently throughout the site files.
However, it does not seem like the best idea to create redundant
implementation of the same logic and have to follow upstream if it ever
is extended to handle more values.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:33:48 +00:00
Michal Gorny
c56b5dc8d8 [test] Remove unused 'test_examples' config var
Remove config.test_examples from lit.site.cfg and the relevant
ENABLE_EXAMPLES definition from CMake. It is not used anywhere.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291283 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:33:39 +00:00
David Majnemer
ef654a7ee6 [InstSimplify] Optimize away urems in the presence of range metadata
We know that urem %V, C can be optimized away to %V if %V is ult C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:23:51 +00:00
Mehdi Amini
2b72a53db9 Fix LoopLoadElimination to keep original alignment on the inital hoisted store
This is fixing a bug where Loop Vectorization is widening a load but
with a lower alignment. Hoisting the load without propagating the alignment
will allow inst-combine to later deduce a higher alignment that what the pointer
actually is.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:06:51 +00:00
Jan Vesely
0835374acb AMDGPU/R600: Don't use REGISTER_{LOAD,STORE} ISD nodes
This will make transition to SCRATCH_MEMORY easier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291279 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:00:46 +00:00
Simon Pilgrim
9a3bb969b8 [X86][SSE] Standardized triples in vector shift tests
Made no sense for them to be different and caused useless diffs in assembly remarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291274 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 19:56:57 +00:00
Simon Pilgrim
3beff6a4d1 [CostModel][X86] Add AVX512 and 512-bit vector shift cost tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 19:41:26 +00:00