Robert Flack [Tue, 10 Mar 2015 18:07:47 +0000 (18:07 +0000)]
Add Debugger::InitializeForLLGS to allow ref counted LLGS initialization.
After http://reviews.llvm.org/D8133 landed as r231550 process launch on remote platform stopped working.
This adds Debugger::InitializeForLLGS and tracks whether one or both of Initialize and InitializeForLLGS have been called, calling only the corresponding lldb_private::Terminate* methods as necessary. Since lldb_private::Terminate calls lldb_private::TerminateForLLGS, the latter method may be called twice if Initialize was called for both however the terminate methods ensure they are only called once after being initialized.
This still maintains the reduced binary size, though it does now technically link in lldb_private::Terminate on lldb-server even though this should never be called.
This should resolve the issue raised in http://reviews.llvm.org/D8133 where Debugger::Terminate assumed that there were 0 references to debugger and terminated early.
Differential Revision: http://reviews.llvm.org/D8183
llvm-svn: 231808
Adam Nemet [Tue, 10 Mar 2015 17:40:43 +0000 (17:40 +0000)]
[LoopAccesses 3/3] Print the dependences with -analyze
The dependences are now expose through the new getInterestingDependences
API so we can use that with -analyze too and fix the FIXME.
This lets us remove the test that relied on -debug to check the
dependences.
llvm-svn: 231807
Adam Nemet [Tue, 10 Mar 2015 17:40:37 +0000 (17:40 +0000)]
[LoopAccesses 2/3] Allow querying of interesting dependences
Gather an array of interesting dependences rather than just failing
after the first unsafe one and regarding the loop unsafe. Loop
Distribution needs to be able to collect all dependences in order to
isolate the dependence cycles into their own partition.
Since the dependence checking algorithm is quadratic in terms of
accesses sharing the same underlying pointer, I am applying a cut-off
threshold (MaxInterestingDependence). Exceeding that, the logic reverts
back to the original approach deeming the loop unsafe upon encountering
the first unsafe dependence.
The main idea of the patch is to split isDepedent from directly
answering the question whether the dep is safe for vectorization to
return a dependence type which then gets mapped to old boolean result
using Dependence::isSafeForVectorization.
Tested that this was compile-time neutral on SpecINT2006 LTO bitcode
inputs. No assembly change on the testsuite including external.
llvm-svn: 231806
Adam Nemet [Tue, 10 Mar 2015 17:40:34 +0000 (17:40 +0000)]
[LoopAccesses 1/3] Expose MemoryDepChecker to LAA users
LoopDistribution needs to query various results of the dependence
analysis. This series will expose some more APIs and state of the
dependence checker.
This patch is a simple one to just expose the DepChecker instance. The
set is compile-time neutral measured with LTO bitcode files of
SpecINT2006. Also there is no assembly change on the testsuite.
llvm-svn: 231805
Ilia K [Tue, 10 Mar 2015 17:24:32 +0000 (17:24 +0000)]
Fix a comment for ValueObject::GetValueDidChange after r231526
Summary:
Fix a comment for ValueObject::GetValueDidChange after r231526.
This fix was requested by @jingham.
Reviewers: jingham, ki.stfu
Reviewed By: ki.stfu
Subscribers: lldb-commits, jingham
Differential Revision: http://reviews.llvm.org/D8206
llvm-svn: 231804
Aaron Ballman [Tue, 10 Mar 2015 17:19:18 +0000 (17:19 +0000)]
The semantic spelling enumeration should retain values to the spelling list indexes used by the attribute. The only attribute affected by this in practice is the OpenCLImageAccessAttr, which has duplicate semantic spellings that are automatically stripped.
We do not implicitly create an OpenCLImageAccessAttr, so this change only affects out of tree users. There is no way to test this behavior specifically that I can see, since this only affects implicit creation of attributes.
Fixes PR22403.
llvm-svn: 231803
Rafael Espindola [Tue, 10 Mar 2015 16:58:10 +0000 (16:58 +0000)]
Store an optional section start label in MCSection.
This makes code that uses section relative expressions (debug info) simpler and
less brittle.
This is still a bit awkward as the symbol is created late and has to be
stored in a mutable field.
I will move the symbol creation earlier in the next patch.
llvm-svn: 231802
Sanjay Patel [Tue, 10 Mar 2015 16:42:24 +0000 (16:42 +0000)]
remove function names from comments; NFC
llvm-svn: 231801
Igor Laevsky [Tue, 10 Mar 2015 16:26:48 +0000 (16:26 +0000)]
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.
(Resubmitting this change after not being able to reproduce buildbot failure)
Differential Revision: http://reviews.llvm.org/D7760
llvm-svn: 231800
Chad Rosier [Tue, 10 Mar 2015 16:22:52 +0000 (16:22 +0000)]
[BranchFolding] Remove MMOs during tail merge to preserve dependencies.
When tail merging it may be necessary to remove MMOs from memory operations to
ensures later passes (e.g., MI sched) conservatively compute dependencies.
Currently, we only remove the MMO from the common tail if the MMO doesn't match
with the relative instruction in the non-common tail(s).
A more robust solution would be to add multiple MMOs from the duplicate MIs to
the new MI. Currently ScheduleDAGInstrs.cpp ignores all MMOs on instructions
with multiple MMOs, so this solution is equivalent for the time being.
No test case included as this is incredibly difficult to reproduce.
Patch was a collaborative effort between Ana Pazos and myself.
Phabricator: http://reviews.llvm.org/D7769
llvm-svn: 231799
Tom Stellard [Tue, 10 Mar 2015 16:16:51 +0000 (16:16 +0000)]
R600/SI: Add _IDXEN and _BOTHEN variants for buffer_store
llvm-svn: 231798
Tom Stellard [Tue, 10 Mar 2015 16:16:49 +0000 (16:16 +0000)]
R600/SI: Re-order MUBUF operands to match asm strings.
llvm-svn: 231797
Tom Stellard [Tue, 10 Mar 2015 16:16:48 +0000 (16:16 +0000)]
R600/SI: Move kill flag to second instruction when splitting SMRD
This fixes a machine verifier error in the salu-to-valu.ll, which
would have been exposed by a future commit.
llvm-svn: 231796
Tom Stellard [Tue, 10 Mar 2015 16:16:44 +0000 (16:16 +0000)]
R600/SI: Add 32-bit encoding of v_cndmask_b32
This was done by refactoring the v_cndmask_b32 tablegen definition
to use inherit from VOP2Inst.
llvm-svn: 231795
Sanjay Patel [Tue, 10 Mar 2015 16:08:36 +0000 (16:08 +0000)]
[X86, AVX] replace vinsertf128 intrinsics with generic shuffles
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.
This is the sibling patch for the Clang half of this change:
http://reviews.llvm.org/D8088
Differential Revision: http://reviews.llvm.org/D8086
llvm-svn: 231794
Tobias Grosser [Tue, 10 Mar 2015 15:24:33 +0000 (15:24 +0000)]
Fix compilation after DataLayout was added to ScevExpander
The corresponding LLVM commit is 231740.
llvm-svn: 231793
Sanjay Patel [Tue, 10 Mar 2015 15:19:26 +0000 (15:19 +0000)]
[X86, AVX] Replace vinsertf128 intrinsics with generic shuffles.
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.
This is the sibling patch for the LLVM half of this change:
http://reviews.llvm.org/D8086
Differential Revision: http://reviews.llvm.org/D8088
llvm-svn: 231792
Benjamin Kramer [Tue, 10 Mar 2015 15:06:38 +0000 (15:06 +0000)]
Hexagon: Remove pass that does nothing at all
llvm-svn: 231791
Rafael Espindola [Tue, 10 Mar 2015 14:48:01 +0000 (14:48 +0000)]
Remove effectively dead code.
Switching back and forth between sections does nothing (other than producing
larger .s files).
llvm-svn: 231790
Ben Langmuir [Tue, 10 Mar 2015 14:39:26 +0000 (14:39 +0000)]
Document __has_feature(modules) in LanguageExtensions
Fixes PR18985
Patch by Vassil Vassilev!
llvm-svn: 231789
Karthik Bhat [Tue, 10 Mar 2015 14:32:02 +0000 (14:32 +0000)]
Fix a memory corruption in Dependency Analysis.
This crash occurs due to memory corruption when trying to update dependency
direction based on Constraints.
This crash was observed during lnt regression of Polybench benchmark test case dynprog.
Review: http://reviews.llvm.org/D8059
llvm-svn: 231788
Renato Golin [Tue, 10 Mar 2015 13:58:33 +0000 (13:58 +0000)]
Allow -target= and --target options
Using clang as a cross-compiler with the 'target' option could be confusing
for those inexperienced in the realm of cross compiling.
This patch would allow the use of all these four variants of the target option:
-target <triple>
--target <triple>
-target=<triple>
--target=<triple>
Patch by Gabor Ballabas.
llvm-svn: 231787
Rafael Espindola [Tue, 10 Mar 2015 13:56:44 +0000 (13:56 +0000)]
Don't repeat names and clang-format this file.
llvm-svn: 231786
Aaron Ballman [Tue, 10 Mar 2015 13:56:28 +0000 (13:56 +0000)]
Removing dead code to silence warning C4060: switch statement contains no 'case' or 'default' labels; NFC.
llvm-svn: 231785
Karthik Bhat [Tue, 10 Mar 2015 13:31:03 +0000 (13:31 +0000)]
Fix a crash in Dependency Analysis.
This crash in Dependency analysis is because we assume here that in case of UsefulGEP
both source and destination have the same number of operands which may not be true.
This incorrect assumption results in crash while populating Pairs. Fix the same.
This crash was observed during lnt regression for code such as-
struct s{
int A[10][10];
int C[10][10][10];
} S;
void dep_constraint_crash_test(int k,int N) {
for( int i=0;i<N;i++)
for( int j=0;j<N;j++)
S.A[0][0] = S.C[0][0][k];
}
Review: http://reviews.llvm.org/D8162
llvm-svn: 231784
Daniel Sanders [Tue, 10 Mar 2015 10:42:59 +0000 (10:42 +0000)]
The operand flag word used in ISD::INLINEASM is an i32 not a pointer. NFC.
Summary:
This is part of the work to support memory constraints that behave
differently to 'm'. The subsequent patches will expand on the existing
encoding (which is a 32-bit int) and as a result in some flag words will no
longer fit into an i16. This problem only affected the MSP430 target which
appears to have 16-bit pointers.
Reviewers: hfinkel
Reviewed By: hfinkel
Subscribers: hfinkel, llvm-commits
Differential Revision: http://reviews.llvm.org/D8168
llvm-svn: 231783
Dmitry Vyukov [Tue, 10 Mar 2015 10:36:06 +0000 (10:36 +0000)]
asan: fix leak test for power platform
Power is 64-bit but does not support leak detection,
so this test fails. Use the more robust leak-detection
predicate instead.
llvm-svn: 231782
Andrey Churbanov [Tue, 10 Mar 2015 10:14:57 +0000 (10:14 +0000)]
fix for broken commit 231774
llvm-svn: 231781
Ed Schouten [Tue, 10 Mar 2015 09:35:22 +0000 (09:35 +0000)]
Also use LC_C_LOCALE on CloudABI.
Before I discovered that NetBSD provides a permanent handle to the C
locale called LC_C_LOCALE, I also added support for this to CloudABI
under the name LC_POSIX_LOCALE. I've renamed it to LC_C_LOCALE to
improve compatibility.
llvm-svn: 231780
Andrey Churbanov [Tue, 10 Mar 2015 09:34:38 +0000 (09:34 +0000)]
issuing of incorrect warning fixed
llvm-svn: 231779
Andrey Churbanov [Tue, 10 Mar 2015 09:31:21 +0000 (09:31 +0000)]
cleanup: removed unused function __kmp_change_thread_affinity_mask
llvm-svn: 231778
Ed Schouten [Tue, 10 Mar 2015 09:26:38 +0000 (09:26 +0000)]
Enable _LIBCPP_LOCALE__L_EXTENSIONS on CloudABI.
CloudABI provides the _l() functions that are part of POSIX.1-2008, but
also the extensions that are available on systems like OS X and *BSD
(scanf_l, printf_l, etc).
llvm-svn: 231777
Andrey Churbanov [Tue, 10 Mar 2015 09:19:47 +0000 (09:19 +0000)]
proc_bind_disabled enum value removed, its usage replased with proc_bind_false
llvm-svn: 231776
Andrey Churbanov [Tue, 10 Mar 2015 09:15:26 +0000 (09:15 +0000)]
cleanup: usages of mask size wrapped into macros
llvm-svn: 231775
Andrey Churbanov [Tue, 10 Mar 2015 09:03:42 +0000 (09:03 +0000)]
Adding some 8-bit atomic operations for future use
llvm-svn: 231774
Andrey Churbanov [Tue, 10 Mar 2015 09:00:36 +0000 (09:00 +0000)]
changed unsigned types to signed - caused by comments of Hal Finkel on one of earlier patches
llvm-svn: 231773
Chandler Carruth [Tue, 10 Mar 2015 08:08:58 +0000 (08:08 +0000)]
The LLD tests require 'llvm-nm' to run as well, ensure that this is
built before running the test suite.
llvm-svn: 231770
Chandler Carruth [Tue, 10 Mar 2015 08:06:49 +0000 (08:06 +0000)]
Don't write output to 'a.out', write it to a temporary file. This fixes
the test when run frem a read-only checkout of the source tree.
llvm-svn: 231769
Ed Schouten [Tue, 10 Mar 2015 08:01:10 +0000 (08:01 +0000)]
Don't include <sys/sysctl.h> on CloudABI.
As CloudABI does not provide sysctl(), this header is not present. Make
thread.cpp build correctly (and pass all tests) by not including the header.
llvm-svn: 231768
Ed Schouten [Tue, 10 Mar 2015 07:57:43 +0000 (07:57 +0000)]
Print log/error messages on stderr, not stdout
There are a couple of places where libc++ prints log/error messages to
stdout on its own. This may of course interfere with the output
generated with applications. Log/error messages should be directed to
stderr instead.
Differential Revision: http://reviews.llvm.org/D8135
Reviewed by: marshall
llvm-svn: 231767
Chandler Carruth [Tue, 10 Mar 2015 07:54:34 +0000 (07:54 +0000)]
Fix the local variable naming I used in r231765 to follow the LLD coding
conventions. Sorry for missing this before I committed the patch!
llvm-svn: 231766
Chandler Carruth [Tue, 10 Mar 2015 07:53:02 +0000 (07:53 +0000)]
Fix a bug where the code would use subscript a std::vector with the size
of the vector. For a vector 'v', '&v[v.size()]' isn't a valid way to
compute a pointer one-past-the-end of the vector. Instead, write the
loop in terms of iterators and save the beginning iterator. Once we have
that we can compute the beginning pointer from the beginning iterator,
and compute the distance which we should increment the beginning pointer
by subtracting the iterators.
What might be simpler would be to convert the function accepting a raw
pointer for begin and end to accept iterators or a range or some other
construct, but I wanted to keep this to a minimal bug-fix change.
This fixes a crash on any debug STL implementation which checks for
indexing out of bounds.
llvm-svn: 231765
Ed Schouten [Tue, 10 Mar 2015 07:46:06 +0000 (07:46 +0000)]
Add support for arc4random() to random_device.
Nuxi CloudABI (https://github.com/NuxiNL/cloudlibc) does not allow
processes to access the global filesystem namespace. This breaks
random_device, as it attempts to use /dev/{u,}random. This change adds
support for arc4random(), which is present on CloudABI.
In my opinion it would also make sense to use arc4random() on other
operating systems, such as *BSD and Mac OS X, but I'd rather leave that
to the maintainers of the respective platforms. Switching to
arc4random() does change the ABI.
This change also attempts to make some cleanups to the code. It adds a
single #define for every random interface, instead of testing against
operating systems explicitly.
As discussed, also validate the token argument to be equal to
"/dev/urandom" on all systems that only provide pseudo-random numbers.
This should cause little to no breakage, as "/dev/urandom" is also the
default argument value.
Reviewed by: jfb
Differential Revision: http://reviews.llvm.org/D8134
llvm-svn: 231764
Yaron Keren [Tue, 10 Mar 2015 07:33:23 +0000 (07:33 +0000)]
Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20141013/240026.html
I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.
llvm-svn: 231763
Alexey Bataev [Tue, 10 Mar 2015 07:28:44 +0000 (07:28 +0000)]
[OPENMP] Initial codegen for 'omp task' directive.
The task region is emmitted in several steps:
Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry).
Here task_entry is a pointer to the function:
kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) {
TaskFunction(gtid, tt->part_id, tt->shareds);
return 0;
}
Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any).
Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t.
Emit a call to kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task), where new_task is a resulting structure from previous items.
Differential Revision: http://reviews.llvm.org/D7560
llvm-svn: 231762
Owen Anderson [Tue, 10 Mar 2015 06:51:39 +0000 (06:51 +0000)]
Fix a crash in InstCombine where we could try to truncate a switch comparison to zero width.
llvm-svn: 231761
Owen Anderson [Tue, 10 Mar 2015 06:34:57 +0000 (06:34 +0000)]
Fix a stack overflow in the assembler when checking that GEPs must be over sized types.
We failed to use a marking set to properly handle recursive types, which caused use
to recurse infinitely and eventually overflow the stack.
llvm-svn: 231760
Owen Anderson [Tue, 10 Mar 2015 05:58:21 +0000 (05:58 +0000)]
Fix an issue in the verifier where we could try to read information out of a malformed statepoint intrinsic.
In this situation we would always have already flagged an error on the statepoint intrinsic,
but then we carry on to parse other, related GC intrinsics, and could end up crashing during that
verification when they try to access data from the malformed statepoint.
llvm-svn: 231759
Alexey Bataev [Tue, 10 Mar 2015 05:28:46 +0000 (05:28 +0000)]
[OPENMP] Fixed tests for non-debug builds. NFC.
llvm-svn: 231758
Alexey Bataev [Tue, 10 Mar 2015 05:15:26 +0000 (05:15 +0000)]
[OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope
Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions
Differential Revision: http://reviews.llvm.org/D7935
llvm-svn: 231757
Rui Ueyama [Tue, 10 Mar 2015 05:14:24 +0000 (05:14 +0000)]
Use template aliases.
We dropped Visual Studio 2012 support, so we can use template aliases.
llvm-svn: 231756
Owen Anderson [Tue, 10 Mar 2015 05:13:47 +0000 (05:13 +0000)]
Fix an infinite loop in InstCombine when an instruction with no users and side effects can be constant folded.
ReplaceInstUsesWith needs to return nullptr when the input has no users,
because in that case it does not mutate the program. Otherwise, we can
get stuck in an infinite loop of repeatedly attempting to constant fold
and instruction with no users.
llvm-svn: 231755
Rafael Espindola [Tue, 10 Mar 2015 04:40:21 +0000 (04:40 +0000)]
Revert "[OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: reviews.llvm.org/D7935"
This reverts commit r231752.
It was failing to link with cmake:
lib64/libclangCodeGen.a(CGOpenMPRuntime.cpp.o):/home/espindola/llvm/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:function clang::CodeGen::InlinedOpenMPRegionRAII::~InlinedOpenMPRegionRAII(): error: undefined reference to 'clang::CodeGen::EHScopeStack::popTerminate()'
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)
llvm-svn: 231754
Rafael Espindola [Tue, 10 Mar 2015 04:28:09 +0000 (04:28 +0000)]
Move variable into assert to fix -Asserts builds.
llvm-svn: 231753
Alexey Bataev [Tue, 10 Mar 2015 04:22:11 +0000 (04:22 +0000)]
[OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope
Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions
Differential Revision: http://reviews.llvm.org/D7935
llvm-svn: 231752
Rafael Espindola [Tue, 10 Mar 2015 04:11:52 +0000 (04:11 +0000)]
Remove incredibly confusing isBaseAddressKnownZero.
When referring to a symbol in a dwarf section on ELF we should use
.long foo
instead of
.long foo - .debug_something
because ELF is unaware of the content of the sections and therefore needs
relocations. This has nothing to do with optimizing a -0.
llvm-svn: 231751
Rafael Espindola [Tue, 10 Mar 2015 03:58:36 +0000 (03:58 +0000)]
Use a better name for compile unit labels.
They mark the start of a compile unit, so name them .Lcu_*. Using
Section->getLabelBeginName() makes it looks like they mark the start of the
section.
While at it, switch to createTempSymbol to avoid collisions with labels
created in inline assembly. Not sure if a "don't crash" test is worth it.
With this getLabelBeginName is dead, delete it.
llvm-svn: 231750
Sanjay Patel [Tue, 10 Mar 2015 03:48:14 +0000 (03:48 +0000)]
removed function names from comments; NFC
llvm-svn: 231749
Frederic Riss [Tue, 10 Mar 2015 03:47:55 +0000 (03:47 +0000)]
DwarfAccelTable: remove unneeded bucket terminators.
Last commit fixed the handling of hash collisions, but it introdcuced
unneeded bucket terminators in some places. The generated table was
correct, it can just be a tiny bit smaller. As the previous table was
correct, the test doesn't need updating. If we really wanted to test
this, I could add the section size to the dwarf dump and test for a
precise value there. IMO the correctness test is sufficient.
llvm-svn: 231748
Sanjay Patel [Tue, 10 Mar 2015 03:26:39 +0000 (03:26 +0000)]
use range-based for loops; NFC
llvm-svn: 231747
Craig Topper [Tue, 10 Mar 2015 03:25:07 +0000 (03:25 +0000)]
Improve and simplify EnforceSmallerThan for vector types.
Explicitly compare the size of the scalar types and the whole vector size rather than just comparing enum encodings.
llvm-svn: 231746
Craig Topper [Tue, 10 Mar 2015 03:25:04 +0000 (03:25 +0000)]
Remove extra indentation of entire function body. NFC.
llvm-svn: 231745
Rafael Espindola [Tue, 10 Mar 2015 03:11:11 +0000 (03:11 +0000)]
Move label creation close to emission. NFC.
llvm-svn: 231744
George Burgess IV [Tue, 10 Mar 2015 02:58:15 +0000 (02:58 +0000)]
Added ConstantExpr support to CFLAA.
CFLAA didn't know how to properly handle ConstantExprs; it would silently
ignore them. This was a problem if the ConstantExpr is, say, a GEP of a global,
because CFLAA wouldn't realize that there's a global there. :)
llvm-svn: 231743
Richard Smith [Tue, 10 Mar 2015 02:57:50 +0000 (02:57 +0000)]
[modules] Don't bother looking up a declaration to merge into if we're not
actually loading a formerly-canonical declaration.
llvm-svn: 231742
George Burgess IV [Tue, 10 Mar 2015 02:40:06 +0000 (02:40 +0000)]
Added special handling for inttoptr in CFLAA.
We now treat pointers given to ptrtoint and pointers retrieved from
inttoptr as similar to arguments or globals (can alias anything, etc.)
This solves some of the problems we were having with giving incorrect
results.
llvm-svn: 231741
Mehdi Amini [Tue, 10 Mar 2015 02:37:25 +0000 (02:37 +0000)]
DataLayout is mandatory, update the API to reflect it with references.
Summary:
Now that the DataLayout is a mandatory part of the module, let's start
cleaning the codebase. This patch is a first attempt at doing that.
This patch is not exactly NFC as for instance some places were passing
a nullptr instead of the DataLayout, possibly just because there was a
default value on the DataLayout argument to many functions in the API.
Even though it is not purely NFC, there is no change in the
validation.
I turned as many pointer to DataLayout to references, this helped
figuring out all the places where a nullptr could come up.
I had initially a local version of this patch broken into over 30
independant, commits but some later commit were cleaning the API and
touching part of the code modified in the previous commits, so it
seemed cleaner without the intermediate state.
Test Plan:
Reviewers: echristo
Subscribers: llvm-commits
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231740
Mehdi Amini [Tue, 10 Mar 2015 02:36:43 +0000 (02:36 +0000)]
Update for LLVM API change: getOrEnforceKnownAlignment() requires a DataLayout
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231739
Richard Smith [Tue, 10 Mar 2015 02:00:53 +0000 (02:00 +0000)]
PR21687: when adding a redeclaration of a function with an implicit exception
specification, update all prior declarations if the new one has an explicit
exception specification and the prior ones don't.
Patch by Vassil Vassilev! Some minor tweaking and test case by me.
llvm-svn: 231738
Oleksiy Vyalov [Tue, 10 Mar 2015 01:58:47 +0000 (01:58 +0000)]
Restore commented setTearDownCleanup in TestHelloWorld.test_with_dwarf_and_attach_to_process_with_id_api.
llvm-svn: 231737
Kostya Serebryany [Tue, 10 Mar 2015 01:58:27 +0000 (01:58 +0000)]
[sanitizer] fix instrumentation with -mllvm -sanitizer-coverage-block-threshold=0 to actually do something useful.
llvm-svn: 231736
Richard Smith [Tue, 10 Mar 2015 01:41:22 +0000 (01:41 +0000)]
[modules] Don't clobber a destructor's operator delete when adding another one;
move the operator delete updating into a separate update record so we can cope
with updating another module's destructor's operator delete.
llvm-svn: 231735
Oleksiy Vyalov [Tue, 10 Mar 2015 01:15:28 +0000 (01:15 +0000)]
Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer - in order to allow modules caching from remote targets.
http://reviews.llvm.org/D8037
llvm-svn: 231734
Kostya Serebryany [Tue, 10 Mar 2015 01:11:53 +0000 (01:11 +0000)]
[sanitizer] decrease sanitizer-coverage-block-threshold from 1000 to 500 as another horrible workaround for PR17409
llvm-svn: 231733
Frederic Riss [Tue, 10 Mar 2015 00:46:31 +0000 (00:46 +0000)]
DwarfAccelTable: Fix handling of hash collisions.
It turns out accelerator tables where totally broken if they contained
entries with colliding hashes. The failure mode is pretty bad, as it not
only impacted the colliding entries, but would basically make all the
entries after the first hash collision pointing in the wrong place.
The testcase uses the symbol names that where found to collide during a
clang build.
From a performance point of view, the patch adds a sort and a linear
walk over each bucket contents. While it has a measurable impact on the
accelerator table emission, it's not showing up significantly in clang
profiles (and I'd argue that correctness is priceless :-)).
llvm-svn: 231732
Eric Christopher [Tue, 10 Mar 2015 00:33:27 +0000 (00:33 +0000)]
Temporarily revert r231726 and r231724 as they're breaking the build.:
Author: Lang Hames <lhames@gmail.com>
Date: Mon Mar 9 23:51:09 2015 +0000
[Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
Author: Lang Hames <lhames@gmail.com>
Date: Mon Mar 9 23:44:13 2015 +0000
[Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.
In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.
llvm-svn: 231731
Eric Christopher [Tue, 10 Mar 2015 00:33:22 +0000 (00:33 +0000)]
Remove an unused variable.
llvm-svn: 231730
Eric Fiselier [Tue, 10 Mar 2015 00:25:20 +0000 (00:25 +0000)]
[libcxx] Fix __RAII_IncreaseAnnotator for increases >= 1
Summary: Fix suggested by @mclow.lists on D8109. Store the size of the un-poisoned vector upon construction instead of calculating it later.
Reviewers: titus, mclow.lists, kcc, EricWF
Reviewed By: EricWF
Subscribers: mclow.lists, cfe-commits
Differential Revision: http://reviews.llvm.org/D8172
llvm-svn: 231729
Richard Smith [Tue, 10 Mar 2015 00:19:04 +0000 (00:19 +0000)]
[modules] This check is run before we resolve the header, not after, so just
check that private headers are in a list matching the role. (We can't perform
the opposite checks for non-private headers because we infer those.)
llvm-svn: 231728
Ben Langmuir [Tue, 10 Mar 2015 00:04:29 +0000 (00:04 +0000)]
Don't treat .foo as two path components in path::iterators
We were treating '/.foo' as ['/', '.', 'foo'] instead of ['/', '.foo'],
which lead to insanity. Same for '..'.
llvm-svn: 231727
Lang Hames [Mon, 9 Mar 2015 23:51:09 +0000 (23:51 +0000)]
[Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
llvm-svn: 231726
Richard Smith [Mon, 9 Mar 2015 23:46:50 +0000 (23:46 +0000)]
[modules] Don't assert if the same header is named as both a public and a
private header within the same module.
llvm-svn: 231725
Lang Hames [Mon, 9 Mar 2015 23:44:13 +0000 (23:44 +0000)]
[Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.
In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.
llvm-svn: 231724
Colin LeMahieu [Mon, 9 Mar 2015 23:08:46 +0000 (23:08 +0000)]
[Hexagon] Removing unused patterns.
llvm-svn: 231723
David Blaikie [Mon, 9 Mar 2015 23:08:44 +0000 (23:08 +0000)]
LLParser: gep: Simplify parsing error handling
llvm-svn: 231722
Ahmed Bougacha [Mon, 9 Mar 2015 22:51:05 +0000 (22:51 +0000)]
[CodeGen] Replace the reused stores' chain for extractelt expansion.
This fixes a subtle issue that was introduced in r205153.
When reusing a store for the extractelement expansion (to load directly
from it, inserting of going through the stack), later stores to the
same location might have overwritten the data we were expecting to
extract from.
To fix that, we need to explicitly replace the chain going out of the
reused store, so that later stores also have an explicit dependency on
the generated element-extracting loads, and can't clobber them.
rdar://
20066785
Differential Revision: http://reviews.llvm.org/D8180
llvm-svn: 231721
Ahmed Bougacha [Mon, 9 Mar 2015 22:46:02 +0000 (22:46 +0000)]
[X86] Add nounwind to vector-idiv.ll testcases. NFC.
In preparation for a patch where cfi directives get in the way.
llvm-svn: 231720
Reid Kleckner [Mon, 9 Mar 2015 22:45:16 +0000 (22:45 +0000)]
Reland r229944: EH: Prune unreachable resume instructions during Dwarf EH preparation
Fix the double-deletion of AnalysisResolver when delegating through to
Dwarf EH preparation by creating one from scratch. Hopefully the new
pass manager simplifies this.
This reverts commit r229952.
llvm-svn: 231719
Rui Ueyama [Mon, 9 Mar 2015 22:34:59 +0000 (22:34 +0000)]
Add SimpleAbsoluteAtom which is analogous to other Simple* atoms.
llvm-svn: 231718
NAKAMURA Takumi [Mon, 9 Mar 2015 22:32:03 +0000 (22:32 +0000)]
Suppress a couple of tests, clang/test/CodeGen/catch-undef-behavior.c and one, for -Asserts for now. They were introduced in r231711.
llvm-svn: 231717
Rui Ueyama [Mon, 9 Mar 2015 22:18:51 +0000 (22:18 +0000)]
Remove COFFReference and use SimpleReference instead.
SimpleReference, which is defined in Core, provides the same functionality
as COFFReference does, so we don't need a custom class.
llvm-svn: 231715
Rafael Espindola [Mon, 9 Mar 2015 22:08:37 +0000 (22:08 +0000)]
Use a MapVector instead of an extra sort.
This also has the advantage of not depending on the brittle getLabelBeginName.
llvm-svn: 231714
Colin LeMahieu [Mon, 9 Mar 2015 22:05:21 +0000 (22:05 +0000)]
[Hexagon] Use single tailcall pseudoinst and fix checking for label jumping versus tail calling.
llvm-svn: 231713
Alexey Samsonov [Mon, 9 Mar 2015 21:50:40 +0000 (21:50 +0000)]
Revert "Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent.""
Re-land r231151 now that -fsanitize=shift-base implementation should not
introduce undefined behavior.
llvm-svn: 231712
Alexey Samsonov [Mon, 9 Mar 2015 21:50:19 +0000 (21:50 +0000)]
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
This is a recommit of r231150, reverted in r231409. Turns out
that -fsanitize=shift-base check implementation only works if the
shift exponent is valid, otherwise it contains undefined behavior
itself.
Make sure we check that exponent is valid before we proceed to
check the base. Make sure that we actually report invalid values
of base or exponent if -fsanitize=shift-base or
-fsanitize=shift-exponent is specified, respectively.
llvm-svn: 231711
Colin LeMahieu [Mon, 9 Mar 2015 21:48:13 +0000 (21:48 +0000)]
[Hexagon] Reapply r231699. Remove assumption that second operand is an immediate when checking if A2_tfrsi is combinable.
llvm-svn: 231710
Sanjoy Das [Mon, 9 Mar 2015 21:43:43 +0000 (21:43 +0000)]
[SCEV] Unify getUnsignedRange and getSignedRange
Summary:
This removes some duplicated code, and also helps optimization: e.g. in
the test case added, `%idx ULT 128` in `@x` is not currently optimized
to `true` by `-indvars` but will be, after this change.
The only functional change in ths commit is that for add recurrences,
ScalarEvolution::getRange will be more aggressive -- computing the
unsigned (resp. signed) range for a SCEVAddRecExpr will now look at the
NSW (resp. NUW) bits and check for signed (resp. unsigned) overflow.
This can be a strict improvement in some cases (such as the attached
test case), and should be no worse in other cases.
Reviewers: atrick, nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8142
llvm-svn: 231709
Sanjoy Das [Mon, 9 Mar 2015 21:43:39 +0000 (21:43 +0000)]
[SCEV] Add a `scalar-evolution-print-constant-ranges' option
Summary:
Unused in this commit, but will be used in a subsequent change (D8142)
by a FileCheck test.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8143
llvm-svn: 231708
Rafael Auler [Mon, 9 Mar 2015 21:43:35 +0000 (21:43 +0000)]
[LinkerScript] Implement linker script expression evaluation
The expression evaluation is needed when interpreting linker scripts, in order
to calculate the value for new symbols or to determine a new position to load
sections in memory. This commit extends Expression nodes from the linker script
AST with evaluation functions, and also contains a unit test.
http://reviews.llvm.org/D8156
llvm-svn: 231707
Tim Northover [Mon, 9 Mar 2015 21:40:42 +0000 (21:40 +0000)]
ARM: use ABI-specified alignment for byval parameters.
When passing a type with large alignment byval, we were specifying the type's
alignment rather than the alignment that the backend is actually capable of
producing (ABIAlign).
This would be OK (if odd) assuming the backend dealt with it prooperly,
unfortunately it doesn't and trying to pass types with "byval align 16" can
cause it to set fp incorrectly and trash the stack during the prologue. I'll be
fixing that in a separate patch, but Clang should still be emitting IR that's
as close to its intent as possible.
rdar://
20059039
llvm-svn: 231706