Commit Graph

196657 Commits

Author SHA1 Message Date
John Brawn 1f26a47630 [ARM] Fix handling of thumb1 out-of-range frame offsets
LocalStackSlotPass assumes that isFrameOffsetLegal doesn't change its
answer when the base register changes. Unfortunately this isn't true
in thumb1, where SP-based loads allow a larger offset than
non-SP-based loads, and this causes the base register reuse code to
generate instructions that are unencodable, causing an assertion
failure. 

Solve this by adding a BaseReg parameter to isFrameOffsetLegal, which
ARMBaseRegisterInfo can then make use of to give the correct answer. 

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

llvm-svn: 232825
2015-03-20 17:20:07 +00:00
David Majnemer c403a1ce32 MS ABI: Accept calls to an unprototyped declaration of _setjmp
This fixes PR22961.

llvm-svn: 232824
2015-03-20 17:03:35 +00:00
Zachary Turner be30a6524f Try to fix configure/make build.
llvm-svn: 232823
2015-03-20 16:23:40 +00:00
Simon Pilgrim 180cad2e57 Stripped trailing whitespace. NFC.
llvm-svn: 232822
2015-03-20 16:08:17 +00:00
Eric Christopher cef8e71394 Rewrite StackMap location handling to pre-compute the dwarf register
numbers before emission.

This removes a dependency on being able to access TRI at the module
level and is similar to the DwarfExpression handling. I've modified
the debug support into print/dump routines that'll do the same dumping
but is now callable anywhere and if TRI isn't available will go ahead
and just print out raw register numbers.

llvm-svn: 232821
2015-03-20 16:03:42 +00:00
Eric Christopher d43c5c75b6 At the beginning of doFinalization set the MachineFunction to
nullptr so that users get an earlier dereferencing error and
so that we can use it to conditionalize access to MachineFunction
specific data.

llvm-svn: 232820
2015-03-20 16:03:39 +00:00
Chad Rosier c83fa9e9eb Typo.
llvm-svn: 232819
2015-03-20 15:45:14 +00:00
Tom Stellard 3b0dab9f3f R600/SI: Refactor VOP2 instruction defs
llvm-svn: 232817
2015-03-20 15:14:23 +00:00
Tom Stellard 23c2c3d0f4 R600/SI: Refactor VOP1 instruction defs
llvm-svn: 232816
2015-03-20 15:14:21 +00:00
Pavel Labath 12fd375629 Add missing cases to NativeProcessLinux LogThreadStopInfo
Test Plan: No tests, this is just a debug logging function.

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 232815
2015-03-20 14:45:13 +00:00
Rafael Espindola 8c8d15879f Reduce indentation after return. NFC.
llvm-svn: 232814
2015-03-20 14:33:25 +00:00
Rafael Espindola 2d74274017 Use early returns. NFC.
llvm-svn: 232813
2015-03-20 14:23:46 +00:00
Alexander Potapenko 24c262f213 [ASan] fix litling warnings for coverage-order-pcs.cc
llvm-svn: 232812
2015-03-20 14:11:05 +00:00
Rafael Espindola 9e77cba164 Fold a llvm_unreachable into an assert. NFC.
llvm-svn: 232811
2015-03-20 13:50:15 +00:00
Rafael Espindola 5f5e24bb92 clang-format a function. NFC.
llvm-svn: 232810
2015-03-20 13:47:40 +00:00
Alexander Potapenko 001deff940 [ASan] Move a couple of Posix-specific tests to Posix/
Add a comment about potential breakage of coverage-maybe-open-file.cc on Win

llvm-svn: 232809
2015-03-20 13:42:11 +00:00
Alexander Potapenko d5b3f7b125 [ASan] Move the coverage tests that work on Darwin to common testcase dir.
llvm-svn: 232808
2015-03-20 13:31:03 +00:00
Simon Atanasyan 12e9f8cd11 [Mips] Create special PLT entry in case of MIPS R6 ABI
llvm-svn: 232806
2015-03-20 11:28:22 +00:00
Pavel Labath 98236e0510 Fix ninja check-lldb
Ninja apparently has issues with commands writing nul characters '\0' to stdout. When it
encounters a nul character, the rest of the output is skipped (I will file a bug with ninja about
that). This breaks the linux buildbot since it parses the ninja check-lldb output to get a list
of failures.

Recently, we have started outputting nul characters in lldb-server tests. This is probably
a bug in itself, but I am not addressing that now. This is just a workaround commit, which
prevents the nul characters from appearing in the output, and gets the buildbot operational again.

llvm-svn: 232805
2015-03-20 11:24:36 +00:00
Daniel Jasper 214997c63b [MBP] Don't outline short optional branches
With the option -outline-optional-branches, LLVM will place optional
branches out of line (more details on r231230).

With this patch, this is not done for short optional branches. A short
optional branch is a branch containing a single block with an
instruction count below a certain threshold (defaulting to 3). Still
everything is guarded under -outline-optional-branches).

Outlining a short branch can't significantly improve code locality. It
can however decrease performance because of the additional jmp and in
cases where the optional branch is hot. This fixes a compile time
regression I have observed in a benchmark.

Review: http://reviews.llvm.org/D8108
llvm-svn: 232802
2015-03-20 10:00:37 +00:00
Pavel Labath 8ac06996bf Support for truncate/append on log files
Summary:
Presently, if a log file already exists, lldb simply starts overwriting bits of it, without
truncating or anything. This patch makes it use eFileOptionFileTruncate by default. It also adds
an --append option, which will append to the file without truncating. A test is included.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232801
2015-03-20 09:43:20 +00:00
Alexey Bataev 0068cb2499 [MSVC] Explicit specializations can be declared in any namespace (fix for http://llvm.org/PR13738)
MS compiler emits no errors in case of explicit specializations outside declaration enclosing namespaces, even when language extensions are disabled.
The patch is to suppress errors and emit extension warnings if explicit specializations are not declared in the corresponding namespaces.
This fixes PR13738.

Patch by Alexey Frolov.

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

llvm-svn: 232800
2015-03-20 07:21:46 +00:00
Justin Bogner e9fe0a298c InstrProf: Make profile variables private to reduce binary size overhead
When we instrument a program for profiling, we copy the linkage of an
instrumented function so that our datastructures merge in the same way
as the function. This avoids redundant copies for things like
linkonce, but ends up emitting names we never need to reference for
normal and internal symbols. Promoting internal and external linkage
to private for these variables reduces the size overhead of profiling
drastically.

llvm-svn: 232799
2015-03-20 06:34:38 +00:00
Craig Topper 3a8eb896c9 [Tablegen] Attempt to add support for patterns containing nodes with multiple results.
This is needed for AVX512 masked scatter/gather support.

The R600 change is necessary to remove a hack that was working around the lack of multiple results.

llvm-svn: 232798
2015-03-20 05:09:06 +00:00
Tom Stellard 8d19f9b681 R600/SI: Add missing CHECK-LABEL lines to a test
llvm-svn: 232797
2015-03-20 03:12:42 +00:00
Nick Lewycky 2ce2832c9b Fix comment from r232794. NFC
llvm-svn: 232796
2015-03-20 02:52:23 +00:00
Alexei Starovoitov f049a68d78 [bpf] fix build
fix BPF backend build broken by r232699

llvm-svn: 232795
2015-03-20 02:35:29 +00:00
Nick Lewycky be8af48824 When simplifying a SCEV truncate by distributing, consider it a simplification to replace a cast, even if we end up with a trunc around the term. Fixes PR22960!
llvm-svn: 232794
2015-03-20 02:25:00 +00:00
Richard Smith 625ccb3f78 [modules] Remove some redundant work when building a lookup table for a DeclContext.
When we need to build the lookup table for a DeclContext, we used to pull in
all lexical declarations for the context; instead, just build a lookup table
for the local lexical declarations. We previously didn't guarantee that the
imported declarations would be in the returned map, but in some cases we'd
happen to put them all in there regardless. Now we're even lazier about this.

This unnecessary work was papering over some other bugs:

 - LookupVisibleDecls would use the DC for name lookups in the TU in C, and
   this was not guaranteed to find all imported names (generally, the DC for
   the TU in C is not a reliable place to perform lookups). We now use an
   identifier-based lookup mechanism for this.

 - We didn't actually load in the list of eagerly-deserialized declarations
   when importing a module (so external definitions in a module wouldn't be
   emitted by users of those modules unless they happened to be deserialized
   by the user of the module).

llvm-svn: 232793
2015-03-20 02:17:21 +00:00
Duncan P. N. Exon Smith 41a1546ebc SampleProfile: Check for missing debug locations
Don't use `DebugLoc` accessors if we're pointing at null, which will be
a problem after a WIP patch to make the `DIDescriptor` accessors more
strict.  Caught by Frontend/profile-sample-use-loc-tracking.c (in
clang).

llvm-svn: 232792
2015-03-20 00:56:55 +00:00
Duncan P. N. Exon Smith 7ea96c222f DebugInfo: Check for null before using DIType
A WIP patch to turn on stricter `DIDescriptor` accessor checks fires
here; it's obvious from the code that `T` can be null, so add an
explicit check.  Caught by dozens of current testcases.

llvm-svn: 232791
2015-03-20 00:53:40 +00:00
Duncan P. N. Exon Smith 8b866d1a6d Verifier: Remove the separate DebugInfoVerifier class
Remove the separate `DebugInfoVerifier` class, as a partial step toward
better integrating debug info verification with the `Verifier`.

Right now, verification of debug info is kind of a mess.

  - There are `DIDescriptor::Verify()` checks live in `DebugInfo.cpp`.
    These return `bool`, and there's no way to see (except by opening a
    debugger) why they fail.
  - We rely on `DebugInfoFinder` to traverse the debug info graph and
    dig up nodes.  However, the regular `Verifier` visits many of these
    nodes when it calls into debug info intrinsic operands.  Visiting
    twice and running different checks is kind of absurd.
  - Moreover, `DebugInfoFinder` asserts on failed type resolution -- the
    verifier should never assert!

By integrating the two verifiers, I'm aiming at solving these problems
(work to be done, obviously).  Verification can be localized to the
`Verifier`; we can use a naive `MDNode` operand traversal to find all
the nodes; we can verify type references instead of asserting on
failure.

There are `assert()`s sprinkled throughout the optimizer and dwarf
backend on `DIDescriptor::Verify()` checks.  This is a hangover from
when the debug info verifier was off, so I plan to remove them as I go
(once I confirm that the checks are done at verification time).

Note: to keep the behaviour of only running the debug info verifier when
-verify succeeds, I've added an `EverBroken` flag.  Once the
`DebugInfoFinder` assertions are gone and the two traversals have been
merged, I expect to be able to remove this.

llvm-svn: 232790
2015-03-20 00:48:23 +00:00
Hans Wennborg 077845eb81 Rewrite SelectionDAGBuilder::Clusterify to run in linear time. NFC.
It was previously repeatedly erasing elements from the middle of a vector,
causing O(n^2) worst-case run-time.

llvm-svn: 232789
2015-03-20 00:41:03 +00:00
Reid Kleckner 7ffc3fbb2f C++14: Disable sized deallocation by default due to ABI breakage
There are no widely deployed standard libraries providing sized
deallocation functions, so we have to punt and ask the user if they want
us to use sized deallocation. In the future, when such libraries are
deployed, we can teach the driver to detect them and enable this
feature.

N3536 claimed that a weak thunk from sized to unsized deallocation could
be emitted to avoid breaking backwards compatibility with standard
libraries not providing sized deallocation. However, this approach and
other variations don't work in practice.

With the weak function approach, the thunk has to have default
visibility in order to ensure that it is overridden by other DSOs
providing sized deallocation. Weak, default visibility symbols are
particularly expensive on MachO, so John McCall was considering
disabling this feature by default on Darwin. It also changes behavior
ELF linking behavior, causing certain otherwise unreferenced object
files from an archive to be pulled into the link.

Our second approach was to use an extern_weak function declaration and
do an inline conditional branch at the deletion call site. This doesn't
work because extern_weak only works on MachO if you have some archive
providing the default value of the extern_weak symbol. Arranging to
provide such an archive has the same challenges as providing the symbol
in the standard library. Not to mention that extern_weak doesn't really
work on COFF.

Reviewers: rsmith, rjmccall

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

llvm-svn: 232788
2015-03-20 00:31:07 +00:00
Kostya Serebryany 6fe5fcbcbc Allow -fsanitize-coverage with -fsanitize=dataflow
Summary: Allow -fsanitize-coverage with -fsanitize=dataflow

Test Plan: check-clang

Reviewers: pcc

Reviewed By: pcc

Subscribers: cfe-commits

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

llvm-svn: 232787
2015-03-20 00:06:52 +00:00
David Majnemer 73768709f2 Don't crash-on-valid when an inline function is friend of class template
We assumed that the most recent declaration of an inline function would
also be inline.  However, a more recent declaration can come from a
friend declaration in a class template that is instantiated at the
definition of the function.

llvm-svn: 232786
2015-03-20 00:02:27 +00:00
Peter Collingbourne bbdc26ba1b test: Make a start on a test suite for libLTO.
This works in a similar way to the gold plugin tests. We search for a compatible
linker on $PATH and use it to run tests against our just-built libLTO. To start
with, test the just added opt level functionality.

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

llvm-svn: 232785
2015-03-19 23:55:38 +00:00
Chaoren Lin c16f5dca27 Report watchpoint hits during single stepping.
Summary:
Reorganized NativeProcessLinux::MonitorSIGTRAP to check for watchpoint hits on
TRAP_TRACE.

Added test for stepping over watchpoints.

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

Reviewers: ovyalov, tberghammer, vharron, clayborg

Subscribers: jingham, labath, lldb-commits

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

llvm-svn: 232784
2015-03-19 23:28:10 +00:00
Eric Christopher d83003ea59 Use the cached subtarget on the MachineFunction when the AsmPrinter
will have a MachineFunction, i.e. in places other than the module
level doInitialize/doFinalize.

llvm-svn: 232783
2015-03-19 23:27:42 +00:00
Eric Christopher 7585fb2d9f Use the cached subtarget off of the machine function.
llvm-svn: 232782
2015-03-19 23:06:21 +00:00
Sanjay Patel 803fb7c85c move insert, extract, concat helper functions closer to related helper functions; NFCI
llvm-svn: 232781
2015-03-19 23:04:25 +00:00
Owen Anderson db4201235b Fix a nasty bug in DAGCombine of STORE nodes.
This is very related to the bug fixed in r174431.  The problem is that
SelectionDAG does not include alignment in the uniquing of loads and
stores.  When an otherwise no-op DAGCombine would increase the alignment
of a load or store, the original node would be returned (with the
alignment increased), which would cause the node not to be processed by
any further DAGCombines.

I don't have a direct testcase for this that manifests on an in-tree
target, but I did see some noise in the tests for other targets and have
updated them for it.

llvm-svn: 232780
2015-03-19 22:48:57 +00:00
Duncan P. N. Exon Smith f80840f784 Clang follow-up to LLVM r232772
-verify-di is dead! Long live -verify!

llvm-svn: 232779
2015-03-19 22:43:38 +00:00
Chandler Carruth c66deafb73 [Modules] Implement __builtin_isinf_sign in Clang.
Somehow, we never managed to implement this fully. We could constant
fold it like crazy, including constant folding complex arguments, etc.
But if you actually needed to generate code for it, error.

I've implemented it using the somewhat obvious lowering. Happy for
suggestions on a more clever way to lower this.

Now, what you might ask does this have to do with modules? Fun story. So
it turns out that libstdc++ actually uses __builtin_isinf_sign to
implement std::isinf when in C++98 mode, but only inside of a template.
So if we're lucky, and we never instantiate that, everything is good.
But once we try to instantiate that template function, we need this
builtin. All of my customers at least are using C++11 and so they never
hit this code path.

But what does that have to do with modules? Fun story. So it turns out
that with modules we actually observe a bunch of bugs in libstdc++ where
their <cmath> header clobbers things exposed by <math.h>. To fix these,
we have to provide global function definitions to replace the macros
that C99 would have used. And it turns out that ::isinf needs to be
implemented using the exact semantics used by the C++98 variant of
std::isinf. And so I started to fix this bug in libstdc++ and ceased to
be able to compile libstdc++ with Clang.

The yaks are legion.

llvm-svn: 232778
2015-03-19 22:39:51 +00:00
Eric Christopher cf7b5f5fc5 Remove unused headers.
llvm-svn: 232777
2015-03-19 22:36:38 +00:00
Eric Christopher 12cf76fe26 Add an MCSubtargetInfo variable to the TargetMachine.
This enables us to remove calls to the subtarget from the TargetMachine
and with a small hack for backends that require global subtarget
information for module level code generation, e.g. mips abi flags, as
mentioned in a fixme in the code.

llvm-svn: 232776
2015-03-19 22:36:37 +00:00
Eric Christopher 72e23a219c Add a TargetMachine local MCRegisterInfo and MCInstrInfo so that
they can be used without a subtarget in constructing subtarget
independent passes.

llvm-svn: 232775
2015-03-19 22:36:32 +00:00
Reid Kleckner c759fe90bc WinEH: Make llvm.eh.actions emission match the EH docs
This switches the sense of the i32 values and updates the test cases.

We can also use CHECK-SAME to clean up some tests, and reduce the visual
noise from bitcasts.

llvm-svn: 232774
2015-03-19 22:31:02 +00:00
Sanjay Patel d5c2d287f9 [X86, AVX] use blends instead of insert128 with index 0
Another case of x86-specific shuffle strength reduction:
avoid generating insert*128 instructions with index 0 because
they are slower than their non-lane-changing blend equivalents.

Shuffle lowering already catches most of these cases, but
the zero vector case and some other paths such as in the
modified test in vector-shuffle-256-v32.ll were getting
through.

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

llvm-svn: 232773
2015-03-19 22:29:40 +00:00
Duncan P. N. Exon Smith ab58a568ee Verifier: Remove the separate -verify-di pass
Remove `DebugInfoVerifierLegacyPass` and the `-verify-di` pass.
Instead, call into the `DebugInfoVerifier` from inside
`VerifierLegacyPass::finalizeModule()`.  This better matches the logic
in `verifyModule()` (used by the new PassManager), avoids requiring two
separate passes to verify the IR, and makes the API for "add a pass to
verify the IR" simple.

Note: the `-verify-debug-info` flag still works (for now, at least;
eventually it might make sense to just remove it).

llvm-svn: 232772
2015-03-19 22:24:17 +00:00