Commit Graph

133370 Commits

Author SHA1 Message Date
Lang Hames
8abe734181 [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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 05:40:08 +00:00
Zachary Turner
804dc35d2d [pdb] Fix broken unit tests after r271982.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 05:32:48 +00:00
Zachary Turner
6e00ec14d5 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 05:28:55 +00:00
Dan Liew
47f90f5156 [LibFuzzer] s/dataflow sanitizer/DataflowSanitizer/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 04:44:49 +00:00
Dan Liew
ef07357b2f [LibFuzzer] Disable building and running LSan tests on Apple platforms because LSan is not currently supported.
Differential Revision: http://reviews.llvm.org/D20947

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271979 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 04:44:39 +00:00
Saleem Abdulrasool
48ff9d62da 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 03:15:07 +00:00
Saleem Abdulrasool
7fe5e9209b 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 03:15:01 +00:00
Saleem Abdulrasool
4da96fca18 ARM: normalise space in the patterns
Just adjust the whitespace for the selection patterns.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 03:14:57 +00:00
Kostya Serebryany
8d0ee94074 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 01:20:26 +00:00
Rui Ueyama
cdea7ae629 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 00:59:04 +00:00
Reid Kleckner
d34b1e13f4 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 00:02:03 +00:00
Reid Kleckner
d74372042c Try one more time to pacify -Wpessimizing-move, MSVC, libstdc++4.7, and the world without a named variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:46:14 +00:00
Vedant Kumar
4333164ff3 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:43:56 +00:00
Reid Kleckner
815649892e Revert "[codeview] Emit information about global variables"
This reverts commit r271957, it broke check-asan on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:41:38 +00:00
Michael Kuperstein
6954e6256d [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:38:33 +00:00
Rui Ueyama
115c4998df Fix CRLF -> LF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:35:52 +00:00
Reid Kleckner
2fce618270 Attempt to work around lack of std::map::emplace in libstdc++4.7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:28:03 +00:00
Reid Kleckner
968f9915ac [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:23:47 +00:00
Peter Collingbourne
052c9ee80b 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:21:27 +00:00
Rui Ueyama
d97680dbf0 [pdbdump] Verify the size of TPI hash records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:19:23 +00:00
Vedant Kumar
6039b79bbe 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:17:22 +00:00
Vedant Kumar
acd5f5a519 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 23:01:42 +00:00
Vedant Kumar
8771e1714b Retry "[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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 22:39:22 +00:00
Peter Collingbourne
6510b62554 Verifier: Remove dead code.
Remove previously unreachable code that verifies that a function definition has
an entry block. By definition, a function definition has at least one block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 22:32:52 +00:00
Chris Bieneman
800064b2ac Updating release notes for CMake version bump
CMake 3.4.3 is now required for building LLVM-based projects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 22:02:16 +00:00
Rui Ueyama
1895d4095b [pdbdump] Print section header flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 21:34:55 +00:00
Chris Bieneman
ce66300bb0 [yaml2obj] Get rid of MachO header union
This is based on post-commit feedback from Sean Silva.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 21:18:43 +00:00
Zachary Turner
4efa5e541f [llvm-pdbdump] Dump stream sizes and stream blocks to yaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 20:37:17 +00:00
Zachary Turner
61e0e2783c [llvm-pdbdump] Dump MSF headers to YAML.
This is the simplest possible patch to get some kind of YAML
output.  All it dumps is the MSF header fields so that in
theory an empty MSF file could be reconstructed.

Reviewed By: ruiu, majnemer
Differential Revision: http://reviews.llvm.org/D20971

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 20:37:05 +00:00
Dan Liew
47f223bd24 [LibFuzzer] Provide stub implementation of __sanitizer_cov_trace_pc_indir
Calls to this function are currently injected by the
``SanitizerCoverageModule`` pass when the both the ``indirect-calls``
and ``trace-pc`` sanitizer coverage options are enabled and the code
being instrumented has indirect calls. Previously because LibFuzzer did
not define this function this would lead to link errors when building
some of the tests on OSX.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 20:27:09 +00:00
Matt Arsenault
f4135c634c AMDGPU: Add function for getting instruction size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 20:10:33 +00:00
Matt Arsenault
bc1b8d5b49 AMDGPU: Fix constantexpr addrspacecasts
If we had a constant group address space cast the queue pointer
wasn't enabled for the function, resulting in a crash on noreg
later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 20:03:31 +00:00
Davide Italiano
3ff92c7452 [PM] Preserve the correct set of analyses for GVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 20:01:50 +00:00
Davide Italiano
d4b932e94b [GVN] Switch dump() definition over to LLVM_DUMP_METHOD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 19:24:27 +00:00
Michael Zolotukhin
c711b13613 [LoopUnrollAnalyzer] Fix a crash in analyzeLoopUnrollCost.
In some cases, when simplifying with SCEV, we might consider pointer values as
just usual integer values.  Thus, we might get a different type from what we
had originally in the map of simplified values, and hence we need to check
types before operating on the values.

This fixes PR28015.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 19:21:40 +00:00
Haicheng Wu
a6caf31dea Fix a test case. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 19:11:53 +00:00
Geoff Berry
5c724a4fef Reapply [LSR] Create fewer redundant instructions.
Summary:
Fix LSRInstance::HoistInsertPosition() to check the original insert
position block first for a canonical insertion point that is dominated
by all inputs.  This leads to SCEV being able to reuse more instructions
since it currently tracks the instructions it creates for reuse by
keeping a table of <Value, insert point> pairs.

Originally reviewed in http://reviews.llvm.org/D18001

Reviewers: atrick

Subscribers: llvm-commits, mzolotukhin, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 19:10:46 +00:00
Rui Ueyama
24ef682bfb [pdbdump] Print out New FPO stream contents.
The data strucutre in the new FPO stream is described in the
PE/COFF spec. There is one record per function if frame pointer
is omitted.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:39:21 +00:00
Haicheng Wu
84755987d0 [MBP] Reduce code size by running tail merging in MBP.
The code layout that TailMerging (inside BranchFolding) works on is not the
final layout optimized based on the branch probability. Generally, after
BlockPlacement, many new merging opportunities emerge.

This patch calls Tail Merging after MBP and calls MBP again if Tail Merging
merges anything.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:36:07 +00:00
Lang Hames
eaf5ddfe77 [Kaleidoscope][BuildingAJIT] Fix hyphenation in chapter 2 title.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:35:44 +00:00
Haicheng Wu
f15d24533e [BranchFolding] Replace MachineBlockFrequencyInfo with MBFIWrapper. NFC.
Differential Revision: http://reviews.llvm.org/D20184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271923 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:35:41 +00:00
Alina Sbirlea
36f2326b3f [cpu-detection] Substantial refactor of Host CPU detection code (x86)
Summary:
Following D20970 (committed as r271726).
This is a substantial refactoring of the host CPU detection code.

There is no functionality change intended, but the changes are extensive.

Definitions of architecture types and subtypes are by no means exhaustive or
perfectly defined, but a fair starting point.
Suggestions for futher improvements are welcome.

Reviewers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:29:59 +00:00
Lang Hames
5d3458a04a [Kaleidoscope][BuildingAJIT] More cleanup of Chapter 2.
Streamline some wording, fix a bug in the markup for the layer interface table.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:22:47 +00:00
Lang Hames
bae1eaf5d8 [Kaleidoscope][BuildingAJIT] Clean up sentence, remove comments from code block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:07:23 +00:00
Sanjay Patel
b17db4cf26 [InstCombine] limit icmp transform to ConstantInt (PR28011)
In r271810 ( http://reviews.llvm.org/rL271810 ), I loosened the check
above this to work for any Constant rather than ConstantInt. AFAICT, 
that part makes sense if we can determine that the shrunken/extended 
constant remained equal. But it doesn't make sense for this later 
transform where we assume that the constant DID change. 

This could assert for a ConstantExpr:
https://llvm.org/bugs/show_bug.cgi?id=28011

And it could be wrong for a vector as shown in the added regression test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 16:56:57 +00:00
Sanjay Patel
60107575fd regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 16:03:06 +00:00
Sanjay Patel
eec2d5322b regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 15:55:00 +00:00
Artem Tamazov
7049ac906c [AMDGPU][llvm-mc] v_cndmask_b32: src2 is mandatory; do not enforce VOP2 when src2 == VCC.
Another step for unification llvm assembler/disassembler with sp3.
Besides, CodeGen output is a bit improved, thus changes in CodeGen tests.
Assembler/Disassembler tests updated/added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 15:23:43 +00:00
Matthew Simpson
683b746f24 [LAA] Use load and store vectors (NFC)
Contributed-by: Aditya Kumar <hiraditya@msn.com>
Differential Revision: http://reviews.llvm.org/D20953

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 14:15:41 +00:00
Igor Breger
5238dbe213 [KNL] Fix UMULO lowering.
Differential Revision: http://reviews.llvm.org/D21013

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 12:24:52 +00:00