Commit Graph

265706 Commits

Author SHA1 Message Date
Saleem Abdulrasool da6784e8ff CodeGen: load indirect ObjC ARC arguments in prologue
When generating a prologue, add loads for ARC arguments passed
indirectly.

Patch by Dave Lee!

llvm-svn: 306444
2017-06-27 18:37:51 +00:00
Krzysztof Parzyszek 5ddd2e5899 [Hexagon] Update kills in hexagon-nvj even more properly than before
Account for the fact that both, the feeder and the compare can be moved
over instructions that kill registers.

llvm-svn: 306443
2017-06-27 18:37:16 +00:00
Nico Weber 205519b97e [libunwind] Add _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS
It's useful to be able to disable visibility annotations entirely; for
example, if we're building libunwind static to include in another library,
and we don't want any libunwind functions getting exported out of that
library.

https://reviews.llvm.org/D34637
Patch from Thomas Anderson <thomasanderson@chromium.org>!

llvm-svn: 306442
2017-06-27 18:37:06 +00:00
Matt Arsenault 836d786e86 RenameIndependentSubregs: Fix infinite loop
Apparently this replacement can really be substituting the
same as the original register. Avoid restarting the loop
when there's been no change in the register uses.

llvm-svn: 306441
2017-06-27 18:28:10 +00:00
Yaxun Liu 7c44f340de [SROA] Fix APInt size when alloca address space is not 0
SROA assumes alloca address space is 0, which causes assertion. This patch fixes that.

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

llvm-svn: 306440
2017-06-27 18:26:06 +00:00
Stanislav Mekhanoshin 6851ddf942 [AMDGPU] Combine and x, (sext cc from i1) => select cc, x, 0
Also factored out function to check if a boolean is an already
deserialized value which does not require v_cndmask_b32 to be
loaded. Added binary logical operators to its check.

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

llvm-svn: 306439
2017-06-27 18:25:26 +00:00
Sanjay Patel 9a4ce0cc1c [CGP] add an IR builder to memcmp expansion class instead of recreating it; NFCI
This was a clean-up suggestion from:
https://reviews.llvm.org/D34005

llvm-svn: 306438
2017-06-27 18:18:42 +00:00
Jakub Kuderski 59ee5735ba [Dominators] Use Semi-NCA instead of SLT to calculate dominators
Summary:
This patch makes GenericDomTreeConstruction use the Semi-NCA algorithm instead of Simple Lengauer-Tarjan.

As described in `RFC: Dynamic dominators`, Semi-NCA offers slightly better performance than SLT. What's more important, it can be extended to perform incremental updates on already constructed dominator trees.

The patch passes check-all, llvm test suite and is able to boostrap clang. I also wasn't able to observe any compilation time regressions.

Reviewers: sanjoy, dberlin, chandlerc, grosser

Reviewed By: dberlin

Subscribers: llvm-commits

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

llvm-svn: 306437
2017-06-27 18:08:53 +00:00
Matthias Braun a6e77405d0 LiveRangeCalc: Slightly improve map usage; NFC
- DenseMap should be faster than std::map
- Use the `InsertRes = insert() if (!InsertRes.inserted)` pattern rather
  than the `if (!X.contains(...)) { X.insert(...); }` to save one map
  lookup.

llvm-svn: 306436
2017-06-27 18:05:26 +00:00
Sanjay Patel 7227276d41 [InstCombine] canonicalize icmp predicate feeding select
This canonicalization was suggested in D33172 as a way to make InstCombine behavior more uniform. 
We have this transform for icmp+br, so unless there's some reason that icmp+select should be 
treated differently, we should do the same thing here.

The benefit comes from increasing the chances of creating identical instructions. This is shown in
the tests in logical-select.ll (PR32791). InstCombine doesn't fold those directly, but EarlyCSE 
can simplify the identical cmps, and then InstCombine can fold the selects together.

The possible regression for the tests in select.ll raises questions about poison/undef:
http://lists.llvm.org/pipermail/llvm-dev/2017-May/113261.html

...but that transform is just as likely to be triggered by this canonicalization as it is to be 
missed, so we're just pointing out a commutation deficiency in the pattern matching:
https://reviews.llvm.org/rL228409

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

llvm-svn: 306435
2017-06-27 17:53:22 +00:00
Dehao Chen 874bc749a2 Update the test comment to clarify the intention of the test.
llvm-svn: 306434
2017-06-27 17:45:40 +00:00
Sanjay Patel d53f6a8980 [x86] weaken test checks that shouldn't be here in the first place
This test would fail after the proposed change in:
https://reviews.llvm.org/D34242

llvm-svn: 306433
2017-06-27 17:39:46 +00:00
Xinliang David Li 967669f6c1 [PGO] Refactor file/buffer writer callback interfaces /NFC
Introduces a 'owner' struct to include the overridable write
method and the write context in C.

This allows easy introdution of new member API to help reduce
profile merge time in the follow up patch.

llvm-svn: 306432
2017-06-27 17:28:01 +00:00
Francis Ricci 07fa7942fd Revert "Only test sanitizers that are built when COMPILER_RT_SANITIZERS_TO_BUILD is used"
This breaks cfi testing in cases when the cfi runtime isn't built.

This reverts commit 1c6a7b07545f0c9ce68e8b226f5397694ce48af7.

llvm-svn: 306431
2017-06-27 17:24:26 +00:00
Dehao Chen bc8c7dc054 Update test for enabling ICP for AutoFDO.
Summary: This is the test update patch for https://reviews.llvm.org/D34662

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: cfe-commits, sanjoy, mehdi_amini, eraman, llvm-commits

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

llvm-svn: 306430
2017-06-27 17:23:42 +00:00
Dehao Chen 66131665c4 Enable ICP for AutoFDO.
Summary: AutoFDO should have ICP enabled.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: sanjoy, mehdi_amini, llvm-commits

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

llvm-svn: 306429
2017-06-27 17:23:33 +00:00
Xinliang David Li d6f10a62c6 [ProfData] Make the method threadsafe
llvm-svn: 306428
2017-06-27 17:21:51 +00:00
Craig Topper 9512332bcb [InstCombine] Add test case demonstrating that we don't propagate nsw flag when converting mul by pow2 to shl when the type is larger than 64-bits. NFC
llvm-svn: 306427
2017-06-27 17:16:03 +00:00
Craig Topper d068fb8104 [InstCombine] Add test cases to show that we don't propagate 'nsw' flags when converting mul by pow2 constant to shl for splat vectors. NFC
llvm-svn: 306426
2017-06-27 17:16:01 +00:00
Coby Tayree 41a5b55f50 [X86][AsmParser][MS-compatability] Binary/Unary operators enhancements
Introducing MOD binary operator
https://msdn.microsoft.com/en-us/library/hha180wt.aspx

Enhancing unary operators NEG and NOT, to support more complex patterns

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

llvm-svn: 306425
2017-06-27 16:58:27 +00:00
Javed Absar d9cc8fbcd3 Fix incorrect comment in machine-scheduler
The example code incorrectly invokes ScheduleDAGMI wherein from context
it is clear it intends to invoke ScheduleDAGMILive actually.

Reviewed by: Andrew Trick
Differential Revision: https://reviews.llvm.org/D34675

llvm-svn: 306424
2017-06-27 16:49:45 +00:00
Brian Gesiak 9473db43b6 [opt-viewer] Python 3 support in opt-diff.py
Summary:
The `file()` builtin is not available in Python 3; use `open()` instead.
https://docs.python.org/3.0/whatsnew/3.0.html#builtins

Reviewers: anemet, davidxl, davide

Reviewed By: davide

Subscribers: davide, fhahn, llvm-commits

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

llvm-svn: 306423
2017-06-27 16:46:50 +00:00
David Green 22322fb638 Change sort function used in tblgen to be strict weak ordering
The windows debug is failing as the sort function is not strict
weak ordering, so switch a >= to a >.

llvm-svn: 306422
2017-06-27 16:28:44 +00:00
Haojian Wu 7663debbe3 [clang-tidy] Handle new array expressions in modernize-make-unique check.
Reviewers: alexfh

Reviewed By: alexfh

Subscribers: JDevlieghere, xazax.hun, cfe-commits

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

llvm-svn: 306421
2017-06-27 16:25:05 +00:00
Chih-Hung Hsieh ff680f0386 Another test commit
llvm-svn: 306420
2017-06-27 16:18:41 +00:00
Alexey Bataev 5d1c3f6add [OPENMP] Use MapVector instead of DenseMap for stable codegen, NFC.
llvm-svn: 306419
2017-06-27 15:46:42 +00:00
Paul Robinson d66ee0f9a7 [DWARF] NFC: Make string-offset handling more like address-table handling;
do the indirection and relocation all in the same method.

llvm-svn: 306418
2017-06-27 15:40:18 +00:00
Craig Topper 81cbb0c237 [PatternMatch] Remove 64-bit or less restriction from m_SpecificInt
Not sure why this restriction existed, but it seems like we should support any size Constant here.

The particular pattern in the tests is not the only use of this matcher in the tree. There's one in CodeGenPrepare and one in InstSimplify as well.

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

llvm-svn: 306417
2017-06-27 15:39:40 +00:00
Craig Topper 0a60d85811 [JumpThreading] Add test case that was supposed to go with r306085.
Looks like I forgot to 'git add' when I submitted the commit. Thanks to Chandler for noticing.

llvm-svn: 306416
2017-06-27 15:26:47 +00:00
Francis Ricci 80296ee7f3 Only test sanitizers that are built when COMPILER_RT_SANITIZERS_TO_BUILD is used
Summary: This allows check-all to be used when only a subset of the sanitizers are built.

Reviewers: beanz, compnerd

Subscribers: llvm-commits, mgorny

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

llvm-svn: 306415
2017-06-27 15:22:56 +00:00
Gadi Haber 13759a7ed6 Updated and extended the information about each instruction in HSW and SNB to include the following data:
•static latency
•number of uOps from which the instructions consists
•all ports used by the instruction

Reviewers: 
 RKSimon 
 zvi  
aymanmus  
m_zuckerman 

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

llvm-svn: 306414
2017-06-27 15:05:13 +00:00
Sam Kolton a179d25b99 [AMDGPU] SDWA: several fixes for V_CVT and VOPC instructions
Summary:
1. Instruction V_CVT_U32_F32 allow omod operand (see SIInstrInfo.td:1435). In fact this operand shouldn't be allowed here. This fix checks if SDWA pseudo instruction has OMod operand and then copy it.
2. There were several problems with support of VOPC instructions in SDWA peephole pass.

Reviewers: tstellar, arsenm, vpykhtin, airlied, kzhuravl

Subscribers: wdng, nhaehnle, yaxunl, dstuttard, tpr, sarnex, t-tye

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

llvm-svn: 306413
2017-06-27 15:02:23 +00:00
Matthew Simpson 0bd79f416a [AArch64] Update successor probabilities after ccmp-conversion
This patch modifies the conditional compares pass so that it keeps successor
probabilities up-to-date after the conversion. Previously, successor
probabilities were being normalized to a uniform distribution, even though they
may have been heavily biased prior to the conversion (e.g., if one of the edges
was the back edge of a loop). This loss of information affected passes later in
the pipeline.

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

llvm-svn: 306412
2017-06-27 15:00:22 +00:00
Francis Ricci 2189fe1870 [tsan] Add missing include directory for test unittests
Summary: Required to fix standalone builds in some configurations

Reviewers: kubamracek, zaks.anna

Subscribers: mgorny, llvm-commits

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

llvm-svn: 306411
2017-06-27 14:56:59 +00:00
Anna Thomas dc935a6eb6 [LoopUnrollRuntime] Use SCEV exit count for calculating trip count. NFCI
Instead of getBackEdgeTakenCount, use getExitCount on the latch exiting block
(which is proven to be the only exiting block in the loop to be unrolled).

llvm-svn: 306410
2017-06-27 14:14:35 +00:00
Krasimir Georgiev 3d4c8127a7 [clang-format] Fix a clang-tidy warning, NFC
llvm-svn: 306409
2017-06-27 14:07:45 +00:00
Krasimir Georgiev 0b41fcb6b7 [clang-format] Fix a buildbot failure after r306406
llvm-svn: 306408
2017-06-27 13:58:41 +00:00
Krasimir Georgiev ff747be4d5 [clang-format] Support <>-style proto message fields
Summary:
This patch adds support for <>-style proto message fields inside proto options.
Previously these were wrongly treated as binary operators and as such were
working only by chance for a limited number of cases.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 306406
2017-06-27 13:43:07 +00:00
Simon Dardis 4155c8f1f3 [mips] Add instruction aliases for ds(r|l)l.
Add the instruction aliases for ds(r|l)l for the two operand alias
of ds(r|l)lv and the aliases ds(r|l)l with the three register operands.

llvm-svn: 306405
2017-06-27 13:35:17 +00:00
Hiroshi Inoue 84aafee4fb [SelectionDAG] set dereferenceable flag in MergeConsecutiveStores to fix assetion failure
When SelectionDAG merges consecutive stores and loads in MergeConsecutiveStores, it does not set dereferenceable flag for a created load instruction. This results in an assertion failure if SelectionDAG commonizes this load instruction with other load instructions, as well as it may miss optimization opportunities.

This patch sat dereferenceable flag for the newly created load instruction if all the load instructions to be merged are dereferenceable.

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

llvm-svn: 306404
2017-06-27 12:43:08 +00:00
Ed Maste 87b0ab1f99 Sort lit.cfg architectures
From Mark Kettenis in review D34618.

llvm-svn: 306403
2017-06-27 12:21:50 +00:00
Ayman Musa 721d97f7b8 Recommitting rL305465 after fixing bug in TableGen in rL306251 & rL306371
[X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift left+right instructions).

AVX512 compare instructions return v*i1 types.
In cases where the number of elements in the returned value are less than 8, clang adds zeroes to get a mask of v8i1 type.
Later on it's replaced with CONCAT_VECTORS, which then is lowered to many DAG nodes including insert/extract element and shift right/left nodes.
The fact that AVX512 compare instructions put the result in a k register and zeroes all its upper bits allows us to remove the extra nodes simply by copying the result to the required register class.

When lowering, identify these cases and transform them into an INSERT_SUBVECTOR node (marked legal), then catch this pattern in instructions selection phase and transform it into one avx512 cmp instruction.

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

llvm-svn: 306402
2017-06-27 12:08:37 +00:00
Pavel Labath 7396ee923e Fix windows build for the Connection move
llvm-svn: 306400
2017-06-27 11:45:32 +00:00
Vassil Vassilev 8da30a79cd Add missing include. Should fix modules libstdc++ builds.
llvm-svn: 306399
2017-06-27 11:45:26 +00:00
Andreas Simbuerger dbb0ef8e94 [NFC][CodeGen] Use the ExitBlock explicitly.
Before we would 'guess' the correct location for the MergeBlock
that got introduced when executing a Scop conditionally. This
implicitly depends on the situation that at this point during
CodeGen there will be nothing between polly.start and polly.exiting.

With this commit we explicitly state that we want the block that
directly follows polly.exiting.

llvm-svn: 306398
2017-06-27 11:33:22 +00:00
Pavel Labath cdda23eb7c Add debug_frame section support
Summary:
This is a beefed-up version of D33504, which adds support for dwarf 4
debug_frame section format.

The main difference here is that the decision whether to use eh_frame or
debug_frame is done on a per-function basis instead of per-object file.
This is necessary because one module can contain both sections (for
example, the start files added by the linker will typically pull in
eh_frame), but we want to be able to access both, for maximum
information.

I also add unit test for parsing various CFI formats (eh_frame,
debug_frame v3 and debug_frame v4).

Reviewers: jasonmolenda, clayborg

Subscribers: mgorny, aprantl, abidh, lldb-commits, tatyana-krasnukha

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

llvm-svn: 306397
2017-06-27 11:16:26 +00:00
Artem Dergachev 7caff0e9e1 [analyzer] Move zero-size allocation checks to optin.portability.
This is a new checker package. It contains checkers that highlight
well-documented implementation-defined behavior. Such checkers are only useful
to developers that intend to write portable code. Code that is only compiled for
a single platform should be allowed to rely on this platform's specific
documented behavior.

rdar://problem/30545046

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

llvm-svn: 306396
2017-06-27 11:14:39 +00:00
Andreas Simbuerger 4e6eed8566 [FIX] Add %loadPolly to test
This test fails, if polly is not linked into LLVM's tools. Our
lit site-config already deals with this by not adding the -load
option, if polly is linked into LLVM's tools.

llvm-svn: 306395
2017-06-27 10:47:55 +00:00
Pavel Labath f2a8bccf85 Move StructuredData from Core to Utility
Summary:
It had a dependency on StringConvert and file reading code, which is not
in Utility. I've replaced that code by equivalent llvm operations.

I've added a unit test to demonstrate that parsing a file still works.

Reviewers: zturner, jingham

Subscribers: kubamracek, mgorny, lldb-commits

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

llvm-svn: 306394
2017-06-27 10:45:31 +00:00
Hiroshi Inoue 6a391bbf40 fix trivial typos, NFC
succesor -> successor

llvm-svn: 306393
2017-06-27 10:35:37 +00:00