Commit Graph

198345 Commits

Author SHA1 Message Date
Ahmed Bougacha 256a869d31 [Driver] Properly support -mglobal-merge using explicit options.
Follow-up to r234666.  With this, the -m[no-]global-merge options
have the expected behavior. Previously, -mglobal-merge was ignored,
and there was no way of enabling the optimization.

llvm-svn: 234668
2015-04-11 00:10:44 +00:00
Philip Reames 9638ff9b37 [Statepoints] Fix a release only build failure
A function which is used only in Asserts builds needs to be defined only in Asserts builds.

llvm-svn: 234667
2015-04-11 00:06:47 +00:00
Ahmed Bougacha b96444efd1 [CodeGen] Split -enable-global-merge into ARM and AArch64 options.
Currently, there's a single flag, checked by the pass itself.
It can't force-enable the pass (and is on by default), because it
might not even have been created, as that's the targets decision.
Instead, have separate explicit flags, so that the decision is
consistently made in the target.

Keep the flag as a last-resort "force-disable GlobalMerge" for now,
for backwards compatibility.

llvm-svn: 234666
2015-04-11 00:06:36 +00:00
Duncan P. N. Exon Smith 241982c380 DebugInfo: Remove dead DIDescriptor::getDescriptorField()
llvm-svn: 234665
2015-04-10 23:53:44 +00:00
Quentin Colombet fd7475b5e8 [AArch64] Strengthen the code for the prologue insertion.
The spilled registers are pristine and thus, correctly handled by
the register scavenger and so on, but the liveness information is
strictly speaking wrong at this point.
Fix that.

llvm-svn: 234664
2015-04-10 23:14:34 +00:00
Reid Kleckner 9405ef0e1f [WinEH] Recognize SEH finally block inserted by the frontend
This allows winehprepare to build sensible llvm.eh.actions calls for SEH
finally blocks.  The pattern matching in this change is brittle and
should be replaced with something more robust soon.  In the meantime,
this will let us write the code that produces __C_specific_handler xdata
tables, which we need regardless of how we decide to get finally blocks
through EH preparation.

llvm-svn: 234663
2015-04-10 23:12:29 +00:00
Philip Reames 4d80ede538 [RewriteStatepointsForGC] Use a SetVector for a worklist [NFC]
Using a SetVector to replace equivelent but more verbose functionality.

llvm-svn: 234662
2015-04-10 23:11:26 +00:00
Derek Schuff a419e1ce6c NaCl ARM: fix assembler float abi flags
Summary:
tools::arm::getARMFloatABI() was falling back to guessing soft-float because
it wasn't seeing the GNUEABIHF environment from ComputeEffectivClangTriple
when it was called from gnutools::Assemble::ConstructJob.

Fix by using the effective clang triple in gnutools::Assemble, which now
matches the -triple flag used by cc1 and ClangAs jobs.

Reviewers: jvoung

Subscribers: rengolin, jfb, aemerson, cfe-commits

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

llvm-svn: 234661
2015-04-10 23:07:19 +00:00
Zachary Turner dd50f7421c Making linking against Python simpler on Windows.
This patch deprecates the three Python CMake variables in favor of
a single variable PYTHON_HOME which points to the root of a python
installation.  Since building Python doesn't output the files in
a structure that is compatible with the PYTHONHOME environment
variable, we also provide a script install_custom_python.py which
will copy the output of a custom python build to the correct
directory structure.

The supported workflow after this patch will be to build python
once for each configuration and architecture {Debug,Release} x {x86,x64}
and then run the script.  Then run CMake specifying -DPYTHON_HOME=<path>

The first time you do this will probably require you to delete your
CMake cache.

The old workflow is still supported during a transitionary period,
but a warning is printed at CMake time, and this will eventually
be removed.

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

llvm-svn: 234660
2015-04-10 22:58:56 +00:00
Tim Northover 1290047a7d Generic: Make isMask_N and isShiftedMask_N consistent over 0
Previously, isMask_N returned false for 0 but isShiftedMask_N returned true.
Almost all uses are for pattern matching bitfield operations in the backends,
and expect false (this was discovered because of AArch64's copy of this logic).

Unfortunately, I couldn't put together a small non-fragile test for this. The
nature of the bitfield operations means that this edge case is only really
triggered for nodes like "(and N, 0)", which the DAG combiner is usually very
good at folding away before they get to this stage.

rdar://20501377

llvm-svn: 234659
2015-04-10 22:58:48 +00:00
Philip Reames 8106a264d3 [RewriteStatepointsForGC] test case missing from 234657
llvm-svn: 234658
2015-04-10 22:58:39 +00:00
Philip Reames df1ef08c0c [RewriteStatepointsForGC] Use an actual liveness algorithm
When rewriting statepoints to make relocations explicit, we need to have a conservative but consistent notion of where a particular pointer is live at a particular site. The old code just used dominance, which is correct, but decidedly more conservative then it needed to be. This patch implements a simple dataflow algorithm that's run one per function (well, twice counting fixup after base pointer insertion). There's still lots of room to make this faster, but it's fast enough for all practical purposes today.

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

llvm-svn: 234657
2015-04-10 22:53:14 +00:00
Philip Reames 704e78b149 [RewriteStatepointsForGC] clang-format file
Format the entire file to reduce diff of change to follow.

llvm-svn: 234656
2015-04-10 22:34:56 +00:00
Ben Langmuir eb8bd2d9b3 Workaround a performance issue with modules + PCH
More fallout from r228234; when looking up an identifier in a PCH that
imports the Cocoa module on Darwin, it was taking 2 to 5 seconds
because we were hammering the MapVector::erase() function, which is
O(n).  For now, just clear() the contained SmallVector to get back to
0.25 - 0.5 seconds.  This is probably not the long-term fix, because
without modules or without PCH the performance is more like 0.02
seconds.

llvm-svn: 234655
2015-04-10 22:25:42 +00:00
Benjamin Kramer b4bf14ceaa [CodeGenPrepare] Report all changes made during instruction sinking
r234638 chained another transform below which was tripping over the
deleted instruction. Use after free found by asan in many regression
tests.

llvm-svn: 234654
2015-04-10 22:25:36 +00:00
Philip Reames f66d73708b [RewriteStatepointsForGC] Missed review comment from 234651 & build fix
After submitting 234651, I noticed I hadn't responded to a review comment by mjacob.  This patch addresses that comment and fixes a Release only build problem due to an unused variable.  

llvm-svn: 234653
2015-04-10 22:16:58 +00:00
Fariborz Jahanian 27aa9b4028 [Objective-C Sema] Fixes a typo which did not allow
bridge casting to super class of object's bridge type.
rdar://18311183

llvm-svn: 234652
2015-04-10 22:07:47 +00:00
Philip Reames 85b36a8157 [RewriteStatepointsForGC] Preprocess the IR to remove unreachable blocks and single entry phis
Two related small changes:

    Various dominance based queries about liveness can get confused if we're talking about unreachable blocks. To avoid reasoning about such cases, just remove them before rewriting statepoints.
    Remove single entry phis (likely left behind by LCSSA) to reduce the number of live values.

Both of these are motivated by http://reviews.llvm.org/D8674 which will be submitted shortly.

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

llvm-svn: 234651
2015-04-10 22:07:04 +00:00
Rui Ueyama 942d51a25f Replace a macro with an inline function.
llvm-svn: 234650
2015-04-10 22:05:11 +00:00
Rui Ueyama 4d57247236 PECOFF: Use C++11 braced init list to make Version objects.
llvm-svn: 234649
2015-04-10 21:57:06 +00:00
Rui Ueyama 4a576bfd23 Use C++11 non-static member initialization.
llvm-svn: 234648
2015-04-10 21:49:28 +00:00
Philip Reames 8531d8c491 [RewriteStatepointsForGC] Limited support for vectors of pointers
This patch adds limited support for inserting explicit relocations when there's a vector of pointers live over the statepoint. This doesn't handle the case where the vector contains a mix of base and non-base pointers; that's future work.

The current implementation just scalarizes the vector over the gc.statepoint before doing the explicit rewrite. An alternate approach would be to plumb the vector all the way though the backend lowering, but doing that appears challenging. In particular, the size of the indirect spill slot is currently assumed to be sizeof(pointer) throughout the backend.

In practice, this is enough to allow running the SLP and Loop vectorizers before RewriteStatepointsForGC.

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

llvm-svn: 234647
2015-04-10 21:48:25 +00:00
Rui Ueyama 8330835197 Attempt to fix buildbots.
lldNative was removed in r234641.

llvm-svn: 234646
2015-04-10 21:42:16 +00:00
Rui Ueyama aabd7ca452 Do s/_context/_ctx/g globally.
I believe this patch eliminates all remaining uses of _context
or _linkingContext variable names. Consistent naming improves
readability.

llvm-svn: 234645
2015-04-10 21:40:59 +00:00
Rui Ueyama 08d9520f89 Fix docs-lld-html build.
llvm-svn: 234644
2015-04-10 21:37:42 +00:00
Benjamin Kramer 5c40407038 [tblgen] Use StringRef::trim
llvm-svn: 234643
2015-04-10 21:37:21 +00:00
Greg Clayton eb72dc7d7d Allow the variable view to get synthetic values if they are available in "gui" mode.
llvm-svn: 234642
2015-04-10 21:34:10 +00:00
Rui Ueyama aa7b304ea7 Remove the Native file format.
The Native file format was designed to be the fastest on-memory or
on-disk file format for object files. The problem is that no one
is working on that. No LLVM tools can produce object files in
the Native, thus the feature of supporting the format is useless
in the linker.

This patch removes the Native file support. We can add it back
if we really want it in future.

llvm-svn: 234641
2015-04-10 21:23:51 +00:00
Greg Clayton bd5ae6b4de Cleanup virtual methods and mark them as "override" and remove "virtual".
Also fixed an issue with the GUI mode where tree items wouldn't be notified that they were selected. Now selecting a thread or stack frame in the Threads view will update all windows (source, variables, registers).

llvm-svn: 234640
2015-04-10 21:21:09 +00:00
Simon Atanasyan 1c1b4366af [Mips] Fix broken test case
llvm-svn: 234639
2015-04-10 21:19:01 +00:00
Sanjoy Das b6c5914308 [InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP.
Summary:
This change moves creating calls to `llvm.uadd.with.overflow` from
InstCombine to CodeGenPrep.  Combining overflow check patterns into
calls to the said intrinsic in InstCombine inhibits optimization because
it introduces an intrinsic call that not all other transforms and
analyses understand.

Depends on D8888.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

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

llvm-svn: 234638
2015-04-10 21:07:09 +00:00
Rui Ueyama 74c629be81 ELF: Simplify assignments to "result"
This file is not -Wconversion-clean, and seems like we don't care
about that except these lines. Fix these lines for simplicity.

llvm-svn: 234637
2015-04-10 21:03:20 +00:00
Joerg Sonnenberger 740f3f4a95 Create the correct profiling symbol on NetBSD.
llvm-svn: 234636
2015-04-10 21:02:53 +00:00
Simon Atanasyan 720f52a961 [Mips] Add -pcrel-eh-reloc command line option
This MIPS specific option controls R_MIPS_EH relocation handling.
If -pcrel-eh-reloc is specified R_MIPS_EH relocation should be handled
like R_MIPS_PC32 relocation.

llvm-svn: 234635
2015-04-10 21:00:41 +00:00
Simon Atanasyan 54b1d56c01 [Mips] Support R_MIPS_EH relocation handling
The patch supports just the R_MIPS_EH relocation handling and does not
implement full specification of compact exception tables for MIPS ABIs.

llvm-svn: 234634
2015-04-10 21:00:29 +00:00
Lorenzo Martignoni 4879003022 Extend s{,n}printf custom wrappers to support '*' in the format specifiers
Differential Revision: http://reviews.llvm.org/D8966

llvm-svn: 234633
2015-04-10 20:58:28 +00:00
Simon Atanasyan ada248cd1c [Mips] Replace MipsTargetHandler member function getGP() by getGPAddr()
When we call getGP() we need in fact _gp symbol address. Let's cache its
value and return it directly from the new getGPAddr() function.

llvm-svn: 234632
2015-04-10 20:55:10 +00:00
Simon Atanasyan 1f50cb1d13 [Mips] Use std::call_once for thread safe initialization
The commit is inspired by r234628. Thanks Rui for the idea.

llvm-svn: 234631
2015-04-10 20:55:04 +00:00
Simon Atanasyan 2bafa8342c [Mips] Fix typo in the comment
llvm-svn: 234630
2015-04-10 20:54:58 +00:00
Joerg Sonnenberger 22a2d99e25 Create correct platform-specific target for NetBSD PPC64LE.
llvm-svn: 234629
2015-04-10 20:53:48 +00:00
Rui Ueyama ee0c60679a Fix minor threading issue.
Because calls of applyRelocation is parallelized, all functions
called from that need to be thread-safe. This piece of code
didn't use any synchronization mechanism, so it was not safe.

llvm-svn: 234628
2015-04-10 19:55:35 +00:00
Reid Kleckner aa7a5a3a0f Avoid spewing binary to stdout in some filetype=obj tests
llvm-svn: 234627
2015-04-10 19:36:55 +00:00
Alexander Kornienko f5e72b0448 [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy
This check looks for comparisons between boolean expressions and boolean
constants and simplifies them to just use the appropriate boolean expression
directly.

if (b == true) becomes if (b)
if (b == false) becomes if (!b)
if (b && true) becomes if (b)
if (b && false) becomes if (false)
if (b || true) becomes if (true)
if (b || false) becomes if (b)
e ? true : false becomes e
e ? false : true becomes !e
if (true) t(); else f(); becomes t();
if (false) t(); else f(); becomes f();
if (e) return true; else return false; becomes return (e);
if (e) return false; else return true; becomes return !(e);
if (e) b = true; else b = false; becomes b = e;
if (e) b = false; else b = true; becomes b = !(e);

http://reviews.llvm.org/D7648

Patch by Richard Thomson!

llvm-svn: 234626
2015-04-10 19:26:43 +00:00
Siva Chandra 18d1696d62 [TestFormatters, TestDataFormatterSynthVal] Mark as xfail.
Summary:
This is to get the bots to go green while a robust solution to fix these
tests is worked out.

Reviewers: chaoren, tberghammer, clayborg

Reviewed By: tberghammer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 234625
2015-04-10 19:25:50 +00:00
Siva Chandra d7a2fc830f [TestAnonymous] Enable all tests for GCC
Summary:
Also added "_with_dsym" prefix to the dsym tests, and "_with_dwarf" to the dwarf tests.


Test Plan: dotest.py -C gcc -p TestAnonymous

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 234624
2015-04-10 19:24:48 +00:00
Kaelyn Takata 5cc8535596 Don't eagerly typo-correct to a keyword if the next token is a right paren.
Take advantage of the delayed typo no longer being eagerly corrected to
a keyword to filter out keyword corrections (and other things like
unresolved & overloaded expressions, which have placeholder types) when
correcting typos inside of a decltype().

llvm-svn: 234623
2015-04-10 19:16:46 +00:00
Sanjay Patel 89e28f67cc use update_llc_test_checks.py to tighten checking
test features, not CPUs

remove unnecessary cruft

llvm-svn: 234622
2015-04-10 18:31:42 +00:00
Rafael Espindola c8bc303faa Testcase for the previous commit.
Sorry, fogot to "git add" the previous time.

llvm-svn: 234621
2015-04-10 18:18:17 +00:00
Rafael Espindola d7e306fbcc Actually check if lseek works instead of using a filename based heuristic.
llvm-svn: 234620
2015-04-10 18:16:30 +00:00
Rafael Espindola 74d2f617f2 Remember if lseek works in this FD.
It will be used in clang in a sec.

llvm-svn: 234619
2015-04-10 18:15:51 +00:00