OSDN Git Service
Chandler Carruth [Wed, 4 Jan 2017 11:13:11 +0000 (11:13 +0000)]
[ADT] Enhance the PriorityWorklist to support bulk insertion.
This is both convenient and more efficient as we can skip any
intermediate reallocation of the vector.
This usage pattern came up in a subsequent patch on the pass manager,
but it seems generically useful so I factored it out and added unittests
here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290952
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Wed, 4 Jan 2017 09:41:56 +0000 (09:41 +0000)]
Fix for InlineSpiller accessing not updated dom tree base information.
Summary:
The InlineSpiller was accessing the DominatorTreeBase directly
through the public data member DT in the MachineDominatorTree.
This is not a good idea as the "cached" information in
SplitCriticalEdges is not applied before the access.
The DominatorTreeBase must be accessed through the member
function getBase() in MachineDominatorTree.
The fault was introduced in r266162.
I think the public data member DT in the MachineDominatorTree
should have been made private in the original code (r215576)
that introduced the concept of lazily updating the
MachineDominatorTree information from
MachineBasicBlock::SplitCriticalEdge().
Patch by Karl-Johan Karlsson <karl-johan.karlsson@ericsson.com>
Reviewers: wmi, qcolombet
Subscribers: llvm-commits, bjope, uabelho
Differential Revision: https://reviews.llvm.org/D27983
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290950
91177308-0d34-0410-b5e6-
96231b3b80d8
Nitesh Jain [Wed, 4 Jan 2017 09:34:37 +0000 (09:34 +0000)]
[LLC][MIPS] Fix crash after enabling LLVM_ENABLE_EXPENSIVE_CHECKS
Reviewers: sdardis, vkalintiris
Subscribers: jaydeep, slthakur, RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D27841
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290949
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Wed, 4 Jan 2017 08:21:54 +0000 (08:21 +0000)]
[X86][AVX512] Passing the appropriate memory operand class to INT_{U}COMIS{S|D} instructions
Replacing the memory operand in the intrinsic versions of the comis/ucomis instrucions from f128mem to ssmem/sdmem accordingly.
Differential Revision: https://reviews.llvm.org/D28138
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290948
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 4 Jan 2017 08:05:42 +0000 (08:05 +0000)]
[X86] Attempt to pre-truncate arithmetic operations if useful
In some cases its more efficient to combine TRUNC( BINOP( X, Y ) ) --> BINOP( TRUNC( X ), TRUNC( Y ) ) if the binop is legal for the truncated types.
This is true for vector integer multiplication (especially vXi64), as well as ADD/AND/XOR/OR in cases where we only need to truncate one of the inputs at runtime (e.g. a duplicated input or an one use constant we can fold).
Further work could be done here - scalar cases (especially i64) could often benefit (if we avoid partial registers etc.), other opcodes, and better analysis of when truncating the inputs reduces costs.
I have considered implementing this for all targets within the DAGCombiner but wasn't sure we could devise a suitable cost model system that would give us the range we need.
Differential Revision: https://reviews.llvm.org/D28219
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290947
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Jan 2017 07:32:03 +0000 (07:32 +0000)]
[AVX-512] Add support for detecting 512-bit shuffles that contain a 128-bit subvector insertion from the lowest subvector of one of the sources.
These are best handled with a vinsert32x4 or vinsert64x2 instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290946
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Jan 2017 07:31:59 +0000 (07:31 +0000)]
[AVX-512] Add more test cases for shuffles that should be handled with subvector insert instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290945
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Jan 2017 07:31:57 +0000 (07:31 +0000)]
[AVX-512] Fix a typo in a couple case names to match their behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290944
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Jan 2017 07:31:54 +0000 (07:31 +0000)]
[AVX-512] Add avx512dq to the vector-shuffle-512-v16.ll test command lines in preparation for a future change that needs these features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290943
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Jan 2017 07:31:51 +0000 (07:31 +0000)]
[AVX-512] Simplify code for creating 512-bit SHUF128 operations.
We don't need two loops and we can safely assume assume and hardcode the size of the widened mask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290942
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 4 Jan 2017 03:51:36 +0000 (03:51 +0000)]
Support: Add YAML I/O support for custom mappings.
This will be used to YAMLify parts of the module summary.
Differential Revision: https://reviews.llvm.org/D28014
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290935
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 4 Jan 2017 02:34:29 +0000 (02:34 +0000)]
On a 64-bit system, the DWARFDebugLine::Row struct is 32 bytes. Each field has the following byte offsets:
0-7: Address
8-11: Line
12-13: Column
14-15: File
16-19: Isa
20-23: Discriminator
24+: bit fields
The packing is fine until the "Isa" field, which is an 8-bit int that occupies 4 bytes. We can instead move Discriminator into the 16-19 slot, and pack Isa into the 20-23 range along with the bit fields:
0-7: Address
8-11: Line
12-13: Column
14-15: File
16-19: Discriminator
20-23: Isa + bit fields
This layout is only 24 bytes. This 25% reduction in size may seem small but a large binary can have line tables with thousands of rows stored in a vector.
Patch by Simon Que!
Differential Revision: https://reviews.llvm.org/D27961
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290931
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 4 Jan 2017 02:21:37 +0000 (02:21 +0000)]
[InstCombine] Add a test for r290733
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290929
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 4 Jan 2017 02:21:34 +0000 (02:21 +0000)]
[InstCombine] Move casts around shift operations
It is possible to perform a left shift before zero extending if the
shift would only shift out zeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290928
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 4 Jan 2017 02:21:31 +0000 (02:21 +0000)]
[InstCombine] Combine adds across a zext
We can perform the following:
(add (zext (add nuw X, C1)), C2) -> (zext (add nuw X, C1+C2))
This is only possible if C2 is negative and C2 is greater than or equal to negative C1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290927
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Wed, 4 Jan 2017 02:02:05 +0000 (02:02 +0000)]
[Hexagon, TableGen] 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@290925
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Wed, 4 Jan 2017 00:10:50 +0000 (00:10 +0000)]
Correct the parent testing to avoid the special case where a DIE has a depth of 1
This test was testing that we could correctly find the parent of a DIE, but it was actually just testing the special case where a DIE's depth was 1. This corrects that error by adding an extra level into the the DWARF to ensure that we correctly get the parent by looking for the parent with a depth that is 1 less than the current depth.
Differential Revision: https://reviews.llvm.org/D28261
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290918
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Tue, 3 Jan 2017 23:19:29 +0000 (23:19 +0000)]
[ThinLTO] Import type as decl only when non-null Identifier
As per post-commit review for r289993 (D27775), we can only safely
import a type as a decl if it has an Identifier, as the Name alone
is not enough to be unique across modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290915
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 3 Jan 2017 23:12:36 +0000 (23:12 +0000)]
Fix the MSVC version check.
I'm not sure what determines the minor version, but it appears
that it's possible for a fully updated, release version of
VS2015 with Update 3 can go (at least) as low as 19.00.24213.1.
Updating the compiler version check to account for this so we
don't generate superfluous warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290914
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 3 Jan 2017 22:40:34 +0000 (22:40 +0000)]
InstCombine: Fold fabs on select of constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290913
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 3 Jan 2017 22:25:31 +0000 (22:25 +0000)]
[InstCombine] use 'match' to reduce code bloat; NFCI
I wrote this patch before seeing the comment in:
https://reviews.llvm.org/D27114
...that suggests we should actually be canonicalizing the other way.
So just in case we decide this is the right way, we might as well
have a cleaner implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290912
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 3 Jan 2017 21:42:43 +0000 (21:42 +0000)]
[CodeGen] Further simplify returned call operand logic. NFC.
As Pete points out in r290905, CallSite lets us avoid duplicating this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290909
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 3 Jan 2017 21:39:43 +0000 (21:39 +0000)]
[ExecutionEngine] Fix compile errors in OProfileJITEventListener.
Allows LLVM to build with LLVM_USE_OPROFILE=True.
Patch by Mark Dewing. Thanks Mark!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290908
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 3 Jan 2017 20:33:22 +0000 (20:33 +0000)]
[CodeGen] Simplify logic that looks for returned call operands. NFC-ish.
Use getReturnedArgOperand() instead of rolling our own. Note that it's
equivalent because there can only be one 'returned' operand.
The existing code was also incorrect: there already was awkward logic to
ignore callee/EH blocks, but operands can now also be operand bundles,
in which case we'll look for non-existent parameter attributes.
Unfortunately, this isn't observable in-tree, as it only crashes when
exercising the regular call lowering logic with operand bundles.
Still, this is a nice small cleanup anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290905
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 3 Jan 2017 19:32:11 +0000 (19:32 +0000)]
[InstCombine] tighten checks for tests of assume -> metadata transform; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290903
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 3 Jan 2017 19:18:07 +0000 (19:18 +0000)]
[X86][SSE] Add extra truncated arithmetic tests for D28219
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290902
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 3 Jan 2017 19:17:49 +0000 (19:17 +0000)]
Add llvm-bcanalyzer support for new metadata node types.
Also sort the existing list by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290901
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Tue, 3 Jan 2017 19:08:05 +0000 (19:08 +0000)]
Enable disabled loopidiom test. Apparently we handle it now
Summary:
Enable disabled loopidiom test. Apparently we handle it now.
Maybe due to improvements to AA.
Reviewers: atrick, danielcdh, hfinkel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28171
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290900
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 3 Jan 2017 18:51:28 +0000 (18:51 +0000)]
[libFuzzer] disable -print_pcs by default (was enabled by mistake)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290899
91177308-0d34-0410-b5e6-
96231b3b80d8
Michal Gorny [Tue, 3 Jan 2017 16:33:50 +0000 (16:33 +0000)]
[ADT] APFloatBase: Prevent collapsing semPPCDoubleDouble and semBogus
Provide a distinct contents for semBogus and semPPCDoubleDouble in order
to prevent compilers from collapsing them to a single memory address,
while we heavily rely on every semantic having distinct address.
This happens if insecure optimization collapsing identical values is
enabled. As a result, APFloats of semBogus are indistinguishable from
semPPCDoubleDouble -- and whenever the move constructor is used, the old
value beings being incorrectly recognized as a semPPCDoubleDouble.
Since the values in semPPCDoubleDouble are not used anywhere,
we can easily solve this issue via altering the value of one of the
fields and therefore ensuring that the collapse can not occur.
Differential Revision: https://reviews.llvm.org/D28112
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290896
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 07:36:41 +0000 (07:36 +0000)]
[X86] Move 128-bit shuffle mask widening check into lowerV2X128VectorShuffle to reduce code duplication. Use the now available widened mask to simplify some code inside lowerV2X128VectorShuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290872
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 07:36:39 +0000 (07:36 +0000)]
[AVX-512] Simplify the code added in r290870 to recognized 256-bit subvector inserts and avoid calling isShuffleEquivalent on a widened mask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290871
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 07:00:40 +0000 (07:00 +0000)]
[AVX-512] Teach shuffle lowering to use vinsert instructions for shuffles corresponding to 256-bit subvector inserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290870
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:46:18 +0000 (05:46 +0000)]
[AVX-512] Teach EVEX to VEX conversion pass to handle VINSERT and VEXTRACT instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290869
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:46:10 +0000 (05:46 +0000)]
[AVX-512] Re-generate tests that were updated for r290663 without using update_llc_test_checks.py so duplicate check lines weren't merged.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290868
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:46:06 +0000 (05:46 +0000)]
[X86] Remove trailing whitespace and an unnecessary line wrap. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290867
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:46:05 +0000 (05:46 +0000)]
[X86] Fix header comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290866
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:46:02 +0000 (05:46 +0000)]
[AVX-512] Add support for pushing bitcasts through INSERT_SUBVEC in order to select a masked operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290865
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:45:57 +0000 (05:45 +0000)]
[AVX-512] Remove vinsert intrinsics and autoupgrade to native shufflevectors. There are some codegen problems here that I'll try to fix in future commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290864
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Jan 2017 05:45:46 +0000 (05:45 +0000)]
[AVX-512] Remove vextract intrinsics and autoupgrade to native shufflevectors. This unfortunately generates some really terrible code without VLX support due to v2i1 and v4i1 not being legal.
Hopefully we can improve that in future patches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290863
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 3 Jan 2017 04:32:35 +0000 (04:32 +0000)]
InstCombine: Add fma with constant transforms
DAGCombine already does these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290860
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 3 Jan 2017 04:32:31 +0000 (04:32 +0000)]
InstCombine: Add fma + fabs/fneg transforms
fma (fneg x), (fneg y), z -> fma x, y, z
fma (fabs x), (fabs x), z -> fma x, x, z
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290859
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Tue, 3 Jan 2017 04:30:21 +0000 (04:30 +0000)]
[XRay] Merge instrumentation point table emission code into AsmPrinter.
Summary:
No need to have this per-architecture. While there, unify 32-bit ARM's
behaviour with what changed elsewhere and start function names lowercase
as per the coding standards. Individual entry emission code goes to the
entry's own class.
Fully tested on amd64, cross-builds on both ARMs and PowerPC.
Reviewers: dberris
Subscribers: aemerson, llvm-commits
Differential Revision: https://reviews.llvm.org/D28209
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290858
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 3 Jan 2017 00:16:24 +0000 (00:16 +0000)]
[EarlyCSE] less else, more auto; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290848
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 2 Jan 2017 23:25:28 +0000 (23:25 +0000)]
[InstCombine] use combineMetadataForCSE instead of copying it; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290844
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Mon, 2 Jan 2017 20:33:33 +0000 (20:33 +0000)]
[CMake] Set HAVE_${runtime} before including any subdirectories
This should allow us to avoid most order dependence in the runtime library configurations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290834
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Mon, 2 Jan 2017 20:27:23 +0000 (20:27 +0000)]
Make sure total loop body weight is preserved in loop peeling
Summary:
Regardless how the loop body weight is distributed, we should preserve
total loop body weight. i.e. we should have same weight reaching the body of the loop
or its duplicates in peeled and unpeeled case.
Reviewers: mkuper, davidxl, anemet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28179
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290833
91177308-0d34-0410-b5e6-
96231b3b80d8
Michal Gorny [Mon, 2 Jan 2017 20:22:45 +0000 (20:22 +0000)]
[cmake] Normalize LLVM_ENABLE_DIA_SDK to fix Windows tests
Attempts to fix Windows build breakage caused by r290818.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290832
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 2 Jan 2017 19:55:13 +0000 (19:55 +0000)]
NewGVN: Add a test case for equivalent phis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290830
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 2 Jan 2017 19:49:20 +0000 (19:49 +0000)]
NewGVN: Add forgotten testcase for PR 31483
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290829
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 2 Jan 2017 19:49:17 +0000 (19:49 +0000)]
NewGVN: Clean up after removing possibility of null expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290828
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 2 Jan 2017 19:05:11 +0000 (19:05 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290827
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 2 Jan 2017 19:04:07 +0000 (19:04 +0000)]
[ValueTracking] remove stale comments; NFC
The checks were improved with:
https://reviews.llvm.org/rL290194
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290826
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 2 Jan 2017 19:03:16 +0000 (19:03 +0000)]
[NewGVN] Fold single-use variable inside the assertion.
It placates some bots which complain because they compile the
assertion out and think the variable is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290825
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 2 Jan 2017 18:41:34 +0000 (18:41 +0000)]
[NewGVN] Restore old code to placate buildbots.
Apparently my suggestion of using ternary doesn't really work
as clang complains about incompatible types on LHS and RHS. Some
GCC versions happen to accept the code but clang behaviour is
correct here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290822
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 2 Jan 2017 18:22:38 +0000 (18:22 +0000)]
NewGVN: Fix some formatting and comment issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290820
91177308-0d34-0410-b5e6-
96231b3b80d8
Michal Gorny [Mon, 2 Jan 2017 18:19:35 +0000 (18:19 +0000)]
[cmake] Add LLVM_ENABLE_DIA_SDK option, and expose it in LLVMConfig
Add an explicit LLVM_ENABLE_DIA_SDK option to control building support
for DIA SDK-based debugging. Control its value to match whether DIA SDK
support was found and expose it in LLVMConfig (alike LLVM_ENABLE_ZLIB).
Its value is needed for LLDB to determine whether to run tests requiring
DIA support. Currently it is obtained from llvm/Config/config.h;
however, this file is not available for standalone builds. Following
this change, LLDB will be modified to use the value from LLVMConfig.
Differential Revision: https://reviews.llvm.org/D26255
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290818
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Mon, 2 Jan 2017 18:05:27 +0000 (18:05 +0000)]
Emit .cfi_sections before the first .cfi_startproc
GNU as rejects input where .cfi_sections is used after .cfi_startproc,
if the new section differs from the old. Adjust our output to always
emit .cfi_sections before the first .cfi_startproc to minimize necessary
code.
Differential Revision: https://reviews.llvm.org/D28011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290817
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 2 Jan 2017 18:00:53 +0000 (18:00 +0000)]
NewGVN: Add UnknownExpression and create them for things we can't symbolize. Kill fragile machinery for handling null expressions.
Summary:
This avoids the very fragile code for null expressions. We could also use a denseset that tracks which things have null expressions instead, but that seems pretty fragile and premature optimization.
This resolves a number of infinite loop cases, test reductions coming.
Reviewers: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290816
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Mon, 2 Jan 2017 18:00:46 +0000 (18:00 +0000)]
NewGVN: Fix PR31480, PR31483, PR31499, by rewriting how memory congruence handling works.
Summary: Previously, we tried to fix up the equivalences during symbolic evaluation. This does not work. Now, we change the equivalences during congruence finding, where it belongs. We also initialize the equivalence table to give a maximal answer.
Reviewers: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28192
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290815
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 2 Jan 2017 17:49:18 +0000 (17:49 +0000)]
[PMBuilder] Remove RunFloat2Int cl::opt.
The pass has been on by default for a long time without problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290814
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 2 Jan 2017 11:44:10 +0000 (11:44 +0000)]
Fixed shuffle-reverse cost on AVX-512.
(This changed was approved in https://reviews.llvm.org/D28118, but Simon asked to submit it separately).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290812
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 2 Jan 2017 10:37:52 +0000 (10:37 +0000)]
AVX-512 Loop Vectorizer: Cost calculation for interleave load/store patterns.
X86 target does not provide any target specific cost calculation for interleave patterns.It uses the common target-independent calculation, which gives very high numbers. As a result, the scalar version is chosen in many cases. The situation on AVX-512 is even worse, since we have 3-src shuffles that significantly reduce the cost.
In this patch I calculate the cost on AVX-512. It will allow to compare interleave pattern with gather/scatter and choose a better solution (PR31426).
* Shiffle-broadcast cost will be changed in Simon's upcoming patch.
Differential Revision: https://reviews.llvm.org/D28118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290810
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Mon, 2 Jan 2017 03:00:19 +0000 (03:00 +0000)]
Reapply "[CodeGen] Fix invalid DWARF info on Win64"
This reapplies rL289013 (reverted in rL289014) with the fixes identified
in D21731. Should hopefully pass the buildbots this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290809
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 1 Jan 2017 18:20:49 +0000 (18:20 +0000)]
[InstCombine] add explanatory comment to test; NFC
The test was added at r290797, and a patch to enable the transform is proposed in D28204.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290798
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 1 Jan 2017 17:18:00 +0000 (17:18 +0000)]
[InstCombine] add test to show potential nonnull attribute propagation; NFC
This will change with the current draft of:
https://reviews.llvm.org/D28204
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290797
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Sun, 1 Jan 2017 13:58:27 +0000 (13:58 +0000)]
[selectiondag] Check PromotedFloats map during expansive checks.
Summary:
`PromotedFloats` needs to be checked in
`DAGTypeLegalizer::PerformExpensiveChecks`. This patch fixes a few type
legalization failures with expansive checks for ARM fp16 tests.
Reviewers: baldrick, bogner, arsenm
Subscribers: arsenm, aemerson, llvm-commits
Differential Revision: https://reviews.llvm.org/D28187
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290796
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sat, 31 Dec 2016 22:12:34 +0000 (22:12 +0000)]
Fix an issue with isGuaranteedToTransferExecutionToSuccessor
I'm not sure if this was intentional, but today
isGuaranteedToTransferExecutionToSuccessor returns true for readonly and
argmemonly calls that may throw. This commit changes the function to
not implicitly infer nounwind this way.
Even if we eventually specify readonly calls as not throwing,
isGuaranteedToTransferExecutionToSuccessor is not the best place to
infer that. We should instead teach FunctionAttrs or some other such
pass to tag readonly functions / calls as nounwind instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290794
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sat, 31 Dec 2016 22:12:31 +0000 (22:12 +0000)]
Avoid const_cast; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290793
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 31 Dec 2016 19:23:26 +0000 (19:23 +0000)]
[ValueTracking] add tests for known-nonnull-at; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290790
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 31 Dec 2016 17:54:05 +0000 (17:54 +0000)]
[Inliner] remove unnecessary null checks from AddAlignmentAssumptions(); NFCI
We bail out on the 1st line if the assumption cache is not set, so there's
no need to check it after that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290787
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 31 Dec 2016 17:37:01 +0000 (17:37 +0000)]
[ValueTracking] make dominator tree requirement explicit for isKnownNonNullFromDominatingCondition(); NFCI
I don't think this hole is currently exposed, but I crashed regression tests for
jump-threading and loop-vectorize after I added calls to isKnownNonNullAt() in
InstSimplify as part of trying to solve PR28430:
https://llvm.org/bugs/show_bug.cgi?id=28430
That's because they call into value tracking with a context instruction, but no
other parts of the query structure filled in.
For more background, see the discussion in:
https://reviews.llvm.org/D27855
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290786
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 31 Dec 2016 07:34:36 +0000 (07:34 +0000)]
NewGVN: Print out DefiningAccess for both loads and stores when debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290782
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Sat, 31 Dec 2016 02:33:22 +0000 (02:33 +0000)]
[SmallPtrSet] Introduce a find primitive and rewrite count/erase in terms of it
This was originally motivated by a compile time problem I've since figured out how to solve differently, but the cleanup seemed useful. We had the same logic - which essentially implemented find - in several places. By commoning them out, I can implement find and allow erase to be inlined at the call sites if profitable.
Differential Revision: https://reviews.llvm.org/D28183
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290779
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Sat, 31 Dec 2016 01:07:14 +0000 (01:07 +0000)]
[AVR] Optimize 16-bit ANDs with '1'
Summary: Fixes PR 31345
Reviewers: dylanmckay
Subscribers: fhahn, llvm-commits
Differential Revision: https://reviews.llvm.org/D28186
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290778
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 31 Dec 2016 00:45:06 +0000 (00:45 +0000)]
[InstCombine][AVX-512] Teach InstCombine that llvm.x86.avx512.vcomi.sd and llvm.x86.avx512.vcomi.ss don't use the upper elements of their input.
This was already done for the SSE/SSE2 version of the intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290776
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 30 Dec 2016 23:06:28 +0000 (23:06 +0000)]
[InstCombine][AVX-512] When turning intrinsics with masking into native IR, don't emit a select if the mask is known to be all ones.
This saves InstCombine the burden of having to optimize the select later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290774
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 30 Dec 2016 22:43:41 +0000 (22:43 +0000)]
[X86][AVX512DQ] Add truncated math tests for AVX512DQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290772
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 30 Dec 2016 22:40:32 +0000 (22:40 +0000)]
[X86][SSE] Fix truncated math test names.
Inconsistent naming convention and wrong name for some input/output types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290771
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 30 Dec 2016 22:31:33 +0000 (22:31 +0000)]
[X86][AVX512] Regenerate test - missing shuffle comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290770
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 30 Dec 2016 22:10:19 +0000 (22:10 +0000)]
Add a comment for a todo in LoopUnroll post cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290769
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 30 Dec 2016 22:09:10 +0000 (22:09 +0000)]
[LVI] Remove count/erase idiom in favor of checking result value of erase
Minor compile time win. Avoids an additional O(N) scan in the case where we are removing an element and costs nothing when we aren't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290768
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Fri, 30 Dec 2016 21:28:30 +0000 (21:28 +0000)]
[doc] Clarify steps for contributors without commit access.
Summary: Update the Phabricator docs to clarify how changes are merged for contributors without commit access.
Reviewers: delcypher, aaron.ballman
Subscribers: aaron.ballman, anmol, llvm-commits
Differential Revision: https://reviews.llvm.org/D28184
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290767
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 30 Dec 2016 19:42:13 +0000 (19:42 +0000)]
DebugInfo: change the PDB UniqueId type to uint8_t
Since we type-erase the Windows GUID structure, use unsigned bytes
rather than char, which may be signed (-fsigned-char). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290765
91177308-0d34-0410-b5e6-
96231b3b80d8
Piotr Padlewski [Fri, 30 Dec 2016 18:45:07 +0000 (18:45 +0000)]
[MemDep] Handle gep with zeros for invariant.group
Summary:
gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it
to getelementptr because it make SROA can then handle it.
Simple case like
void g(A &a) {
z(a);
if (glob)
a.foo();
}
void testG() {
A a;
g(a);
}
was not devirtualized with -fstrict-vtable-pointers because luck of
handling for gep 0 in Memory Dependence Analysis
Reviewers: dberlin, nlewycky, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28126
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290763
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 30 Dec 2016 18:00:55 +0000 (18:00 +0000)]
[CVP] Adjust iteration order to reduce the amount of work required
CVP doesn't care about the order of blocks visited, but by using a pre-order traversal over the graph we can a) not visit unreachable blocks and b) optimize as we go so that analysis of later blocks produce slightly more precise results.
I noticed this via inspection and don't have a concrete example which points to the issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290760
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 30 Dec 2016 17:56:47 +0000 (17:56 +0000)]
[LVI] Manually hoist computation from loop
Minor compile time win. Not known to be a hot spot, just something I noticed while reading.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290759
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 30 Dec 2016 15:57:56 +0000 (15:57 +0000)]
Caught a simple typo. I do not know of a way to test this, but it seems like an unlikely thing to regress in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290757
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 30 Dec 2016 15:01:17 +0000 (15:01 +0000)]
[NewGVN] Remove unneeded newline from assertion message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290755
91177308-0d34-0410-b5e6-
96231b3b80d8
Abhilash Bhandari [Fri, 30 Dec 2016 12:34:36 +0000 (12:34 +0000)]
[ADT] Fix for compilation error when operator++(int) (post-increment function) of SmallPtrSetIterator is used.
The bug was introduced in r289619.
Reviewers: Mehdi Amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28134
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290749
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 30 Dec 2016 03:36:17 +0000 (03:36 +0000)]
[InstCombine] Address post-commit feedback
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290741
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 30 Dec 2016 01:15:50 +0000 (01:15 +0000)]
Fix test change in r290736: restore index generation
I remove one extra line, but because annoyingly llvm-lit does not
clean the output directory before running the test, it didn't fail
locally (the file was present from a previous run).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290740
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 30 Dec 2016 01:13:07 +0000 (01:13 +0000)]
[libFuzzer] cleaner implementation of -print_pcs=1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290739
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Fri, 30 Dec 2016 01:03:17 +0000 (01:03 +0000)]
[LICM] When promoting scalars, allow inserting stores to thread-local allocas.
This is similar to the allocfn case - if an alloca is not captured, then it's
necessarily thread-local.
Differential Revision: https://reviews.llvm.org/D28170
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290738
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Fri, 30 Dec 2016 00:50:28 +0000 (00:50 +0000)]
Use continuous boosting factor for complete unroll.
Summary:
The current loop complete unroll algorithm checks if unrolling complete will reduce the runtime by a certain percentage. If yes, it will apply a fixed boosting factor to the threshold (by discounting cost). The problem for this approach is that the threshold abruptly. This patch makes the boosting factor a function of runtime reduction percentage, capped by a fixed threshold. In this way, the threshold changes continuously.
The patch also simplified the code by reducing one parameter in UP.
The patch only affects code-gen of two speccpu2006 benchmark:
445.gobmk binary size decreases 0.08%, no performance change.
464.h264ref binary size increases 0.24%, no performance change.
Reviewers: mzolotukhin, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26989
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290737
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 30 Dec 2016 00:45:26 +0000 (00:45 +0000)]
Replace test from using llvm-lto to use llvm-link (NFC)
Some incoming changes in ThinLTO will break this test.
Instead of relying on the heuristic to import, we
force the importing to happen with llvm-link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290736
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Fri, 30 Dec 2016 00:43:22 +0000 (00:43 +0000)]
[LICM] Remove unneeded tracking of whether changes were made. NFC.
"Changed" doesn't actually change within the loop, so there's
no reason to keep track of it - we always return false during
analysis and true after the transformation is made.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290735
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Fri, 30 Dec 2016 00:39:00 +0000 (00:39 +0000)]
[LICM] Make logic in promoteLoopAccessesToScalars easier to follow. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290734
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 30 Dec 2016 00:28:58 +0000 (00:28 +0000)]
[InstCombine] More thoroughly canonicalize the position of zexts
We correctly canonicalized (add (sext x), (sext y)) to (sext (add x, y))
where possible. However, we didn't perform the same canonicalization
for zexts or for muls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290733
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Fri, 30 Dec 2016 00:21:56 +0000 (00:21 +0000)]
[AVR] Optimize 16-bit ORs with '0'
Summary: Fixes PR 31344
Authored by Anmol P. Paralkar
Reviewers: dylanmckay
Subscribers: fhahn, llvm-commits
Differential Revision: https://reviews.llvm.org/D28121
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290732
91177308-0d34-0410-b5e6-
96231b3b80d8