Commit Graph

151023 Commits

Author SHA1 Message Date
Rafael Espindola
c9c63328af clang-format a file.
It had a few inconsistent indentations that made a followup patch
hard to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 22:14:20 +00:00
Dehao Chen
c9d2291c96 re-commit r306336: Enable vectorizer-maximize-bandwidth by default.
Differential Revision: https://reviews.llvm.org/D33341


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 22:05:58 +00:00
Eugene Zelenko
01187b342a [Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306472 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 21:52:05 +00:00
Sanjay Patel
ca9df19568 [CGP] eliminate a sub instruction in memcmp expansion
As noted in D34071, there are some IR optimization opportunities that could be 
handled by normal IR passes if this expansion wasn't happening so late in CGP.

Regardless of that, it seems wasteful to knowingly produce suboptimal IR here, 
so I'm proposing this change:
  %s = sub i32 %x, %y
  %r = icmp ne %s, 0
    =>
  %r = icmp ne %x, %y

Changing the predicate to 'eq' mimics what InstCombine would do, so that's just
an efficiency improvement if we decide this expansion should happen sooner.

The fact that the PowerPC backend doesn't eliminate the 'subf.' might be 
something for PPC folks to investigate separately.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 21:46:34 +00:00
Tim Northover
96470fe7e9 GlobalISel: verify that a COPY is trivial when created.
Without this check, COPY instructions can actually be one of the generic casts
in disguise. That's confusing and bad.

At some point during ISel this restriction has to be relaxed since the fully
selected instructions will usually use COPY for those purposes. Right now I
think it's possible that relaxation occurs during RegBankSelect (hence the
change there). I'm not convinced that's where it belongs long-term though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 21:41:40 +00:00
Xinliang David Li
d1357b6fb2 Clean up a test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 21:35:49 +00:00
Krzysztof Parzyszek
a432d58a0f Create a PHI value when merging with a known undef live-in
Differential Revision: https://reviews.llvm.org/D34640


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 21:30:46 +00:00
Sam Clegg
3279867fce [WebAssembly] Only run WebAssembly objdump tests if it is enabled as a target
Differential Revision: https://reviews.llvm.org/D34712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 21:19:27 +00:00
Joel Jones
5cc4d23410 [AArch64] Performance enhancements for Cavium ThunderX2 T99
This patch enables significant performance enhancements to the
Cavium ThunderX2T99 LLVM backend, as observed by running SPEC2K6,
by adding more detailed scheduling information.

Related Bugzilla bug: http://bugs.llvm.org/show_bug.cgi?id=32562

Patch by: steleman

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306462 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 20:44:55 +00:00
Sam Clegg
08da5c5be5 [WebAssembly] Add support for printing relocations with llvm-objdump
Differential Revision: https://reviews.llvm.org/D34658

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 20:40:53 +00:00
Sam Clegg
49ab5d5992 [WebAssembly] Add data size and alignement to linking section
The overal size of the data section (including BSS)
is otherwise not included in the wasm binary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 20:27:59 +00:00
Krzysztof Parzyszek
f4a2d1d749 [Hexagon] Use proper predicate register state when expanding PS_vselect
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 19:59:46 +00:00
Craig Topper
ea86c526fb [InstCombine] Propagate nsw flag when turning mul by pow2 into shift when the constant is a vector splat or the scalar bit width is larger than 64-bits
The check to see if we can propagate the nsw flag used m_ConstantInt(uint64_t*&) which doesn't work with splat vectors and has a restriction that the bitwidth of the ConstantInt must be 64-bits are less.

This patch changes it to use m_APInt to remove both these issues

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 19:57:53 +00:00
Craig Topper
aa9b82348c [Constants] Fix copy-pasto in llvm_unreachable message. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 19:57:51 +00:00
Sanjay Patel
6891a99c36 [CGP] simplify code to get bswap in memcmp expansion; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306452 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 19:31:35 +00:00
Stanislav Mekhanoshin
040f338ab8 [AMDGPU] Add 2 new alignbit patterns
Differential Revision: https://reviews.llvm.org/D34655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 19:10:47 +00:00
Serge Guelton
3f92d751f7 [CodeExtractor] Prevent extraction of block involving blockaddress
BlockAddress are only valid within their function context, which does not
interact well with CodeExtractor. Detect this case and prevent it.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:57:53 +00:00
Stanislav Mekhanoshin
e764e24028 [AMDGPU] Simplify setcc (sext from i1 b), -1|0, cc
Depending on the compare code that can be either an argument of
sext or negate of it. This helps to avoid v_cndmask_b64 instruction
for sext. A reversed value can be further simplified and folded into
its parent comparison if possible.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:53:03 +00:00
Krzysztof Parzyszek
ecf693d535 [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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:37:16 +00:00
Matt Arsenault
d841eae40b 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306441 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:28:10 +00:00
Yaxun Liu
197bda6635 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:26:06 +00:00
Stanislav Mekhanoshin
e2d935510c [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:25:26 +00:00
Sanjay Patel
cfc8374c45 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:18:42 +00:00
Jakub Kuderski
3d019d384a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306437 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:08:53 +00:00
Matthias Braun
41308c99e9 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306436 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 18:05:26 +00:00
Sanjay Patel
32f1f18b64 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 17:53:22 +00:00
Dehao Chen
c02a794b92 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 17:23:33 +00:00
Xinliang David Li
65340be3b4 [ProfData] Make the method threadsafe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 17:21:51 +00:00
Craig Topper
423b99d025 [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306427 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 17:16:03 +00:00
Craig Topper
e6fcc9052a [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 17:16:01 +00:00
Coby Tayree
dd03b34042 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 16:58:27 +00:00
Javed Absar
d253a7278c 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 16:49:45 +00:00
Brian Gesiak
5925f31308 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 16:46:50 +00:00
David Green
5aa56b280d 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 >.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 16:28:44 +00:00
Chih-Hung Hsieh
f521444e80 Another test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 16:18:41 +00:00
Paul Robinson
9896afe6bf [DWARF] NFC: Make string-offset handling more like address-table handling;
do the indirection and relocation all in the same method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 15:40:18 +00:00
Craig Topper
0c8e44ed16 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 15:39:40 +00:00
Craig Topper
0c15ad3a8c [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 15:26:47 +00:00
Gadi Haber
d88e02ecb7 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
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 15:05:13 +00:00
Sam Kolton
06ed4a14fd [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 15:02:23 +00:00
Matthew Simpson
64db11515a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306412 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 15:00:22 +00:00
Anna Thomas
383b68fd7f [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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 14:14:35 +00:00
Simon Dardis
962d3674b2 [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 13:35:17 +00:00
Hiroshi Inoue
903642ae3c [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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 12:43:08 +00:00
Ayman Musa
ae1022198b 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306402 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 12:08:37 +00:00
Vassil Vassilev
d954633ce2 Add missing include. Should fix modules libstdc++ builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 11:45:26 +00:00
Hiroshi Inoue
0df653a65e fix trivial typos, NFC
succesor -> successor



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 10:35:37 +00:00
Diana Picus
a2474d43c4 [ARM] GlobalISel: Support G_SELECT for pointers
All we need to do is mark it as legal, otherwise it's just like s32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 10:29:50 +00:00
Simon Pilgrim
915fe39cd1 [X86][AVX512] Regenerate avx512 arithmetic tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 10:13:56 +00:00
Daniel Sanders
3f723360ab [globalisel][tablegen] Add support for EXTRACT_SUBREG.
Summary:
After this patch, we finally have test cases that require multiple
instruction emission.

Depends on D33590

Reviewers: ab, qcolombet, t.p.northover, rovka, kristof.beyls

Subscribers: javed.absar, llvm-commits, igorb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306388 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 10:11:39 +00:00