OSDN Git Service
Oliver Stannard [Thu, 28 Jan 2016 10:07:27 +0000 (10:07 +0000)]
Add backend dignostic printer for unsupported features
Re-commit of r258951 after fixing layering violation.
The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.
In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.
Differential Revision: http://reviews.llvm.org/D16590
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259035
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 28 Jan 2016 09:45:01 +0000 (09:45 +0000)]
[X86][SSE] Move setTargetShuffleZeroElements closer to getTargetShuffleMask. NFCI.
Keep target shuffle mask helper functions closer together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259034
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Thu, 28 Jan 2016 09:42:39 +0000 (09:42 +0000)]
Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259033
91177308-0d34-0410-b5e6-
96231b3b80d8
Asaf Badouh [Thu, 28 Jan 2016 08:33:22 +0000 (08:33 +0000)]
[X86][AVX512] small fix in ptestm intrinsics
move ptestm{q|d} intrinsics from patterns form (in td file) to the intrinsics table
Differential Revision: http://reviews.llvm.org/D16633
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259029
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Jan 2016 06:29:33 +0000 (06:29 +0000)]
ValueTracking: Use fixed array for assumption exclude set in Query.
The Query structure is constructed often and is relevant for compiletime
performance. We can replace the SmallPtrSet for assumption exclusions in
this structure with a fixed size array because we know the maximum
number of elements. This improves typical clang -O3 -emit-llvm compiletime
by 1.2% in my measurements.
Differential Revision: http://reviews.llvm.org/D16204
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259025
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Thu, 28 Jan 2016 06:23:33 +0000 (06:23 +0000)]
[DAGCombiner] Don't add volatile or indexed stores to ChainedStores
Summary:
findBetterNeighborChains does not handle volatile or indexed stores.
However, it did not check when adding stores to ChainedStores.
Reviewers: arsenm
Differential Revision: http://reviews.llvm.org/D16463
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259024
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Jan 2016 05:09:01 +0000 (05:09 +0000)]
SmallPtrSet: Add missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259021
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Thu, 28 Jan 2016 05:05:17 +0000 (05:05 +0000)]
WebAssembly: fix build
r259016 didn't also revert r258957 which broken the WebAssembly build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259020
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Jan 2016 04:49:14 +0000 (04:49 +0000)]
SmallPtrSet: Make destructor available for inlining
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259019
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Jan 2016 04:49:11 +0000 (04:49 +0000)]
SmallPtrSet: Share some code between copy/move constructor/assignment operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259018
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 Jan 2016 04:49:07 +0000 (04:49 +0000)]
SmallPtrSet: Remove trailing whitespace, fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259017
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 28 Jan 2016 04:41:32 +0000 (04:41 +0000)]
Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"
It broke layering violation in LLVMIR.
clang r258950 "Add backend dignostic printer for unsupported features"
llvm r258951 "Refactor backend diagnostics for unsupported features"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259016
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 28 Jan 2016 03:59:09 +0000 (03:59 +0000)]
[WebAssembly] Don't stackify a register def past a get_local use in the same tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259013
91177308-0d34-0410-b5e6-
96231b3b80d8
Junmo Park [Thu, 28 Jan 2016 01:23:18 +0000 (01:23 +0000)]
Minor code formatting cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259010
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 28 Jan 2016 01:22:44 +0000 (01:22 +0000)]
[WebAssembly] Enhanced register stackification
This patch revamps the RegStackifier pass with a new tree traversal mechanism,
enabling three major new features:
- Stackification of values with multiple uses, using the result value of set_local
- More aggressive stackification of instructions with side effects
- Reordering operands in commutative instructions to enable more stackification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259009
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Thu, 28 Jan 2016 00:54:01 +0000 (00:54 +0000)]
Minor style cleanup of CFLAA. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259008
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 28 Jan 2016 00:03:16 +0000 (00:03 +0000)]
less indenting; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259002
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 27 Jan 2016 22:21:25 +0000 (22:21 +0000)]
[TTI] Add getPrefetchDistance from PPCLoopDataPrefetch, NFC
This patch is part of the work to make PPCLoopDataPrefetch
target-independent
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758).
As it was discussed in the above thread, getPrefetchDistance is
currently using instruction count which may change in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258995
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 27 Jan 2016 21:53:08 +0000 (21:53 +0000)]
Tweak unnamed label syntax in textual IR for easier matching in tests.
Change the unnamed label comments like
; <label>:8 ; preds = %1
to
; <label>:8: ; preds = %1
This way lit tests can match [[LABEL]]: in both asserts and no-asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258993
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Wed, 27 Jan 2016 21:17:39 +0000 (21:17 +0000)]
[WebAssembly] Implement byval arguments
Summary:
Just does the simple allocation of a stack object and passes
a pointer to the callee.
Differential Revision: http://reviews.llvm.org/D16610
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258989
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 27 Jan 2016 21:13:18 +0000 (21:13 +0000)]
[utils] Add windows support to update_llc_test_checks.py
Strip dos line endings from llc generated files to allow the regex patterns to match them.
Ensure updated *.ll files are generated with unix style line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258987
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 27 Jan 2016 20:27:44 +0000 (20:27 +0000)]
[llvm-nm] Remove redundant check for file validity.
We already perform it at the beginning of the function so we can't
arrive here with an invalid object. Also, add a test so that bugs
won't sneak in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258982
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 27 Jan 2016 19:32:29 +0000 (19:32 +0000)]
ARMv7k: base ABI decision on v7k Arch rather than watchos OS.
Various bits we want to use the new ABI actually compile with "-arch armv7k
-miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how
slices work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258975
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 19:29:56 +0000 (19:29 +0000)]
One more batch of self-containing headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258974
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 19:29:42 +0000 (19:29 +0000)]
Don't put classes in headers into anonymous namespaces.
You want ODR violations? That's how you get ODR violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258973
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 27 Jan 2016 19:22:45 +0000 (19:22 +0000)]
[SimplifyCFG] limit recursion depth when speculating instructions (PR26308)
This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=26308
With the switch to using the TTI cost model in:
http://reviews.llvm.org/rL228826
...it became possible to hit a zero-cost cycle of instructions (gep -> phi -> gep...),
so we need a cap for the recursion in DominatesMergePoint().
A recursion depth parameter was already added for a different reason in:
http://reviews.llvm.org/rL255660
...so we can just set a limit for it.
I pulled "10" out of the air and made it an independent parameter that we can play with.
It might be higher than it needs to be given the currently low default value of
PHINodeFoldingThreshold (2). That's the starting cost value that we enter the recursion
with, and most instructions have cost set to TCC_Basic (1), so I don't think we're going
to speculate more than 2 instructions with the current parameters.
As noted in the review and the TODO comment, we can do better than just limiting recursion
depth.
Differential Revision: http://reviews.llvm.org/D16637
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258971
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 27 Jan 2016 19:05:08 +0000 (19:05 +0000)]
Add support for objc_unsafeClaimAutoreleasedReturnValue to the
ObjC ARC Optimizer.
The main implication of this is:
1. Ensuring that we treat it conservatively in terms of optimization.
2. We put the ASM marker on it so that the runtime can recognize
objc_unsafeClaimAutoreleasedReturnValue from releaseRV.
<rdar://problem/
21567064>
Patch by Michael Gottesman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258970
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 18:03:40 +0000 (18:03 +0000)]
Unbreak wasm build after r258951.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258957
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 18:03:37 +0000 (18:03 +0000)]
Make more headers self-contained.
A lot of this comes from the new complete type requirement of DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258956
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Wed, 27 Jan 2016 17:30:33 +0000 (17:30 +0000)]
Refactor backend diagnostics for unsupported features
The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.
There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.
The implementation of DiagnosticInfoUnsupported::print must be in
lib/Codegen rather than in the existing file in lib/IR/ to avoid
introducing a dependency from IR to CodeGen.
Differential Revision: http://reviews.llvm.org/D16590
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258951
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 27 Jan 2016 17:05:09 +0000 (17:05 +0000)]
[IndVars] Hoist DataLayout load out of loop; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258946
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 27 Jan 2016 17:05:06 +0000 (17:05 +0000)]
[IndVars] Use isSCEVable; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258945
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 27 Jan 2016 17:05:03 +0000 (17:05 +0000)]
[IndVars] Use range-for; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258944
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 16:53:42 +0000 (16:53 +0000)]
Move SafeStack to CodeGen.
It depends on the target machinery, that's not available for
instrumentation passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258942
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 27 Jan 2016 16:51:57 +0000 (16:51 +0000)]
[X86][SSE] Test insertps instrinsic calls with masks that can't combine to something simpler
For these basic tests of the intrinsic, make sure the mask can't simplify to movss, blend-with-zero or something else
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258941
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 16:32:26 +0000 (16:32 +0000)]
Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to CodeGen/
It's a SelectionDAG thing, not a Target thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258939
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 16:05:42 +0000 (16:05 +0000)]
Move passes that live in lib/CodeGen out of Scalar.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258938
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 16:05:37 +0000 (16:05 +0000)]
Make some headers self-contained, remove unused includes that violate layering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258937
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 27 Jan 2016 15:53:52 +0000 (15:53 +0000)]
AMDGPU/SI: Fix commuting of 32-bit VOPC instructions
Summary:
We didn't have entries in the commuting table for the 32-bit
instructions. I don't think we hit this problem now, but we
will once uniform branching is enabled. Tests will come in
a later commit.
Reviewers: arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D16600
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258936
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Wed, 27 Jan 2016 14:05:35 +0000 (14:05 +0000)]
[DebugInfo] Support zero-length CIE in the _eh_frame parser
MCJIT emits zero-length CIE at the end of the _eh_frame section. This change
ensures that parser inside DebugInfo will not crash and correctly record such cases.
We are now recording DW_EH_PE_omit as a default value for FDE and LSDA encodings.
Also Offset != EndAugmentationOffset assertion check will only happen if augmentation
string had 'z' letter in it.
Differential Revision: http://reviews.llvm.org/D16588
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258931
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Wed, 27 Jan 2016 13:43:27 +0000 (13:43 +0000)]
Reapply commit r258404 with fix
This patch is the second attempt to reapply commit r258404. There was bug in
the initial patch and subsequent fix (mentioned below).
The initial patch caused an assertion because we were computing smaller type
sizes for instructions that cannot be demoted. The fix first determines the
instructions that will be demoted, and then applies the smaller type size to
only those instructions.
This should fix PR26239 and PR26307.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258929
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 13:22:39 +0000 (13:22 +0000)]
Remove superfluous call to std::to_string that's breaking the cygwin build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258928
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 12:44:12 +0000 (12:44 +0000)]
Revert "Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed."
and "Add a missing test case for r258847."
This reverts commit r258847, r258848. Causes miscompilations and backend
errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258927
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Wed, 27 Jan 2016 11:34:51 +0000 (11:34 +0000)]
Add missing build attribute regression tests for Cortex-A8
Differential Revision: http://reviews.llvm.org/D16576
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258923
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Wed, 27 Jan 2016 11:19:45 +0000 (11:19 +0000)]
AMDGPU/SI: Stoney has only 16 LDS banks
Summary:
This is a candidate for stable, along with all patches that add the "stoney"
processor.
Reviewers: tstellarAMD
Subscribers: arsenm
Differential Revision: http://reviews.llvm.org/D16485
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258922
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 27 Jan 2016 10:01:28 +0000 (10:01 +0000)]
Move MCTargetAsmParser.h to llvm/MC/MCParser where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258917
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Wed, 27 Jan 2016 08:57:46 +0000 (08:57 +0000)]
AVX512: Fix vpmovzxbw predicate for AVX1/2 instructions.
Differential Revision: http://reviews.llvm.org/D16595
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258915
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Wed, 27 Jan 2016 08:43:25 +0000 (08:43 +0000)]
AVX512: Add store mask patterns.
Differential Revision: http://reviews.llvm.org/D16596
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258914
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Wed, 27 Jan 2016 07:40:41 +0000 (07:40 +0000)]
[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader
Summary:
This is a revised version of D13974, and the following quoted summary are from D13974
"This patch adds support to check if a loop has loop invariant conditions which lead to loop exits. If so, we know that if the exit path is taken, it is at the first loop iteration. If there is an induction variable used in that exit path whose value has not been updated, it will keep its initial value passing from loop preheader. We can therefore rewrite the exit value with
its initial value. This will help remove phis created by LCSSA and enable other optimizations like loop unswitch."
D13974 was committed but failed one lnt test. The bug was that we only checked the condition from loop exit's incoming block was a loop invariant. But there could be another condition from loop header to that incoming block not being a loop invariant. This would produce miscompiled code.
This patch fixes the issue by checking if the incoming block is loop header, and if not, don't perform the rewrite. The could be further improved by recursively checking all conditions leading to loop exit block, but I'd like to check in this simple version first and improve it with future patches.
Reviewers: sanjoy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16570
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258912
91177308-0d34-0410-b5e6-
96231b3b80d8
Haicheng Wu [Wed, 27 Jan 2016 04:59:05 +0000 (04:59 +0000)]
[SLPVectorizer] Swap the checking order of isCommutative and isConsecutiveAccess
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258909
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 27 Jan 2016 04:20:24 +0000 (04:20 +0000)]
SmallPtrSet: Inline the part of insert_imp in the small case
Most of the time we only hit the small case, so it is beneficial to pull
it out of the insert_imp() implementation. This improves compile time
at least for non-LTO builds.
Differential Revision: http://reviews.llvm.org/D16619
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258908
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 27 Jan 2016 03:45:25 +0000 (03:45 +0000)]
Function: Slightly simplify code by using existing hasFnAttribute() convenience function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258907
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 27 Jan 2016 03:13:09 +0000 (03:13 +0000)]
[Coverage] Fix more bugs in covmap V1 documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258906
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 27 Jan 2016 02:59:41 +0000 (02:59 +0000)]
Revert "Revert "[SimplifyCFG] allow speculation of exactly one expensive instruction (PR24818)""
This reverts commit r258903 which reverted r255660. r258903 was an
accidental commit and should not have been committed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258905
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 27 Jan 2016 02:43:28 +0000 (02:43 +0000)]
[SimplifyCFG] Don't mistake icmp of and for a tree of comparisons
SimplifyCFG tries to turn complex branch conditions into a switch.
Some of it's logic attempts to reason about bitwise arithmetic produced
by InstCombine. InstCombine can turn things like (X == 2) || (X == 3)
into (X & 1) == 2 and so SimplifyCFG tries to detect when this occurs so
that it can produce a switch instruction.
However, the legality checking was not sufficient to determine whether
or not this had occured. Correctly check this case by requiring that
the right-hand side of the comparison be a power of two.
This fixes PR26323.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258904
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 27 Jan 2016 02:43:22 +0000 (02:43 +0000)]
Revert "[SimplifyCFG] allow speculation of exactly one expensive instruction (PR24818)"
This reverts commit r255660.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258903
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 27 Jan 2016 02:17:49 +0000 (02:17 +0000)]
AMDGPU: Fix default device handling
When no device name is specified, default to kaveri
for HSA since SI is not supported and it woud fail.
Default to "tahiti" instead of "SI" since these are
effectively the same, and tahiti is an actual device.
Move default device handling to the TargetMachine
rather than the AMDGPUSubtarget. The module ISA version
is computed from the device name provided with the target
machine, so the attributes printed by the AsmPrinter were
inconsistent with those computed in the subtarget.
Also remove DevName field from subtarget since it's redundant
with getCPU() in the superclass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258901
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 27 Jan 2016 01:52:46 +0000 (01:52 +0000)]
[cmake] Remove /Og- flag which was working around PR24785
With r258897, MSVC 2013 now successfully compiles Function.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258899
91177308-0d34-0410-b5e6-
96231b3b80d8
Yunzhong Gao [Wed, 27 Jan 2016 01:48:20 +0000 (01:48 +0000)]
Add "/dev/tty" as a special file name for lit tests.
If a lit test has a RUN line that includes a redirection to "/dev/tty", the
redirection goes to the special device file corresponding to the console. It
is /dev/tty on UNIX-like systems and "CON" on Windows.
This patch is needed to implement a test like PR25717 (caused by the size limit
of the Windows system call WriteConsole() prior to Windows 8) where the test
only breaks when outputing to the console and won't fail if using a pipe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258898
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 27 Jan 2016 01:43:12 +0000 (01:43 +0000)]
[llvm-tblgen] Avoid StringMatcher for GCC and MS builtin names
This brings the compile time of Function.cpp from ~40s down to ~4s for
me locally. It also shaves off about 400KB of object file size in a
release+asserts build.
I also realized that the AMDGPU backend does not have any GCC builtin
names to match, so the extra lookup was a no-op. I removed it to silence
a zero-length string table array warning. There should be no functional
change here.
This change really ends the story of PR11951.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258897
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 27 Jan 2016 01:37:52 +0000 (01:37 +0000)]
[WebAssembly] Add a test for the mem-intrinsic code in WebAssemblyPeephole.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258895
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 27 Jan 2016 00:19:05 +0000 (00:19 +0000)]
test-release.sh: Ignore LC_CTYPE in sed invocation on Darwin
Here, sed is used to prepare object files for comparison via cmp. On my Darwin
15.4.0 machine, LC_CTYPE is set to UTF-8 (by default, I believe). Under these
circumstances, anything sed is made to read will be treated as UTF-8, prompting
it to signal an error if it is not, like so:
% sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $?
sed: RE error: illegal byte sequence
1
%
To make sed work as expected, I need to set LC_CTYPE to C:
% env LC_CTYPE=C sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $?
0
%
Without this change, sed will exit with an error for every single file that it
compares between phase 2 and phase 3, thereby making it look as if the
differences were far larger than they are.
Patch by Elias Pipping!
Differential Revision: http://reviews.llvm.org/D16548
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258891
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 27 Jan 2016 00:13:39 +0000 (00:13 +0000)]
[PGO] Make header portable for C /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258889
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Tue, 26 Jan 2016 23:51:06 +0000 (23:51 +0000)]
Disable all standard lib functions for NVVM.
Summary:
NVVM doesn't have a standard library, as currently implemented, so this
just isn't going to work. I'd like to revisit this, since it's hiding
opportunities for optimization, but correctness comes first.
Thank you to hfinkel for pointing me in the right direction here.
Reviewers: tra
Subscribers: echristo, jhen, llvm-commits, hfinkel
Differential Revision: http://reviews.llvm.org/D16604
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258884
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 26 Jan 2016 23:43:37 +0000 (23:43 +0000)]
Fix identify_magic() to check that a file that starts with MH_MAGIC is
at least as big as the mach header to be identified as a Mach-O file and
make sure smaller files are not identified as a Mach-O files but as
unknown files. Also fix identify_magic() so it looks at all 4 bytes of
the filetype field when determining the type of the Mach-O file.
Then fix the macho-invalid-header test case to check that it is an
unknown file and make sure it does not get the error for
object_error::parse_failed. And also update the unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258883
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 26 Jan 2016 23:43:16 +0000 (23:43 +0000)]
[GVN] Split AvailableValueInBlock into two parts [NFC]
AvailableValue is the part that represents the potential rematerialization. AvailableValueInBlock is simply a pair of an AvailableValue and a BB which we might materialize it in.
This is motivated by http://reviews.llvm.org/D16608. The intent is that we'll have a single function which handles the local case which both local and non-local will use to identify available values. Once that's done, the local case can rematerialize at the use site and the non-local case can do the SSA construction as it does currently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258882
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 26 Jan 2016 23:26:25 +0000 (23:26 +0000)]
[docs] Fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258878
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Tue, 26 Jan 2016 23:13:00 +0000 (23:13 +0000)]
[PGO] allow pgo name collector to disable compression (for testing)/NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258876
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 26 Jan 2016 23:01:21 +0000 (23:01 +0000)]
[llvm-tblgen] Stop emitting the intrinsic name matching code
The AMDGPU backend was the last user of the old StringMatcher
recognition code. Move it over to the new lookupLLVMIntrinsicName
funciton, which is now improved to handle all of the interesting edge
cases exposed by AMDGPU intrinsic names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258875
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 26 Jan 2016 22:53:12 +0000 (22:53 +0000)]
Fixing the documentation builds
I broke the documentation builds when I deleted the MakefileGuide as part of the autoconf removal. At some point I'll need to do a more in-depth pass updating the documentation to remove references to the old build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258873
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Tue, 26 Jan 2016 22:47:43 +0000 (22:47 +0000)]
[WebAssembly] Omit no-op adds for non-mem uses of FrameIndex
Differential Revision: http://reviews.llvm.org/D16554
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258872
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 26 Jan 2016 22:33:19 +0000 (22:33 +0000)]
Handle more edge cases in intrinsic name binary search
I tried to make the AMDGPU intrinsic info table use this instead of
another StringMatcher, and some issues arose.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258871
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 26 Jan 2016 22:19:22 +0000 (22:19 +0000)]
[X86][SSE] Added 8i8 to 8i64 sext/zext tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258868
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 22:08:58 +0000 (22:08 +0000)]
[x86] make the subtarget member a const reference, not a pointer ; NFCI
It's passed in as a reference; it's not optional; it's not a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258867
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 26 Jan 2016 21:39:25 +0000 (21:39 +0000)]
[X86] Add support for zeroed shuffle elements to getShuffleScalarElt
Enable handling of SM_SentinelZero shuffle elements to getShuffleScalarElt. Improves VZEXT_LOAD matches in EltsFromConsecutiveLoads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258865
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 26 Jan 2016 21:29:08 +0000 (21:29 +0000)]
Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html
"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi
Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark
Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D16471
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258861
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Tue, 26 Jan 2016 21:08:27 +0000 (21:08 +0000)]
[WebAssembly] Remove check for FrameIndex operands in WebAssemblyPeephole
This pass runs after FrameIndex elimination, so it should never see FI
operands. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258860
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 21:05:00 +0000 (21:05 +0000)]
[x86] add materializeVectorConstant() helper function; NFC
LowerBUILD_VECTOR is still over 300 lines long, but it's a start...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258858
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Tue, 26 Jan 2016 20:38:15 +0000 (20:38 +0000)]
Fix comparison warning (r258845)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258856
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Tue, 26 Jan 2016 20:28:15 +0000 (20:28 +0000)]
Fixes build break introduced by r258845
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258854
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 26 Jan 2016 20:24:51 +0000 (20:24 +0000)]
WebAssembly NFC: update error message
I forgot to update this one in my previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258853
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 26 Jan 2016 20:22:42 +0000 (20:22 +0000)]
WebAssembly: don't optimize memcpy/memmove/memcpy to frame index
r258781 optimized memcpy/memmove/memcpy so the intrinsic call can return its first argument, but missed the frame index case. Teach it to ignore that case so C code doesn't assert out in these cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258851
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 26 Jan 2016 20:09:38 +0000 (20:09 +0000)]
Add a missing test case for r258847.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258848
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 26 Jan 2016 20:08:01 +0000 (20:08 +0000)]
Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.
Currently, AnalyzeBranch() fails non-equality comparison between floating points
on X86 (see https://llvm.org/bugs/show_bug.cgi?id=23875). This is because this
function can modify the branch by reversing the conditional jump and removing
unconditional jump if there is a proper fall-through. However, in the case of
non-equality comparison between floating points, this can turn the branch
"unanalyzable". Consider the following case:
jne.BB1
jp.BB1
jmp.BB2
.BB1:
...
.BB2:
...
AnalyzeBranch() will reverse "jp .BB1" to "jnp .BB2" and then "jmp .BB2" will be
removed:
jne.BB1
jnp.BB2
.BB1:
...
.BB2:
...
However, AnalyzeBranch() cannot analyze this branch anymore as there are two
conditional jumps with different targets. This may disable some optimizations
like block-placement: in this case the fall-through behavior is enforced even if
the fall-through block is very cold, which is suboptimal.
Actually this optimization is also done in block-placement pass, which means we
can remove this optimization from AnalyzeBranch(). However, currently
X86::COND_NE_OR_P and X86::COND_NP_OR_E are not reversible: there is no defined
negation conditions for them.
In order to reverse them, this patch defines two new CondCode X86::COND_E_AND_NP
and X86::COND_P_AND_NE. It also defines how to synthesize instructions for them.
Here only the second conditional jump is reversed. This is valid as we only need
them to do this "unconditional jump removal" optimization.
Differential Revision: http://reviews.llvm.org/D11393
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258847
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 26 Jan 2016 19:57:42 +0000 (19:57 +0000)]
[llvm-nm] Roll several conditions into a single if. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258846
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Tue, 26 Jan 2016 19:46:39 +0000 (19:46 +0000)]
[llvm-readobj] Add -elf-section-groups option
Adds a way to inspect SHT_GROUP sections in ELF objects.
Displays signature, member sections of these sections.
Differential revision: http://reviews.llvm.org/D16555
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258845
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 26 Jan 2016 19:33:57 +0000 (19:33 +0000)]
[ScheduleDAGInstrs] Simplify logic to improve readability. NFC.
The call to isInvariantLoad() already returns false for non-load instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258841
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 19:30:14 +0000 (19:30 +0000)]
tidy up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258838
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 26 Jan 2016 19:28:51 +0000 (19:28 +0000)]
[llvm-nm] Simplify. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258837
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 18:49:36 +0000 (18:49 +0000)]
[x86] simplify getOnesVector() ; NFCI
Let DAG.getConstant() handle the splatting; there's no need
to repeat that logic here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258833
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Tue, 26 Jan 2016 18:48:36 +0000 (18:48 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831
91177308-0d34-0410-b5e6-
96231b3b80d8
Aditya Nandakumar [Tue, 26 Jan 2016 18:42:36 +0000 (18:42 +0000)]
Reassociate: Reprocess RedoInsts after each inst
Previously the RedoInsts was processed at the end of the block.
However it was possible that it left behind some instructions that
were not canonicalized.
This should guarantee that any previous instruction in the basic
block is canonicalized before we process a new instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258830
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 18:22:50 +0000 (18:22 +0000)]
[x86, AVX] tighten checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258828
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 26 Jan 2016 18:21:38 +0000 (18:21 +0000)]
Update wasm target for r258819.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258827
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 26 Jan 2016 18:20:49 +0000 (18:20 +0000)]
Update the comments for the macho-invalid-zero-ncmds test and fix
llvm-objdump when printing the Mach Header to print the unknown
cputype and cpusubtype fields as decimal instead of not printing
them at all. And change the test to check for that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258826
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 18:14:37 +0000 (18:14 +0000)]
fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258825
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 17:06:13 +0000 (17:06 +0000)]
don't repeat names in documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258820
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 26 Jan 2016 16:44:37 +0000 (16:44 +0000)]
Reflect the MC/MCDisassembler split on the include/ level.
No functional change, just moving code around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258818
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 26 Jan 2016 16:17:24 +0000 (16:17 +0000)]
[LibCallSimplifier] fold memset(malloc(x), 0, x) --> calloc(1, x)
This is a step towards solving PR25892:
https://llvm.org/bugs/show_bug.cgi?id=25892
It won't handle the reported case. As noted by the 'TODO' comments in the patch,
we need to relax the hasOneUse() constraint and also match patterns that include
memset_chk() and the llvm.memset() intrinsic in addition to memset().
Differential Revision: http://reviews.llvm.org/D16337
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258816
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Tue, 26 Jan 2016 15:45:49 +0000 (15:45 +0000)]
Revert "Reapply commit r258404 with fix"
This commit exposes a crash in computeKnownBits on the Chromium buildbots.
Reverting to investigate.
Reference: https://llvm.org/bugs/show_bug.cgi?id=26307
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258812
91177308-0d34-0410-b5e6-
96231b3b80d8