Hal Finkel [Sat, 30 Apr 2016 01:59:28 +0000 (01:59 +0000)]
[PowerPC/QPX] Fix the load/splat peephole with overlapping reads
If, in between the splat and the load (which does an implicit splat), there is
a read of the splat register, then that register must have another earlier
definition. In that case, we can't replace the load's destination register with
the splat's destination register.
Unfortunately, I don't have a small or non-fragile test case.
llvm-svn: 268152
Amjad Aboud [Sat, 30 Apr 2016 01:44:38 +0000 (01:44 +0000)]
Reverting 268055 as it caused PR27579.
llvm-svn: 268151
Amjad Aboud [Sat, 30 Apr 2016 01:44:07 +0000 (01:44 +0000)]
Reverting 268054 & 268063 as they caused PR27579.
llvm-svn: 268150
Rafael Espindola [Sat, 30 Apr 2016 01:15:17 +0000 (01:15 +0000)]
Don't create dynamic relocations to ro segments.
These would just crash at runtime.
If we ever decide to support rw text segments this should make it easier
to implement as there is now a single point where we notice the problem.
I have tested this with a freebsd buildworld. It found a non pic
assembly file being linked into a .so,. With that fixed, buildworld
finished.
llvm-svn: 268149
Sanjoy Das [Sat, 30 Apr 2016 00:55:59 +0000 (00:55 +0000)]
[LowerGuardIntrinsics] Keep track of !make.implicit metadata
If a guard call being lowered by LowerGuardIntrinsics has the
`!make.implicit` metadata attached, then reattach the metadata to the
branch in the resulting expanded form of the intrinsic. This allows us
to implement null checks as guards and still get the benefit of implicit
null checks.
llvm-svn: 268148
Lawrence Hu [Sat, 30 Apr 2016 00:51:22 +0000 (00:51 +0000)]
Reroll loops with multiple IV and negative step part 3
support multiple induction variables
This patch enable loop reroll for the following case:
for(int i=0; i<N; i += 2) {
S += *a++;
S += *a++;
};
Differential Revision: http://reviews.llvm.org/D16550
llvm-svn: 268147
Lang Hames [Sat, 30 Apr 2016 00:50:26 +0000 (00:50 +0000)]
[Orc] Fix the AArch64 resolver size.
llvm-svn: 268146
Rafael Espindola [Sat, 30 Apr 2016 00:49:10 +0000 (00:49 +0000)]
Don't depend on lld creating relocations in ro segments.
We currently don't do a good job of diagnosing inputs that would require
dynamic relocations to be applied to read only segments.
I am about to improve lld in that area, but unfortunately we developed
tests that depend on the current behavior.
To make clear what is actually changing, this first patch just updates
tests to not depend on the current behavior. In most cases this just
means using a rw section instead of a ro one, but that unfortunately
changes many addresses.
llvm-svn: 268145
Vedant Kumar [Sat, 30 Apr 2016 00:32:54 +0000 (00:32 +0000)]
Fix a typo (NFC)
llvm-svn: 268144
Tom Stellard [Sat, 30 Apr 2016 00:23:06 +0000 (00:23 +0000)]
AMDGPU/SI: Enable the post-ra scheduler
Summary:
This includes a hazard recognizer implementation to replace some of
the hazard handling we had during frame index elimination.
Reviewers: arsenm
Subscribers: qcolombet, arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18602
llvm-svn: 268143
Sanjoy Das [Sat, 30 Apr 2016 00:17:47 +0000 (00:17 +0000)]
[LowerGuardIntrinsics] Preserve calling conv when lowering
llvm-svn: 268142
Sanjay Patel [Sat, 30 Apr 2016 00:12:54 +0000 (00:12 +0000)]
add minimal test to show dropped metadata
llvm-svn: 268141
Eugene Zelenko [Sat, 30 Apr 2016 00:11:10 +0000 (00:11 +0000)]
[Release Notes] Mention Clang-tidy cert-err34-c check.
Fix order and style of Boost related notes.
llvm-svn: 268140
Sanjay Patel [Sat, 30 Apr 2016 00:02:36 +0000 (00:02 +0000)]
remove the metadata added with r267827
We can demonstrate the 'select' bug and fix with a simpler test case.
The merged weight values are already tested in another test.
llvm-svn: 268139
Filipe Cabecinhas [Fri, 29 Apr 2016 23:42:34 +0000 (23:42 +0000)]
Fix test's memory leaks.
llvm-svn: 268138
Sriraman Tallam [Fri, 29 Apr 2016 23:38:53 +0000 (23:38 +0000)]
Delete store to Target option PositionIndependentExecutable as PIE is now set in module flags.
Differential Revision: http://reviews.llvm.org/D19749
llvm-svn: 268137
Rafael Espindola [Fri, 29 Apr 2016 23:35:49 +0000 (23:35 +0000)]
Document how to recreate a binary.
llvm-svn: 268136
Chaoren Lin [Fri, 29 Apr 2016 23:34:44 +0000 (23:34 +0000)]
Fix TestEnumTypes.py for 32 bit platforms.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D19751
llvm-svn: 268135
Rafael Espindola [Fri, 29 Apr 2016 23:28:36 +0000 (23:28 +0000)]
Document how to recreate a binary.
llvm-svn: 268134
Rafael Espindola [Fri, 29 Apr 2016 23:20:30 +0000 (23:20 +0000)]
Use simpler types. NFC.
llvm-svn: 268133
Justin Lebar [Fri, 29 Apr 2016 23:05:19 +0000 (23:05 +0000)]
[CUDA] Copy host builtin types to NVPTXTargetInfo.
Summary:
Host and device types must match, otherwise when we pass values back and
forth between the host and device, we will get the wrong result.
This patch makes NVPTXTargetInfo inherit most of its type information
from the host's target info.
Reviewers: rsmith
Subscribers: cfe-commits, jhen, tra
Differential Revision: http://reviews.llvm.org/D19346
llvm-svn: 268131
Xinliang David Li [Fri, 29 Apr 2016 22:59:36 +0000 (22:59 +0000)]
Reapply r268107 after fixing a bug breaks debug build.
Makes the new method to set data needed by debug dump.
llvm-svn: 268130
Denis Zobnin [Fri, 29 Apr 2016 22:50:16 +0000 (22:50 +0000)]
[NFC] Initialize a variable to make buildbot green.
In r268085 "[MS] Make #pragma pack use PragmaStack<> class." there was an
uninitialized variable 'Alignment', which caused the following failure:
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/1758
Zero-initialize the variable to fix this failure.
llvm-svn: 268129
Chris Bieneman [Fri, 29 Apr 2016 22:44:33 +0000 (22:44 +0000)]
Fix test case for incompatible sysroot warning
r268127 broke some bots because it needs to specify a darwin target.
llvm-svn: 268128
Chris Bieneman [Fri, 29 Apr 2016 22:28:34 +0000 (22:28 +0000)]
Add a new warning to notify users of mismatched SDK and deployment target
Summary:
This patch adds a new driver warning -Wincompatible-sdk which notifies the user when they are mismatching the version min options and the sysroot.
The patch works by checking the sysroot (if present) for an SDK name, then matching that against the target platform. In the case of a mismatch it logs a warning.
Reviewers: bob.wilson, rsmith
Subscribers: rsmith, edward-san, cfe-commits
Differential Revision: http://reviews.llvm.org/D18088
llvm-svn: 268127
Sanjoy Das [Fri, 29 Apr 2016 22:23:16 +0000 (22:23 +0000)]
Mark guards on true as "trivially dead"
This moves some logic added to EarlyCSE in rL268120 into
`llvm::isInstructionTriviallyDead`. Adds a test case for DCE to
demonstrate that passes other than EarlyCSE can now pick up on the new
information.
llvm-svn: 268126
Chris Bieneman [Fri, 29 Apr 2016 22:19:35 +0000 (22:19 +0000)]
[CMake] [Xcode] Improving Xcode toolchain generation to support distribution targets
This adds a new target `install-distribution-toolchain` which will install an Xcode toolchain featuring just the LLVM components specified in LLVM_DISTRIBUTION_COMPONENTS.
llvm-svn: 268125
Chris Bieneman [Fri, 29 Apr 2016 22:17:15 +0000 (22:17 +0000)]
[CMake] Create a separate install target for libcxx headers
This change doesn't impact the behavior of the install-libcxx target which installs whichever libcxx components you build, it just adds a separate target to just install the headers.
llvm-svn: 268124
Sanjay Patel [Fri, 29 Apr 2016 22:03:27 +0000 (22:03 +0000)]
clean up documentation comments; NFC
llvm-svn: 268122
Haicheng Wu [Fri, 29 Apr 2016 22:01:10 +0000 (22:01 +0000)]
[MBP] Use Function::optForSize() instead of checking OptimizeForSize directly.
Fix a FIXME. Disable loop alignment if compiled with -Oz now.
llvm-svn: 268121
Sanjoy Das [Fri, 29 Apr 2016 21:52:58 +0000 (21:52 +0000)]
[EarlyCSE] Simplify guard intrinsics
Summary:
This change teaches EarlyCSE some basic properties of guard intrinsics:
- Guard intrinsics read all memory, but don't write to any memory
- After a guard has executed, the condition it was guarding on can be
assumed to be true
- Guard intrinsics on a constant `true` are no-ops
Reviewers: reames, hfinkel
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D19578
llvm-svn: 268120
Matt Arsenault [Fri, 29 Apr 2016 21:52:13 +0000 (21:52 +0000)]
AMDGPU: Fix crash with unreachable terminators.
If a block has no successors because it ends in unreachable,
this was accessing an invalid iterator.
Also stop counting instructions that don't emit any
real instructions.
llvm-svn: 268119
Davide Italiano [Fri, 29 Apr 2016 21:44:02 +0000 (21:44 +0000)]
[ELF] Ignore -d option (and aliases).
The linker already allocates common symbols by default.
Discussed with Rafael.
llvm-svn: 268117
Xinliang David Li [Fri, 29 Apr 2016 21:43:28 +0000 (21:43 +0000)]
Revert r268107 -- debug build failure
llvm-svn: 268116
Simon Pilgrim [Fri, 29 Apr 2016 21:34:54 +0000 (21:34 +0000)]
[InstCombine][SSE] PSHUFB to shuffle combine to use general aggregate elements. NFCI.
Make use of Constant::getAggregateElement instead of checking constant types - first step towards adding support for UNDEF mask elements.
llvm-svn: 268115
Filipe Cabecinhas [Fri, 29 Apr 2016 21:33:12 +0000 (21:33 +0000)]
Try to fix clang-cmake-aarch64-42vma by removing a memory leak (have a global var capture it).
llvm-svn: 268114
George Burgess IV [Fri, 29 Apr 2016 21:32:53 +0000 (21:32 +0000)]
[Sema] Specify the underlying type for an enum. NFC.
llvm-svn: 268113
Lang Hames [Fri, 29 Apr 2016 21:32:00 +0000 (21:32 +0000)]
[Orc] Add ORC lazy-compilation support for AArch64.
The ORC compile callbacks and indirect stubs APIs will now work for AArc64,
allowing functions to be lazily compiled and/or updated.
llvm-svn: 268112
Lang Hames [Fri, 29 Apr 2016 21:29:48 +0000 (21:29 +0000)]
[Orc] Make sure we don't drop the internal error in OrcRemoteTargetClient when
the constructor fails, as this would lead to an 'unchecked error' crash.
llvm-svn: 268111
Greg Clayton [Fri, 29 Apr 2016 21:26:46 +0000 (21:26 +0000)]
Watch out for compilers that generate bad bitfield info. If the bit size of a bitfield member doesn't lie within the bit bounds of the type itself, just leave it out so we don't get clang asserting and killing our IDE when it gets unhappy with the information.
https://llvm.org/bugs/show_bug.cgi?id=27515
<rdar://problem/
21082998>
llvm-svn: 268110
Chris Bieneman [Fri, 29 Apr 2016 21:23:24 +0000 (21:23 +0000)]
[Docs] Refer to the CMakePrimer from CMake doc
The "Building LLVM with CMake" document should have a reference to the CMakePrimer.
llvm-svn: 268109
David Majnemer [Fri, 29 Apr 2016 21:22:04 +0000 (21:22 +0000)]
[ValueTracking] Make the code in lookThroughCast
No functionality change is intended.
llvm-svn: 268108
Xinliang David Li [Fri, 29 Apr 2016 21:21:44 +0000 (21:21 +0000)]
[inliner]: Refactor inline deferring logic into its own method /NFC
The implemented heuristic has a large body of code which better sits
in its own function for better readability. It also allows adding more
heuristics easier in the future.
llvm-svn: 268107
Sriraman Tallam [Fri, 29 Apr 2016 21:19:16 +0000 (21:19 +0000)]
Differential Revision: reviews.llvm.org/D19733
llvm-svn: 268106
Matt Arsenault [Fri, 29 Apr 2016 21:16:52 +0000 (21:16 +0000)]
AMDGPU: Add kernarg.segment.ptr intrinsic
llvm-svn: 268105
Chad Rosier [Fri, 29 Apr 2016 21:12:31 +0000 (21:12 +0000)]
[InstCombine] Determine the result of a select based on a dominating condition.
Differential Revision: http://reviews.llvm.org/D19550
llvm-svn: 268104
Aaron Ballman [Fri, 29 Apr 2016 21:05:55 +0000 (21:05 +0000)]
Add the ability to determine whether a format string argument is of a double type or not. This change is tested by clang-tidy in r268100.
llvm-svn: 268103
Matt Arsenault [Fri, 29 Apr 2016 21:02:04 +0000 (21:02 +0000)]
Fix comment
llvm-svn: 268102
Greg Clayton [Fri, 29 Apr 2016 21:00:38 +0000 (21:00 +0000)]
Fix TestGetVariables.py so it works correctly. We had duplicate static values showing up as we would find static variables in the Block and also in the compile unit. We now make sure a variable hasn't been added to the list before we add it.
llvm-svn: 268101
Aaron Ballman [Fri, 29 Apr 2016 20:56:48 +0000 (20:56 +0000)]
Add a clang-tidy check that flags string-to-number conversion functions that have insufficient error checking, suggesting a better alternative.
This check corresponds to: https://www.securecoding.cert.org/confluence/display/c/ERR34-C.+Detect+errors+when+converting+a+string+to+a+number
llvm-svn: 268100
Sanjay Patel [Fri, 29 Apr 2016 20:54:56 +0000 (20:54 +0000)]
[InstCombine] clean up; NFC
llvm-svn: 268099
Greg Clayton [Fri, 29 Apr 2016 20:48:39 +0000 (20:48 +0000)]
Make sure LLDB can deal with forward declarations to enums without crashing or asserting.
<rdar://problem/
23776428>
llvm-svn: 268098
Filipe Cabecinhas [Fri, 29 Apr 2016 20:37:34 +0000 (20:37 +0000)]
[asan] Assert in __sanitizer_ptr_{sub,cmp} if one of the pointers was freed.
Summary:
This (partially) implements the check mentioned at
http://kristerw.blogspot.co.uk/2016/04/dangling-pointers-and-undefined-behavior.html
(via John Regehr)
Quoting:
"That the behavior is undefined follows from C11 6.2.4 "Storage
durations of objects"
The lifetime of an object is the portion of program execution during
which storage is guaranteed to be reserved for it. An object exists, has
a constant address, and retains its last-stored value throughout its
lifetime. If an object is referred to outside of its lifetime, the
behavior is undefined. The value of a pointer becomes indeterminate when
the object it points to (or just past) reaches the end of its lifetime.
and 7.22.3 "Memory management functions" that says that free ends the
lifetime of objects
The lifetime of an allocated object extends from the allocation until
the deallocation.
"
We can probably implement this for stack variables too, but I think this
is a good start to see if there's interest in this check.
We can also hide this behind a flag, too.
Reviewers: samsonov, kcc, rsmith, regehr
Subscribers: kubabrecka, llvm-commits
Differential Revision: http://reviews.llvm.org/D19691
llvm-svn: 268097
Chris Bieneman [Fri, 29 Apr 2016 20:34:54 +0000 (20:34 +0000)]
[Docs] Add CMake Primer document
This document is intended to provide a basic overview of the CMake scripting language for LLVM developers. It was unorthodoxly reviewed for accuracy and content on the CMake developer list:
http://public.kitware.com/pipermail/cmake-developers/2016-April/028300.html
llvm-svn: 268096
Matt Arsenault [Fri, 29 Apr 2016 20:23:42 +0000 (20:23 +0000)]
AMDGPU/SI: Move post regalloc run of SIShrinkInstructions
Move to addPreEmitPass. This is so it runs after post-RA
scheduling so we can merge s_nops emitted by the scheduler
and hazard recognizer.
llvm-svn: 268095
Matt Arsenault [Fri, 29 Apr 2016 19:53:16 +0000 (19:53 +0000)]
DAGCombiner: Reduce truncated shl width
llvm-svn: 268094
Eugene Zelenko [Fri, 29 Apr 2016 19:47:09 +0000 (19:47 +0000)]
Fix some Include What You Use warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D19735
llvm-svn: 268093
Kostya Serebryany [Fri, 29 Apr 2016 19:28:24 +0000 (19:28 +0000)]
[libFuzzer] fix docs
llvm-svn: 268092
Manman Ren [Fri, 29 Apr 2016 19:04:05 +0000 (19:04 +0000)]
Method Pool in modules: we make sure that if a module contains an entry for
a selector, the entry should be complete, containing everything introduced by
that module and all modules it imports.
Before writing out the method pool of a module, we sync up the out of date
selectors by pulling in methods for the selectors, from all modules it imports.
In ReadMethodPool, after pulling in the method pool entry for module A, this
lets us skip the modules that module A imports.
rdar://problem/
25900131
llvm-svn: 268091
Easwaran Raman [Fri, 29 Apr 2016 18:53:16 +0000 (18:53 +0000)]
Use the new path for coverage related headers and update CMakeLists.txt
Differential Revision: http://reviews.llvm.org/D19612
llvm-svn: 268090
Easwaran Raman [Fri, 29 Apr 2016 18:53:05 +0000 (18:53 +0000)]
Move coverage related code into a separate library.
Differential Revision: http://reviews.llvm.org/D19333
llvm-svn: 268089
Kostya Serebryany [Fri, 29 Apr 2016 18:49:55 +0000 (18:49 +0000)]
[libFuzzer] enable detect_leaks=1, add proper docs
llvm-svn: 268088
George Burgess IV [Fri, 29 Apr 2016 18:42:55 +0000 (18:42 +0000)]
[MemorySSA] Fix bugs in walker; refactor unittests a bit.
This patch fixes two somewhat related bugs in MemorySSA's caching
walker. These bugs were found because D19695 brought up the problem
that we'd have defs cached to themselves, which is incorrect.
The bugs this fixes are:
- We would sometimes skip the nearest clobber of a MemoryAccess, because
we would query our cache for a given potential clobber before
checking if the potential clobber is the clobber we're looking for.
The cache entry for the potential clobber would point to the nearest
clobber *of the potential clobber*, so if that was a cache hit, we'd
ignore the potential clobber entirely.
- There are times (sometimes in DFS, sometimes in the getClobbering...
functions) where we would insert cache entries that say a def
clobbers itself.
There's a bit of common code between the fixes for the bugs, so they
aren't split out into multiple commits.
This patch also adds a few unit tests, and refactors existing tests a
bit to reduce the duplication of setup code.
llvm-svn: 268087
David Majnemer [Fri, 29 Apr 2016 18:40:34 +0000 (18:40 +0000)]
[ValueTracking] matchSelectPattern needs to be more careful around FP
matchSelectPattern attempts to see through casts which mask min/max
patterns from being more obvious. Under certain circumstances, it would
misidentify a sequence of instructions as a min/max because it assumed
that folding casts would preserve the result. This is not the case for
floating point <-> integer casts.
This fixes PR27575.
llvm-svn: 268086
Denis Zobnin [Fri, 29 Apr 2016 18:17:40 +0000 (18:17 +0000)]
[MS] Make #pragma pack use PragmaStack<> class.
Make implementation of #pragma pack consistent with other "stack" pragmas.
Use PragmaStack<> class instead of old representation of internal stack.
Don't change compiler's behavior.
TODO:
1. Introduce diagnostics on popping named slots from pragma stacks.
Reviewer: rnk
Differential revision: http://reviews.llvm.org/D19727
llvm-svn: 268085
Zachary Turner [Fri, 29 Apr 2016 18:09:19 +0000 (18:09 +0000)]
Fix crash in PDB when loading corrupt file.
There are probably hundreds of crashers we can find by fuzzing
more. For now we do the simplest possible validation of the
block size. Later, more complicated validations can verify that
other fields of the super block such as directory size, number
of blocks, agree with the size of the file etc.
llvm-svn: 268084
Sean Callanan [Fri, 29 Apr 2016 18:09:03 +0000 (18:09 +0000)]
[fix] Fixed a bug where const this would cause parser errors about $__lldb_expr.
In templated const functions, trying to run an expression would produce the
error
error: out-of-line definition of '$__lldb_expr' does not match any declaration
in 'foo' member declaration does not match because it is const qualified
error: 1 error parsing expression
which is no good. It turned out we don't actually need to worry about "const,"
we just need to be consistent about the declaration of the expression and the
FunctionDecl we inject into the class for "this."
Also added a test case.
<rdar://problem/
24985958>
llvm-svn: 268083
Reid Kleckner [Fri, 29 Apr 2016 18:06:53 +0000 (18:06 +0000)]
Fix crash in BuildCXXDefaultInitExpr.
Fix crash in BuildCXXDefaultInitExpr when member of template class has
same name as the class itself.
Based on patch by Raphael "Teemperor" Isemann!
Differential Revision: http://reviews.llvm.org/D19721
llvm-svn: 268082
Hubert Tong [Fri, 29 Apr 2016 18:05:37 +0000 (18:05 +0000)]
[Concepts] Pass requires-clause to ActOnTemplateParameterList; NFC
Summary:
Prepare to store requires-clause expression for access via
TemplateParameterList.
Reviewers: aaron.ballman, faisalv, rsmith
Subscribers: cfe-commits, nwilson
Differential Revision: http://reviews.llvm.org/D19220
llvm-svn: 268081
Rui Ueyama [Fri, 29 Apr 2016 17:58:48 +0000 (17:58 +0000)]
Fix typo in test.
llvm-svn: 268080
Piotr Padlewski [Fri, 29 Apr 2016 17:58:29 +0000 (17:58 +0000)]
Add boost-use-to-string
http://reviews.llvm.org/D18136
llvm-svn: 268079
Chris Bieneman [Fri, 29 Apr 2016 17:53:00 +0000 (17:53 +0000)]
[Clang][Darwin] Define __ARM_DWARF_EH__ for WatchABI
Summary: The Darwin armv7k ABI uses Dwarf EH, so we need to set the OS define correctly. Without this the gcc_personality fails to build.
Reviewers: t.p.northover
Subscribers: aemerson, cfe-commits, rengolin
Differential Revision: http://reviews.llvm.org/D19693
llvm-svn: 268078
Rafael Espindola [Fri, 29 Apr 2016 17:46:07 +0000 (17:46 +0000)]
Be sure to always increment the Versym pointer.
It was getting out of sync if we had undefined symbols at the start of
the symbol table.
llvm-svn: 268077
Piotr Padlewski [Fri, 29 Apr 2016 17:45:20 +0000 (17:45 +0000)]
small reformat to test access
llvm-svn: 268076
Robert Lougher [Fri, 29 Apr 2016 17:44:29 +0000 (17:44 +0000)]
Improve test coverage of -Wdouble-promotion
This patch adds coverage for additional cases where implicit conversion can
occur (assignment and return). It also adds tests for some cases where a
warning should occur but none is produced. These are marked as FIXME.
Differential Revision: http://reviews.llvm.org/D16298
llvm-svn: 268075
Simon Pilgrim [Fri, 29 Apr 2016 17:42:45 +0000 (17:42 +0000)]
Use SelectionDAG::getTargetConstant* helper functions. NFC.
Instead of SelectionDAG::getConstant directly to make it more obvious that we're creating target constants.
llvm-svn: 268074
Artem Tamazov [Fri, 29 Apr 2016 17:41:44 +0000 (17:41 +0000)]
[AMDGPU][llvm-mc] Add some missing testcases to trap.s
Differential Revision: http://reviews.llvm.org/D19602
llvm-svn: 268073
Zachary Turner [Fri, 29 Apr 2016 17:28:47 +0000 (17:28 +0000)]
Put PDB parsing code into a pdb namespace.
llvm-svn: 268072
Zachary Turner [Fri, 29 Apr 2016 17:22:58 +0000 (17:22 +0000)]
Refactor the PDB Stream reading interface.
The motivation for this change is that PDB has the notion of
streams and substreams. Substreams often consist of variable
length structures that are convenient to be able to treat as
guaranteed, contiguous byte arrays, whereas the streams they
are contained in are not necessarily so, as a single stream
could be spread across many discontiguous blocks.
So, when processing data from a substream, we want to be able
to assume that we have a contiguous byte array so that we can
cast pointers to variable length arrays and such.
This leads to the question of how to be able to read the same
data structure from either a stream or a substream using the
same interface, which is where this patch comes in.
We separate out the stream's read state from the underlying
representation, and introduce a `StreamReader` class. Then
we change the name of `PDBStream` to `MappedBlockStream`, and
introduce a second kind of stream called a `ByteStream` which is
simply a sequence of contiguous bytes. Finally, we update all
of the std::vectors in `PDBDbiStream` to use `ByteStream` instead
as a proof of concept.
llvm-svn: 268071
Rafael Espindola [Fri, 29 Apr 2016 17:19:45 +0000 (17:19 +0000)]
Fix the alignment of the version info.
llvm-svn: 268070
Dehao Chen [Fri, 29 Apr 2016 17:19:10 +0000 (17:19 +0000)]
Do not read callee name when matching IR to profile as it is not used.
Summary: Callee name is not used to identify a callsite now, so do not read it during annotation.
Reviewers: davidxl, dnovillo
Subscribers: dnovillo, danielcdh, llvm-commits
Differential Revision: http://reviews.llvm.org/D19704
llvm-svn: 268069
Geoff Berry [Fri, 29 Apr 2016 17:18:28 +0000 (17:18 +0000)]
[BasicAA] Treat llvm.assume as not accessing memory in getModRefBehavior(Function)
Reviewers: dberlin, chandlerc, hfinkel, reames, sanjoy
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D19730
llvm-svn: 268068
Haicheng Wu [Fri, 29 Apr 2016 17:06:44 +0000 (17:06 +0000)]
[MBP] Split placement and alignment into two functions. NFC.
Cut and Paste.
llvm-svn: 268067
Artem Tamazov [Fri, 29 Apr 2016 17:04:50 +0000 (17:04 +0000)]
Fixed/Recommitted r267733 "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."
Previously reverted by r267752.
r267733 review:
Differential Revision: http://reviews.llvm.org/D19342
llvm-svn: 268066
Paul Robinson [Fri, 29 Apr 2016 17:03:34 +0000 (17:03 +0000)]
Add a Subjects line to NoDebugAttr [NFC].
The 'nodebug' attribute had hand-coded constraints; replace those with
a Subjects line in Attr.td.
Also add a missing test to verify the attribute is okay on an
Objective-C method.
Differential Revision: http://reviews.llvm.org/D19689
llvm-svn: 268065
Guozhi Wei [Fri, 29 Apr 2016 17:00:54 +0000 (17:00 +0000)]
[PPC] Enable shuffling of VSX vectors
This patch fixes PR27078 by enabling shuffling of vectors if VSX is available.
llvm-svn: 268064
Amjad Aboud [Fri, 29 Apr 2016 16:54:18 +0000 (16:54 +0000)]
Fixed LIT tests that was broken after change in r268054.
llvm-svn: 268063
Filipe Cabecinhas [Fri, 29 Apr 2016 16:48:07 +0000 (16:48 +0000)]
Add operator- to Path's reverse_iterator. Needed for D19666
Reviewers: rafael, craig.topper, bogner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19724
llvm-svn: 268062
Sanjay Patel [Fri, 29 Apr 2016 16:39:37 +0000 (16:39 +0000)]
auto-generate checks
llvm-svn: 268061
Rafael Espindola [Fri, 29 Apr 2016 16:23:31 +0000 (16:23 +0000)]
Fix producing undefined reference to __progname.
We were not producing them if the library had version info.
llvm-svn: 268060
Sanjay Patel [Fri, 29 Apr 2016 16:22:25 +0000 (16:22 +0000)]
[InstCombine] add helper function for ICmp with constant canonicalization; NFCI
As suggested in http://reviews.llvm.org/D17859 , we should enhance this
to support vectors.
llvm-svn: 268059
Daniel Sanders [Fri, 29 Apr 2016 16:16:49 +0000 (16:16 +0000)]
[mips][ias] Move createCpRestoreMemOp to MipsTargetStreamer. NFC.
Summary:
This removes the temporary call to isIntegratedAssemblerRequired() which was
added recently. It's effect is now acheived directly in the MipsTargetStreamer
hierarchy.
Reviewers: sdardis
Subscribers: dsanders, sdardis, llvm-commits
Differential Revision: http://reviews.llvm.org/D19715
llvm-svn: 268058
Krzysztof Parzyszek [Fri, 29 Apr 2016 16:14:00 +0000 (16:14 +0000)]
Fix NDEBUG build: variables used only in debug code causing compile error
llvm-svn: 268057
Rui Ueyama [Fri, 29 Apr 2016 16:12:29 +0000 (16:12 +0000)]
ELF: Add -O0 (produce output as fast as possible) mode.
This patch redefines the default optimization level as 1 and adds
new level 0. In the command line, it is -O0. The flag disables
costly but optional features so that the linker produces semantically
correct but larger output quickly. Currently it only disables
section merging.
This flag is not intended to be used for final production linking.
It is intended to be used in compile-link-test cycle.
Time to link clang with debug info is about 2x faster with the flag.
Head:
13.24 seconds
Output size:
1227189664 bytes
With this patch:
7.41 seconds
Output size:
2490281784 bytes
Differential Revision: http://reviews.llvm.org/D19705
llvm-svn: 268056
Amjad Aboud [Fri, 29 Apr 2016 16:08:08 +0000 (16:08 +0000)]
Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 in r267004.
llvm-svn: 268055
Amjad Aboud [Fri, 29 Apr 2016 16:07:55 +0000 (16:07 +0000)]
Recommitted r264280 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 in r267004.
llvm-svn: 268054
Simon Dardis [Fri, 29 Apr 2016 16:07:47 +0000 (16:07 +0000)]
[mips][FastISel] A store is not a load.
Correct trivial error. One of the failing tests from PR/27458.
Reviewers: dsanders, vkalintiris, mcrosier
Differential Review: http://reviews.llvm.org/D19726
llvm-svn: 268053
Simon Dardis [Fri, 29 Apr 2016 16:04:18 +0000 (16:04 +0000)]
[PATCH] [mips] Fix forbidden slot hazard handling
MipsHazardSchedule has to determine what the next physical machine instruction
is to decide whether to insert a nop. In case where a branch with a forbidden
slot appears at the end of a basic block, first *real* instruction of the next
physical basic block was determined using getFirstNonDebugInstr().
Unfortunately this only considers DBG_VALUEs and not other transient opcodes
such as EHLABEL. As EHLABEL passes the SafeInForbiddenSlot predicate and the
instruction after the EHLABEL can be a CTI, we observed test failures in the
LNT testsuite.
Reviewers: dsanders
Differential Review: http://reviews.llvm.org/D19051
llvm-svn: 268052
Krzysztof Parzyszek [Fri, 29 Apr 2016 15:49:13 +0000 (15:49 +0000)]
[Hexagon] Optimize addressing modes for load/store
Patch by Jyotsna Verma.
llvm-svn: 268051
Filipe Cabecinhas [Fri, 29 Apr 2016 15:22:48 +0000 (15:22 +0000)]
Unify XDEBUG and EXPENSIVE_CHECKS (into the latter), and add an option to the cmake build to enable them.
Summary:
Historically, we had a switch in the Makefiles for turning on "expensive
checks". This has never been ported to the cmake build, but the
(dead-ish) code is still around.
This will also make it easier to turn it on in buildbots.
Reviewers: chandlerc
Subscribers: jyknight, mzolotukhin, RKSimon, gberry, llvm-commits
Differential Revision: http://reviews.llvm.org/D19723
llvm-svn: 268050