1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

133047 Commits

Author SHA1 Message Date
Mike Aizatsky
971be03956 [libfuzzer] prune_corpus option for disabling pruning during the load.
Summary:
The option is very useful for testing, plus I intend to measure
its effect on fuzzer effectiveness.

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

llvm-svn: 272035
2016-06-07 18:16:32 +00:00
Chris Bieneman
2b0d6027c2 Revert "Use CMAKE_INSTALL_BINDIR instead of hardcoding bin for tools install paths"
This reverts commit 0dc5a55f66ed06d7859c4e0474a87428d27775e6.

llvm-svn: 272033
2016-06-07 18:04:37 +00:00
Chris Bieneman
9fbb86b419 Use CMAKE_INSTALL_BINDIR instead of hardcoding bin for tools install paths
Summary:
This allows customizing the location executables and symlinks get installed to,
as with --bindir in autotools.

Reviewers: loladiro, beanz

Subscribers: llvm-commits

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

llvm-svn: 272031
2016-06-07 18:01:16 +00:00
Geoff Berry
26dc05069f Reapply [AArch64] Fix isLegalAddImmediate() to return true for valid negative values.
Originally reviewed here: http://reviews.llvm.org/D17463

llvm-svn: 272023
2016-06-07 16:48:43 +00:00
Daniel Dunbar
19353b2150 [utils/lit] Show available_features with --show-suites.
llvm-svn: 272022
2016-06-07 16:22:24 +00:00
Daniel Dunbar
45d8260ac8 [lit] Improve logging with file redirection.
- This will cause lit to automatically include the first 1K of data in
   redirected output files when a command fails (previously if the command
   failed, but the main point of the test was, say, a `FileCheck` later on, then
   the log wasn't helpful in showing why the command failed).

llvm-svn: 272021
2016-06-07 16:13:40 +00:00
Andrey Turetskiy
09c70527ce Quick fix for the test from rL272014 "[LAA] Improve non-wrapping pointer
detection by handling loop-invariant case" (s couple of buildbots failed).

Patch by Roman Shirokiy.

llvm-svn: 272019
2016-06-07 15:52:35 +00:00
Haicheng Wu
860b042ccd Revert "[MBP] Reduce code size by running tail merging in MBP."
This reverts commit r271930, r271915, r271923.  They break a thumb selfhosting
bot.

llvm-svn: 272017
2016-06-07 15:17:21 +00:00
Simon Pilgrim
7ece42dd08 [X86][AVX512] Added 512-bit integer vector non-temporal load tests
llvm-svn: 272016
2016-06-07 15:12:47 +00:00
Oliver Stannard
c01451b548 [ARM] Accept conditional versions of BXNS and BLXNS
These instructions end in "S" but are not flag-setting, so they need including
in the list of special cases in the assembly parser.

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

llvm-svn: 272015
2016-06-07 14:58:48 +00:00
Andrey Turetskiy
cf1b3836fd [LAA] Improve non-wrapping pointer detection by handling loop-invariant case.
This fixes PR26314. This patch adds new helper “isNoWrap” with detection of
loop-invariant pointer case.

Patch by Roman Shirokiy.

Ref: https://llvm.org/bugs/show_bug.cgi?id=26314

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

llvm-svn: 272014
2016-06-07 14:55:27 +00:00
Davide Italiano
1d6e4baba6 [Linker/IRMover] Simplify the code a bit. NFCI.
llvm-svn: 272013
2016-06-07 14:55:04 +00:00
Simon Pilgrim
c47951deb7 [X86][SSE] Add general lowering of nontemporal vector loads (fixed bad merge)
Currently the only way to use the (V)MOVNTDQA nontemporal vector loads instructions is through the int_x86_sse41_movntdqa style builtins.

This patch adds support for lowering nontemporal loads from general IR, allowing us to remove the movntdqa builtins in a future patch.

We currently still fold nontemporal loads into suitable instructions, we should probably look at removing this (and nontemporal stores as well) or at least make the target's folding implementation aware that its dealing with a nontemporal memory transaction.

There is also an issue that VMOVNTDQA only acts on 128-bit vectors on pre-AVX2 hardware - so currently a normal ymm load is still used on AVX1 targets.

Differential Review: http://reviews.llvm.org/D20965

llvm-svn: 272011
2016-06-07 13:47:23 +00:00
Simon Pilgrim
67ca4cba96 [X86][SSE] Add general lowering of nontemporal vector loads
Currently the only way to use the (V)MOVNTDQA nontemporal vector loads instructions is through the int_x86_sse41_movntdqa style builtins.

This patch adds support for lowering nontemporal loads from general IR, allowing us to remove the movntdqa builtins in a future patch.

We currently still fold nontemporal loads into suitable instructions, we should probably look at removing this (and nontemporal stores as well) or at least make the target's folding implementation aware that its dealing with a nontemporal memory transaction.

There is also an issue that VMOVNTDQA only acts on 128-bit vectors on pre-AVX2 hardware - so currently a normal ymm load is still used on AVX1 targets.

Differential Review: http://reviews.llvm.org/D20965

llvm-svn: 272010
2016-06-07 13:34:24 +00:00
Davide Italiano
e1c6a997f8 [PM] Preserve GlobalsAA for SROA.
Differential Revision:  http://reviews.llvm.org/D21040

llvm-svn: 272009
2016-06-07 13:21:17 +00:00
James Molloy
bab28a1f85 [Thumb-1] Add optimized constant materialization for integers [256..512)
We can materialize these integers using a MOV; ADDi8 pair.

llvm-svn: 272007
2016-06-07 13:10:14 +00:00
Igor Breger
53dd84b6c0 [AVX512] Fix load opcode for fast isel.
Differential Revision: http://reviews.llvm.org/D21067

llvm-svn: 272006
2016-06-07 13:08:45 +00:00
Ulrich Weigand
f4980a0fe0 [PowerPC] Support multiple return values with fast isel
Using an LLVM IR aggregate return value type containing three
or more integer values causes an abort in the fast isel pass.

This patch adds two more registers to RetCC_PPC64_ELF_FIS to
allow returning up to four integers with fast isel, just the
same as is currently supported with regular isel (RetCC_PPC).

This is needed for Swift and (possibly) other non-clang frontends.

Fixes PR26190.

llvm-svn: 272005
2016-06-07 12:48:22 +00:00
Simon Pilgrim
5c22a56177 [X86][SSE] Improved blend+zero target shuffle combining to use combined shuffle mask directly
We currently only combine to blend+zero if the target value type has 8 elements or less, but this was missing a lot of cases where the combined mask had been widened.

This change makes it so we use the combined mask to determine the blend value type, allowing us to catch more widened cases.

llvm-svn: 272003
2016-06-07 12:20:14 +00:00
James Molloy
7a93cbe27f [ARM] Shrink post-indexed LDR and STR to LDM/STM
A Thumb-2 post-indexed LDR instruction such as:

  ldr.w r0, [r1], #4

Can be rewritten as:

  ldm.n r1!, {r0}

LDMs can be more expensive than LDRs on some cores, so this has been enabled only in minsize mode.

llvm-svn: 272002
2016-06-07 12:13:34 +00:00
James Molloy
98866e3fe1 [ARM] Transform LDMs into writeback form to save code size
If we have an LDM that uses only low registers and doesn't write to its base register:

  ldm.w r0, {r1, r2, r3}

And that base register is dead after the LDM, then we can convert it to writeback form and use a narrow encoding:

  ldm.n r0!, {r1, r2, r3}

Obviously, this introduces a new register write and so can cause WAW hazards, so I've enabled it only in minsize mode. This is a code size trick that ARM Compiler 5 ("armcc") does that we don't.

llvm-svn: 272000
2016-06-07 11:47:24 +00:00
George Rimar
37a7f50a87 [llvm-readobj] - Teach llvm-readobj to dump .gnu.version_r sections
SHT_GNU_verneed (.gnu.version_r) is a version dependency section.
It was the last symbol versioning relative section that was not dumped,
now it is.

Differential revision: http://reviews.llvm.org/D21024

llvm-svn: 271998
2016-06-07 11:04:49 +00:00
Peter Smith
d64bc3ec0b [ARM] Incorrect relocation type for Thumb2 B<cond>.w
The Thumb2 conditional branch B<cond>.W has a different encoding (T3) 
to the unconditional branch B.W (T4) as it needs to record <cond>. 
As the encoding is different the B<cond>.W is given a different 
relocation type. 

ELF for the ARM Architecture 4.6.1.6 (Table-13) states that 
R_ARM_THM_JUMP19 should be used for B<cond>.W. At present the 
MC layer is using the R_ARM_THM_JUMP24 from B.W.

This change makes B<cond>.W use R_ARM_THM_JUMP19 and alters the 
existing test that checks for R_ARM_THM_JUMP24 to expect 
R_ARM_THM_JUMP19.

llvm-svn: 271997
2016-06-07 10:34:33 +00:00
Simon Pilgrim
3b8db9c327 [InstCombine][AVX2] Add support for simplifying AVX2 per-element shifts to native shifts
Unlike native shifts, the AVX2 per-element shift instructions VPSRAV/VPSRLV/VPSLLV handle out of range shift values (logical shifts set the result to zero, arithmetic shifts splat the sign bit).

If the shift amount is constant we can sometimes convert these instructions to native shifts:

1 - if all shift amounts are in range then the conversion is trivial.
2 - out of range arithmetic shifts can be clamped to the (bitwidth - 1) (a legal shift amount) before conversion.
3 - logical shifts just return zero if all elements have out of range shift amounts.

In addition, UNDEF shift amounts are handled - either as an UNDEF shift amount in a native shift or as an UNDEF in the logical 'all out of range' zero constant special case for logical shifts.

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

llvm-svn: 271996
2016-06-07 10:27:15 +00:00
Simon Pilgrim
6a9d532b78 [InstCombine][SSE] Add MOVMSK constant folding (PR27982)
This patch adds support for folding undef/zero/constant inputs to MOVMSK instructions.

The SSE/AVX versions can be fully folded, but the MMX version can only handle undef inputs.

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

llvm-svn: 271990
2016-06-07 08:18:35 +00:00
Craig Topper
b20bc0d4cb [AVX512] Allow avx2 and sse41 nontemporal load intrinsics to select EVEX encoded instructions when VLX is enabled.
llvm-svn: 271988
2016-06-07 07:27:57 +00:00
Craig Topper
9126a71b21 [AVX512] Remove unnecessary mayLoad, mayStore, hasSidEffects flags from instructions that have patterns that imply them. Add the same set of flags to instructions that don't have patterns to imply them.
llvm-svn: 271987
2016-06-07 07:27:54 +00:00
Craig Topper
ea203c84fa [AVX512] Add NoVLX to a couple patterns that have VLX equivalents. Ordering of the patterns in the .td file protects this, but its better to be explicit.
llvm-svn: 271986
2016-06-07 07:27:51 +00:00
Lang Hames
90a9836da7 [Kaleidoscope] Update Chapter 3 of the "Implementing a Language" tutorial to
take into account modernizations in r246002 and r270381.

Patch based on http://reviews.llvm.org/D20954 by Miroslav Hrncir.
Thanks Miroslav!

llvm-svn: 271985
2016-06-07 05:40:08 +00:00
Zachary Turner
e2db98503c [pdb] Fix broken unit tests after r271982.
llvm-svn: 271983
2016-06-07 05:32:48 +00:00
Zachary Turner
df1bab5ad7 [pdb] Use MappedBlockStream to parse the PDB directory.
In order to efficiently write PDBs, we need to be able to make a
StreamWriter class similar to a StreamReader, which can transparently deal
with writing to discontiguous streams, and we need to use this for all
writing, similar to how we use StreamReader for all reading.

Most discontiguous streams are the typical numbered streams that appear in
a PDB file and are described by the directory, but the exception to this,
that until now has been parsed by hand, is the directory itself.
MappedBlockStream works by querying the directory to find out which blocks
a stream occupies and various other things, so naturally the same logic
could not possibly work to describe the blocks that the directory itself
resided on.

To solve this, I've introduced an abstraction IPDBStreamData, which allows
the client to query for the list of blocks occupied by the stream, as well
as the stream length. I provide two implementations of this: one which
queries the directory (for indexed streams), and one which queries the
super block (for the directory stream).

This has the side benefit of vastly simplifying the code to parse the
directory. Whereas before a mini state machine was rolled by hand, now we
simply use FixedStreamArray to read out the stream sizes, then build a
vector of FixedStreamArrays for the stream map, all in just a few lines of
code.

Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21046

llvm-svn: 271982
2016-06-07 05:28:55 +00:00
Dan Liew
7c363e3401 [LibFuzzer] s/dataflow sanitizer/DataflowSanitizer/
llvm-svn: 271980
2016-06-07 04:44:49 +00:00
Dan Liew
713f230c8d [LibFuzzer] Disable building and running LSan tests on Apple platforms because LSan is not currently supported.
Differential Revision: http://reviews.llvm.org/D20947

llvm-svn: 271979
2016-06-07 04:44:39 +00:00
Saleem Abdulrasool
def9e129ca ARM: correct TLS access on WoA
TLS access requires an offset from the TLS index.  The index itself is the
section-relative distance of the symbol.  For ARM, the relevant relocation
(IMAGE_REL_ARM_SECREL) is applied as a constant.  This means that the value may
not be an immediate and must be lowered into a constant pool.  This offset will
not be base relocated.  We were previously emitting the actual address of the
symbol which would be base relocated and would therefore be the vaue offset by
the ImageBase + TLS Offset.

llvm-svn: 271974
2016-06-07 03:15:07 +00:00
Saleem Abdulrasool
2807ed1c8c ARM: clang-format a couple of switches, add comments
clang-format a couple of switches in preparation for a future change.  Add some
enumeration comments

llvm-svn: 271973
2016-06-07 03:15:01 +00:00
Saleem Abdulrasool
d50d0011ad ARM: normalise space in the patterns
Just adjust the whitespace for the selection patterns.  NFC.

llvm-svn: 271972
2016-06-07 03:14:57 +00:00
Kostya Serebryany
b9204f52d3 [sanitizer] Initial implementation of a Hardened Allocator
Summary:
This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator.
It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast.
The following were implemented:
- additional consistency checks on the allocation function parameters and on the heap chunks;
- use of checksum protected chunk header, to detect corruption;
- randomness to the allocator base;
- delayed freelist (quarantine), to mitigate use after free and overall determinism.
Additional mitigations are in the works.

Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc

Subscribers: kubabrecka, filcab, llvm-commits

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

llvm-svn: 271968
2016-06-07 01:20:26 +00:00
Rui Ueyama
316237a8e0 Add comments.
llvm-svn: 271967
2016-06-07 00:59:04 +00:00
Reid Kleckner
faf70c1e23 Re-land "[codeview] Emit information about global variables"
This reverts commit r271962 and reinstantes r271957.

MSVC's linker doesn't appear to like it if you have an empty symbol
substream, so only open a symbol substream if we're going to emit
something about globals into it.

Makes check-asan pass.

llvm-svn: 271965
2016-06-07 00:02:03 +00:00
Reid Kleckner
1005b89a03 Try one more time to pacify -Wpessimizing-move, MSVC, libstdc++4.7, and the world without a named variable
llvm-svn: 271964
2016-06-06 23:46:14 +00:00
Vedant Kumar
5d5b447dbe Revert "Retry^2 "[llvm-profdata] Add option to ingest filepaths from a file""
This reverts commit r271953. It's still breaking on Windows, though the
list initialization issue is fixed:

http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/3751

llvm-svn: 271963
2016-06-06 23:43:56 +00:00
Reid Kleckner
812ebf03da Revert "[codeview] Emit information about global variables"
This reverts commit r271957, it broke check-asan on Windows.

llvm-svn: 271962
2016-06-06 23:41:38 +00:00
Michael Kuperstein
247caf8b05 [InstCombine] scalarizePHI should not assume the code it sees has been CSE'd
scalarizePHI only looked for phis that have exactly two uses - the "latch"
use, and an extract. Unfortunately, we can not assume all equivalent extracts
are CSE'd, since InstCombine itself may create an extract which is a duplicate
of an existing one. This extends it to handle several distinct extracts from
the same index.

This should fix at least some of the  performance regressions from PR27988.

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

llvm-svn: 271961
2016-06-06 23:38:33 +00:00
Rui Ueyama
fa28219f4a Fix CRLF -> LF.
llvm-svn: 271960
2016-06-06 23:35:52 +00:00
Reid Kleckner
236d68ce0f Attempt to work around lack of std::map::emplace in libstdc++4.7
llvm-svn: 271958
2016-06-06 23:28:03 +00:00
Reid Kleckner
792f4e6cf0 [codeview] Emit information about global variables
This currently emits everything as S_GDATA32, which isn't right for
things like thread locals, but it's a start.

llvm-svn: 271957
2016-06-06 23:23:47 +00:00
Peter Collingbourne
b49c377b70 Verifier: Simplify and fix issue where we were not verifying unmaterialized functions.
Arrange to call verify(Function &) on each function, followed by
verify(Module &), whether the verifier is being used from the pass or
from verifyModule(). As a side effect, this fixes an issue that caused
us not to call verify(Function &) on unmaterialized functions from
verifyModule().

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

llvm-svn: 271956
2016-06-06 23:21:27 +00:00
Rui Ueyama
f72bd6fe60 [pdbdump] Verify the size of TPI hash records.
llvm-svn: 271954
2016-06-06 23:19:23 +00:00
Vedant Kumar
d32e283fe4 Retry^2 "[llvm-profdata] Add option to ingest filepaths from a file"
Changes since the initial commit:
- Normalize file paths read from the file to prevent Windows path
  separators from escaping parts of the path.
- Since we need to store the normalized file paths in WeightedFile,
  don't do tricky things to keep the source MemoryBuffer alive.
- Don't use list-initialization for a std::string in WeightedFile.

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

llvm-svn: 271953
2016-06-06 23:17:22 +00:00
Vedant Kumar
196f3e9316 Revert "Retry "[llvm-profdata] Add option to ingest filepaths from a file"
This reverts commit r271949. It breaks the Windows build:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/12796

llvm-svn: 271952
2016-06-06 23:01:42 +00:00