Commit Graph

146492 Commits

Author SHA1 Message Date
Eric Liu
9dd65de00d Revert "[PGO] Value profile for size of memory intrinsic calls"
This commit reverts r297897 and r297909.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 13:16:35 +00:00
James Henderson
8276800d3c [Support] Add support for getting file system permissions on Windows and implement sys::fs::set/getPermissions to work with them
This change adds support for functions to set and get file permissions, in a similar manner to the C++17 permissions() function in <filesystem>. The setter uses chmod on Unix systems and SetFileAttributes on Windows, setting the permissions as passed in. The getter simply uses the existing status() function.

Prior to this change, status() would always return an unknown value for the permissions on a Windows file, making it impossible to test the new function on Windows. I have therefore added support for this as well. On Linux, prior to this change, the permissions included the file type, which should actually be accessed via a different member of the file_status class.

Note that on Windows, only the *_write permission bits have any affect - if any are set, the file is writable, and if not, the file is read-only. This is in common with what MSDN describes for their behaviour of std::filesystem::permissions(), and also what boost::filesystem does.

The motivation behind this change is so that we can easily test behaviour on read-only files in LLVM unit tests, but I am sure that others may find it useful in some situations.

Reviewers: zturner, amccarth, aaron.ballman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 11:22:09 +00:00
Chandler Carruth
c177883098 [PM/Inliner] Fix a bug in r297374 where we would leave stale calls in
the work queue and crash when trying to visit them after deleting the
function containing those calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 10:45:42 +00:00
Chandler Carruth
9a95bffff7 [PM/Inliner] Add a test case that encapsulates the core issue addressed
in r297374.

I've extracted a small version of this from the C++ metaprogram Richard
came up with to exercise these kinds of issues and written comments to
describe both how to reproduce a fresh version of the test case and what
likely failure modes are.

The test case is still a bit brittle as it depends on the particular
inline cost modeling and SCC visitation order, but it definitely would
have caught the bug right away when developing things so it seems
a really valuable test case to have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297935 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 10:13:55 +00:00
Oren Ben Simhon
ff057b11be Fixing typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297932 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 08:15:52 +00:00
Jonas Paulsson
1b6f5a39a9 [SelectionDAG] Optimize VSELECT->SETCC of incompatible or illegal types.
Don't scalarize VSELECT->SETCC when operands/results needs to be widened,
or when the type of the SETCC operands are different from those of the VSELECT.

(VSELECT SETCC) and (VSELECT (AND/OR/XOR (SETCC,SETCC))) are handled.

The previous splitting of VSELECT->SETCC in DAGCombiner::visitVSELECT() is
no longer needed and has been removed.

Updated tests:

test/CodeGen/ARM/vuzp.ll
test/CodeGen/NVPTX/f16x2-instructions.ll
test/CodeGen/X86/2011-10-19-widen_vselect.ll
test/CodeGen/X86/2011-10-21-widen-cmp.ll
test/CodeGen/X86/psubus.ll
test/CodeGen/X86/vselect-pcmp.ll

Review: Eli Friedman, Simon Pilgrim
https://reviews.llvm.org/D29489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 07:17:12 +00:00
Tobias Grosser
a690454389 [ADCE] Remove redundent code [NFC]
Summary:
In commit r289548 ([ADCE] Add code to remove dead branches) a redundant loop
nest was accidentally introduced, which implements exactly the same
functionality as has already been available right after. This redundancy has
been found when inspecting the ADCE code in the context of our recent
discussions on post-dominator modeling. This redundant code was also eliminated
by r296535 (which sparked the discussion), but only as part of a larger semantic
change of the post-dominance modeling. As this redundency in [ADCE] is really
just an oversight completely independent of the post-dominance changes under
discussion, we remove this redundancy independently.

Reviewers: dberlin, david2050

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 03:59:23 +00:00
Peter Collingbourne
13c3208403 Fix pessimising moves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 03:54:38 +00:00
Peter Collingbourne
2995c258a5 Support: Add a cache pruning policy parser.
The idea is that the policy string fully specifies the policy and is portable
between clients.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297927 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 03:42:00 +00:00
Colin LeMahieu
e6f1b022bf [Hexagon] Fixing test from 297920 to add Hexagon triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 01:52:10 +00:00
Kyle Butt
fef90abb68 CodeGen: BlockPlacement: Reduce TriangleChainCount to 2
This produces a 1% speedup on an important internal Google benchmark
(protocol buffers), with no other regressions in google or in the llvm
test-suite. Only 5 targets in the entire llvm test-suite are affected,
and on those 5 targets the size increase is 0.027%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 01:32:29 +00:00
David Blaikie
bd97f5e153 Check that line table entries don't spill over between sections even if they're empty at the end of a section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 00:52:18 +00:00
David Blaikie
1e54c56c2f Simplify/make more explicit (by making less explicit in some ways) some function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 00:43:19 +00:00
Colin LeMahieu
731cac0fcb [Hexagon] Updating inline saturate lanes for v62 version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297920 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 00:35:28 +00:00
Kostya Serebryany
e79427160e [libFuzzer] add a dummy LLVMFuzzerMutate to afl/afl_driver.cpp (https://github.com/google/oss-fuzz/issues/460)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:54:40 +00:00
Kostya Serebryany
e6224abb77 [libFuzzer] call __sanitizer_print_memory_profile with two params
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:27:53 +00:00
Simon Pilgrim
a7364cf0bf Remove redundant condition (PR32263). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297915 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:27:43 +00:00
Matt Arsenault
d0064ed89e AMDGPU: Allow sinking of addressing modes for atomic_inc/dec
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297913 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:15:12 +00:00
Vitaly Buka
83daa29a86 Revert "[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover."
Fails LLVMFuzzer.LLVMFuzzer.value-profile-strncmp.test.

This reverts commit r297891.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:08:18 +00:00
Vitaly Buka
6868195f9c Revert "Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor.""
Previously reverted wrong revision.

This reverts commit r297910.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:07:41 +00:00
Vitaly Buka
0356a1463a Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor."
Fails LLVMFuzzer.LLVMFuzzer.value-profile-strncmp.test

This reverts commit r297892.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:06:22 +00:00
Rong Xu
167e4b5969 Fix build failure from r297897.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 23:00:19 +00:00
Peter Collingbourne
2edabdec2a Support: Simplify the CachePruning API. NFCI.
Change the function that implements the pruning into a free function that
takes the policy as a struct argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:54:18 +00:00
Simon Pilgrim
733a6d0f30 Removed unnecessary semicolon. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:50:47 +00:00
Craig Topper
867844f81a [StackColoring] Remove unused header file for post-order traversal. Update comment that indicated we were using it when we really use a depth-first search. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:40:26 +00:00
Matt Arsenault
365e17251e CodeGenPrepare: Sink addressing modes for atomics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:35:20 +00:00
Zachary Turner
862a3a8aa6 Try to fix build break due to template argument deduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:32:59 +00:00
Zachary Turner
ce6292cf80 [llvm-pdbdump] Add support for diffing the String Table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:19:30 +00:00
Zachary Turner
bbf9606175 [pdb] Write the module info and symbol record streams.
Previously we did not have support for writing detailed
module information for each module, as well as the symbol
records.  This patch adds support for this, and in doing
so enables the ability to construct minimal PDBs from
just a few lines of YAML.  A test is added to illustrate
this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 22:18:53 +00:00
Eric Christopher
2258207fab Fix up grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 21:50:46 +00:00
Rong Xu
670b4228b0 [PGO] Value profile for size of memory intrinsic calls
This patch adds the value profile support to profile the size parameter of
memory intrinsic calls: memcpy, memcmp, and memmov.

Differential Revision: http://reviews.llvm.org/D28965


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 21:47:27 +00:00
Zvi Rackover
e822046c80 Second attempt for fix Hexagon buildbot by moving test to under X86/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 21:13:45 +00:00
Rong Xu
7e3bcd49fc [PGO] Minor cleanup for count instruction in SelectInstVisitor.
Summary:
NSIs can be double-counted by different operations in
SelectInstVisitor. Sink the the update to VM_counting mode only.
Also reset the value for each counting operation.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: xur, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 21:05:24 +00:00
Vitaly Buka
e925a388a3 [libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.
Differential Revision: https://reviews.llvm.org/D30683

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:59:27 +00:00
David Blaikie
312b28eb63 Add GDB pretty-printer for llvm::Twine type
Patch by Simon Marchi!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:51:44 +00:00
Zvi Rackover
6f043b36e1 Limit test's triple in attempt to fix broken buildbot
Regression test for a target-independent bug keeps failing in the
Hexagon backend due to what appears an unrelated issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:29:58 +00:00
Adrian McCarthy
104814bcf2 NFC: Corrects comments that were supposed to go in with earlier commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:29:06 +00:00
Sanjay Patel
e702632e70 [EarlyCSE] reduce indent; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:25:05 +00:00
Daniel Sanders
9fb2625421 [tablegen][globalisel] Trivial changes to reduce size of following patch. NFC.
Summary:
* Move namespace {
* Trivial: Typo
* RuleMatcher: Separate class and definition
* Trivial: const findNodeEquiv

Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: rovka

Subscribers: dberris, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:18:38 +00:00
Adrian McCarthy
38f8b960a3 Introduce NativeEnumModules and NativeCompilandSymbol
Together, these allow lldb-pdbdump to list all the modules from a PDB using a
native reader (rather than DIA).

Note that I'll probably be specializing NativeRawSymbol in a subsequent patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 20:17:58 +00:00
Zvi Rackover
184011252a [DAGCombine] Bail out if can't create a vector with at least two elements
Summary:

Fixes pr32278

Reviewers: igorb, craig.topper, RKSimon, spatel, hfinkel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 19:48:36 +00:00
Derek Schuff
f04cbf365e [WebAssembly] Update format of 'names' section.
This change updates to the format of the 'names' sectionin the
generated wasm binary to match the latest changesto the design
and 'wabt'.

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

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 19:36:02 +00:00
Simon Pilgrim
1a576c57ed [X86] Add missing BITREVERSE costs for SSE2 vectors and i8/i16/i32/i64 scalars
Prep work for PR31810

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 19:34:55 +00:00
Ahmed Bougacha
924375d273 [GlobalISel] Avoid translating synthetic constants to new G_CONSTANTS.
Currently, we create a G_CONSTANT for every "synthetic" integer
constant operand (for instance, for the G_GEP offset).
Instead, share the G_CONSTANTs we might have created by going through
the ValueToVReg machinery.

When we're emitting synthetic constants, we do need to get Constants from
the context.  One could argue that we shouldn't modify the context at
all (for instance, this means that we're going to use a tad more memory
if the constant wasn't used elsewhere), but constants are mostly
harmless.  We currently do this for extractvalue and all.

For constant fcmp, this does mean we'll emit an extra COPY, which is not
necessarily more optimal than an extra materialized constant.
But that preserves the current intended design of uniqued G_CONSTANTs,
and the rematerialization problem exists elsewhere and should be
resolved with a single coherent solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 19:21:11 +00:00
Ahmed Bougacha
bde5be06db [GlobalISel][AArch64] Select ADDXri.
We're now able to select ADDWri thanks to the new complex pattern
support.  Extend that to ADDXri.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 19:20:59 +00:00
Matt Arsenault
0c52bece01 AMDGPU: Fix unnecessary ands when packing f16 vectors
computeKnownBits didn't handle fp_to_fp16 to report
the high bits as 0. ARM maps the generic node to an instruction
that does not modify the high bits of the register, so introduce
a target node where the high bits are known 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 19:04:26 +00:00
Tim Northover
f4523b0efd ARM: avoid clobbering register in v6 jump-table expansion.
If we got unlucky with register allocation and actual constpool placement, we
could end up producing a tTBB_JT with an index that's already been clobbered.

Technically, we might be able to fix this situation up with a MOV, but I think
the constant islands pass is complex enough without having to deal with more
weird edge-cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 18:38:13 +00:00
Rong Xu
1d95032b0c [PGO] Refactor the code for value profile annotation
This patch refactors the code for value profile annotation to facilitate
of adding other kind of value profiles.

Differential Revision: http://reviews.llvm.org/D30989


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 18:23:39 +00:00
Ahmed Bougacha
17931c8370 [GlobalISel] Insert translated switch icmp blocks after switch parent.
Now that we preserve the IR layout, we would end up with all the newly
synthesized switch comparison blocks at the end of the function.
Instead, use a hopefully more reasonable layout, with the comparison
blocks immediately following the switch comparison blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 18:22:37 +00:00
Ahmed Bougacha
c0f82e4a51 [GlobalISel] Preserve IR block layout.
It makes the output function layout more predictable;  the layout has
an effect on performance, we don't want it to be at the mercy of the
translator's visitation order and such.
The predictable output is also easier to digest.

getOrCreateBB isn't appropriately named anymore, as it never needs to
create anything.  Rename it and extract the MBB creation logic out of it.

A couple tests were sensitive to the order. Update them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 18:22:33 +00:00