Commit Graph

230711 Commits

Author SHA1 Message Date
Teresa Johnson 532e33be42 [ThinLTO] Use correct pipeline for ThinLTO in gold-plugin.
This change is the gold side of the change made in D17115 and clang
patch r261045 to add a ThinLTO specific pipeline that moves more of
the optimization to the backends.

llvm-svn: 269386
2016-05-13 01:25:31 +00:00
Akira Hatanaka fdacb5c056 [ObjC][CodeGen] Remove an assert that is no longer correct.
clang asserts when compiling the following code because r231508 made
changes to promote constant temporary arrays and records to globals
with constant initializers:

std::vector<NSString*> strs = {@"a", @"b"};

This commit changes the code to return early if the object returned by
createReferenceTemporary is a global variable with an initializer.

rdar://problem/25504992
rdar://problem/25955179

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

llvm-svn: 269385
2016-05-13 01:21:23 +00:00
Xinliang David Li 8e6b917ec8 Remove runtime specific code from common header
llvm-svn: 269384
2016-05-13 00:23:49 +00:00
Adrian Prantl e1bc3e2027 dsymutil: Fix the DWOId mismatch check for cached modules.
In verbose mode, we emit a warning if the DWOId of a skeleton CU
mismatches the DWOId of the referenced module. This patch updates the
cached DWOId after a module has been loaded to the DWOId of the module
on disk (instead of storing the DWOId we expected to load). This
allows us to correctly emit the mismatch warning for all subsequent
object files that want to import the same module. This patch also
ensures both warnings are only emitted in verbose mode.

rdar://problem/26214027

llvm-svn: 269383
2016-05-13 00:17:58 +00:00
Richard Smith 55c28889c1 Preserve the FoundDecl properly in constructor overload resolution. No
functionality change; this information is not yet in use.

llvm-svn: 269382
2016-05-12 23:45:49 +00:00
Reid Kleckner ce5196e728 [codeview] Try to handle errors better in record iterator
llvm-svn: 269381
2016-05-12 23:26:23 +00:00
Chris Bieneman 05a19af7f1 [MachO] Extract MachO load command enums into a def file
Having the MachO enums in a def file instead of inline will allow us to write utilities and encoding/decoding methods for load commands without having to write a lot of mechanically repeated code.

llvm-svn: 269380
2016-05-12 23:18:31 +00:00
Justin Bogner 283e3bd793 SDAG: Implement Select instead of SelectImpl in AArch64DAGToDAGISel
This one has a lot of code churn, but it's all mechanical and
straightforward.

- Where we were returning a node before, call ReplaceNode instead.
- Where we would return null to fall back to another selector, rename
  the method to try* and return a bool for success.
- Where we were calling SelectNodeTo, just return afterwards.

Part of llvm.org/pr26808.

llvm-svn: 269379
2016-05-12 23:10:30 +00:00
Enrico Granata 7d1ff51f4a Add a check for version 15 of the shared cache format
<rdar://problem/26207478>

llvm-svn: 269378
2016-05-12 23:04:43 +00:00
Greg Clayton 1e20f021f3 Fix some long standing issues that caused tests to be flaky.
The main issues were:
- Listeners recently were converted over to used by getting a shared pointer to a listener. And when they listened to broadcasters they would get a strong reference added to them meaning the listeners would never go away. This caused memory usage to increase and would cause performance issue if many steps were done.
- The lldb_private::Process private state thread had an issue where if a "stop" contol signal was attempted to be sent to that thread, it could end up not responding in 2 seconds and end up getting cancelled which might cause us to cancel a thread that had a mutex locked and it would deadlock the test.

This change makes broadcasters hold onto weak references to listeners. It also fixes some bad threading code that had races inside of it by making the m_events_mutex be non-recursive and getting rid of fragile use of a Predicate<bool> to say that new events are available, and replacing it with using the m_events_mutex with a new m_events_condition to control access to the events in a safer way.

The private state thread now uses a safer way to communicate that the control event has been received by the private state thread: it makes a EventDataReceipt instance that it attaches to the event that sends the control to the private state thread and used this to synchronize the fact that the private state thread has received the event instead of using a Predicate<bool> to convey the info. When the signal event is received, it will pull the event off of the queue in the private state thread and cause the EventData::DoOnRemoval() to be called, which will signal that the event has been received. This cleans up the signal delivery notification so it doesn't rely on a member variable of the process class to convey the info.

std::shared_ptr<EventDataReceipt> event_receipt_sp(new EventDataReceipt());
m_private_state_control_broadcaster.BroadcastEvent(signal, event_receipt_sp);

<rdar://problem/26256353> Listeners are being kept around longer than they should be due to recent changs
<rdar://problem/26256258> Private process state thread can be cancelled and cause deadlocks in test suite

llvm-svn: 269377
2016-05-12 22:58:52 +00:00
Hemant Kulkarni 787c2ed672 llvm-readobj: Fix GNU style entry point print width
llvm-svn: 269376
2016-05-12 22:51:26 +00:00
Rafael Espindola 686ffc6f4c Slit the relocation scan in two parts.
The first part handles whatever has to be written to the r_offset
position.

The second part handles creating got and plt entries.

llvm-svn: 269375
2016-05-12 22:51:22 +00:00
Reid Kleckner 0e85b97307 [codeview] Fix dumping VFTables, stop when we see LF_PAD*
Also stop visiting type records when we encounter an error.

llvm-svn: 269374
2016-05-12 22:46:41 +00:00
Greg Clayton 1059a067f9 Don't crash when a process' task port goes bad.
<rdar://problem/26256049>

llvm-svn: 269373
2016-05-12 22:36:47 +00:00
Greg Clayton ff8e6a763f Fix libstdc++ failure where <atomic> is not able to be imported on Darwin systems.
The adding of <atomic> to test_common.h broke 12 tests on Darwin. We work around this by not including <atomic> when building on darwin for libstdc++ tests.

llvm-svn: 269372
2016-05-12 22:33:02 +00:00
Eugene Zelenko a9f3e908bf Fix Clang-tidy modernize-use-bool-literals in generated code.
Reduce space in empty constructors and between data members and first public section.

Fix some Include What You Use warnings.

Differential revision: http://reviews.llvm.org/D20213

llvm-svn: 269371
2016-05-12 22:27:08 +00:00
Chandler Carruth 49c22190d0 [PM] Port of the DepndenceAnalysis to the new PM.
Ported DA to the new PM by splitting the former DependenceAnalysis Pass
into a DependenceInfo result type and DependenceAnalysisWrapperPass type
and adding a new PM-style DependenceAnalysis analysis pass returning the
DependenceInfo.

Patch by Philip Pfaffe, most of the review by Justin.

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

llvm-svn: 269370
2016-05-12 22:19:39 +00:00
Rafael Espindola 203b0773a3 Move addend computation to a helper function.
llvm-svn: 269369
2016-05-12 22:19:35 +00:00
Hemant Kulkarni cb21f3c73d llvm-readobj: Change Hex output for GNU style dynamic table print
Dynamic table when printed shows uppercase tag/values.
This changes it to lower case when printing in GNU style

llvm-svn: 269368
2016-05-12 22:16:53 +00:00
Richard Smith b8348f57bb Refactor constant expression evaluation of CXXConstructExpr to reduce duplication between array and class initialization.
llvm-svn: 269367
2016-05-12 22:16:28 +00:00
Cameron Desrochers 739fc77c01 Added missing makefile from patch D19124 (should fix the corresponding commit rL269340)
llvm-svn: 269366
2016-05-12 22:10:16 +00:00
Jonathan Peyton f83ae31caf Adding new kmp_aligned_malloc() entry point
This change adds a new entry point,
kmp_aligned_malloc(size_t size, size_t alignment), an entry point corresponding
to kmp_malloc() but with the capability to return aligned memory as well.
Other allocator routines have been adjusted so that kmp_free() can be used for
freeing memory blocks allocated by any kmp_*alloc() routine, including the new
kmp_aligned_malloc() routine.

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

llvm-svn: 269365
2016-05-12 22:00:37 +00:00
Justin Bogner 7a0fe694b8 SDAG: Implement Select instead of SelectImpl in LanaiDAGToDAGISel
- Where we were returning a node before, call ReplaceNode instead.
- Where we were calling SelectNodeTo, just return afterwards.

Part of llvm.org/pr26808.

llvm-svn: 269364
2016-05-12 21:56:18 +00:00
Jonathan Peyton 2b749b33cc Fix team reuse with foreign threads
After hot teams were enabled by default, the library started using levels kept
in the team structure. The levels are broken in case foreign thread exits and
puts its team into the pool which is then re-used by another foreign thread.
The broken behavior observed is when printing the levels for each new team, one
gets 1, 2, 1, 2, 1, 2, etc. This makes the library believe that every other
team is nested which is incorrect. What is wanted is for the levels to be
1, 1, 1, etc.

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

llvm-svn: 269363
2016-05-12 21:54:30 +00:00
Rafael Espindola 01f1636408 Handle thunks in adjustExpr.
This is similar to the other changes this function does. With this all
Relocations.push_back calls look similar.

llvm-svn: 269362
2016-05-12 21:53:34 +00:00
Rafael Espindola 62cb02eef1 This reverts commit r269359 and r269360.
I will commit again with a fixed commit message.

llvm-svn: 269361
2016-05-12 21:51:16 +00:00
Rafael Espindola cc42a90b76 Handle thunks in adjustExpr.
This is similar to the other changes this function does. With this all
Relocations.push_back calls look similar.

llvm-svn: 269360
2016-05-12 21:47:26 +00:00
Rafael Espindola 01a94f8336 bra
llvm-svn: 269359
2016-05-12 21:47:24 +00:00
Justin Bogner ec37a02766 SDAG: Implement Select instead of SelectImpl in HexagonDAGToDAGISel
- Where we were returning a node before, call ReplaceNode instead.
- Where we had already replaced all uses and we returned a node, just
  remove the dead node instead.
- Where we would return null to fall back to another selector, rename
  the method to try* and return a bool for success.

Part of llvm.org/pr26808.

llvm-svn: 269358
2016-05-12 21:46:18 +00:00
Xinliang David Li d1dadf6bcf [profile] Code refactoring
Move runtime specific code from the common header file
to runtime source.

llvm-svn: 269357
2016-05-12 21:43:49 +00:00
Adam Nemet 2c34ab51a4 [LAA] Use std::min. NFC
llvm-svn: 269356
2016-05-12 21:41:53 +00:00
Justin Bogner d82025b133 SDAG: Clean up a dangling node in HexagonISelDAGToDAG::SelectImpl
When we convert to the void Select interface, leaving unreferenced
nodes around won't be allowed anymore.

Part of llvm.org/pr26808.

llvm-svn: 269355
2016-05-12 21:24:23 +00:00
Renato Golin 608cb5def6 [ARM] Support and tests for transform of LDR rt, = to MOV
This change implements the transformation in processInstruction() for the
LDR rt, =expression to MOV rt, expression when the expression can be evaluated
and can fit into the immediate field of the MOV or a MVN.

Across the ARM and Thumb instruction sets there are several cases to consider,
each with a different range of representatble constants.

In ARM we have:
 * Modified immediate (All ARM architectures)
 * MOVW (v6t2 and above)

In Thumb we have:
 * Modified immediate (v6t2, v7m and v8m.mainline)
 * MOVW (v6t2, v7m, v8.mainline and v8m.baseline)
 * Narrow Thumb MOV that can be used in an IT block (non flag-setting)

If the immediate fits any of the available alternatives then we make the transformation.

Fixes 25722.

Patch by Peter Smith.

llvm-svn: 269354
2016-05-12 21:22:42 +00:00
Renato Golin d5491ab1f9 [ARM] Fixup tests to take into account mov translation. NFC.
Alter instances in the test-suite that use immediates that can be represented
in the immediate field of a MOV. The reason for doing this is that when the
LDR rt,=imm transformation to MOV rt, imm the existing tests do not need to
be modified.

Required by the patch that fixes PR25722.

Patch by Peter Smith.

llvm-svn: 269353
2016-05-12 21:22:37 +00:00
Renato Golin 3f126138a1 [ARM] Delay ARM constant pool creation. NFC.
This change adds a new constant pool kind to ARMOperand. When parsing the
operand for =immediate we create an instance of this operand rather than
creating a constant pool entry and rewriting the operand.

As the new operand kind is only created for ldr rt,= we can make ldr rt,=
an explicit pseudo instruction in ARM, Thumb and Thumb2

The pseudo instruction is expanded in processInstruction(). This creates the
constant pool and transforms the pseudo instruction into a pc-relative ldr to
the constant pool.

There are no functional changes and no modifications needed to existing tests.

Required by the patch that fixes PR25722.

Patch by Peter Smith.

llvm-svn: 269352
2016-05-12 21:22:31 +00:00
Xinliang David Li 911af1ce15 Minor code refactoring /NFC
llvm-svn: 269351
2016-05-12 21:18:41 +00:00
Justin Bogner f076e79388 SDAG: Implement Select instead of SelectImpl in BPFDAGToDAGISel
- Where we were returning a node before, call ReplaceNode instead.
- Where we were calling SelectNodeTo, just return afterwards.

Part of llvm.org/pr26808.

llvm-svn: 269350
2016-05-12 21:14:47 +00:00
Justin Bogner 95927c0fd0 SDAG: Implement Select instead of SelectImpl in AMDGPUDAGToDAGISel
- Where we were returning a node before, call ReplaceNode instead.
- Where we would return null to fall back to another selector, rename
  the method to try* and return a bool for success.
- Where we were calling SelectNodeTo, just return afterwards.

Part of llvm.org/pr26808.

llvm-svn: 269349
2016-05-12 21:03:32 +00:00
Simon Pilgrim 3ac4d831ee Tidied up switch cases. NFCI.
Split FCMP//ICMP/SEL from the basic arithmetic cost functions. They were not sharing any notable code path (just the return) and were repeatedly testing the opcode.

llvm-svn: 269348
2016-05-12 21:01:20 +00:00
Etienne Bergeron 5356d96d19 [AST] Move operations enum to a definition file.
Summary:
This patch moves the enum definitions to a definition (.def) file.

These modifications provide way to list enumerators of a given type.

As an example, this allow parsing of "kinds" in the dynamic matchers.
see: http://reviews.llvm.org/D19871
The dynamic matcher "ofKind" also required this patch to be fixed.

Reviewers: klimek, aaron.ballman, rsmith

Subscribers: klimek, sbenza, alexfh, cfe-commits

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

llvm-svn: 269347
2016-05-12 20:58:56 +00:00
John Regehr 6a493f2c4a [Docs] clarify semantics of x.with.overflow intrinsics
Differential Revision: http://reviews.llvm.org/D20151

llvm-svn: 269346
2016-05-12 20:55:09 +00:00
Justin Bogner 3525da7466 SDAG: Clean up dangling nodes in AArch64ISelDAGToDAG::SelectImpl
When we convert to the void Select interface, leaving unreferenced
nodes around won't be allowed anymore.

Part of llvm.org/pr26808.

llvm-svn: 269345
2016-05-12 20:54:27 +00:00
Tom Stellard 740af6f3b0 Revert "LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()"
This reverts commit r269016 and also the follow-up commit r269020.

This patch caused PR27705.

llvm-svn: 269344
2016-05-12 20:27:40 +00:00
Johannes Doerfert e6e3c9246a Check late for profitability
Before this patch we only expanded valid __and__ profitable region. Therefor
  we did not allow the expansion to create a profitable region from a
  non-profitable one.  With this patch we will remember and expand all valid
  regions and check for profitability only at the end.

  This patch increases the number of valid SCoPs in the LLVM-TS and SPEC
  2000/2006 by 28% (from 303 to 390), including the hot loop in hmmer.

llvm-svn: 269343
2016-05-12 20:21:50 +00:00
Jonathan Coe a30c69c9e4 [clang-tidy] Adds modernize-avoid-bind check
Summary:
This patch adds a check that replaces std::bind with a lambda.

Not yet working for member functions.

Reviewers: aaron.ballman, alexfh

Subscribers: cfe-commits

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

llvm-svn: 269341
2016-05-12 20:06:04 +00:00
Marianne Mailhot-Sarrasin 3fe7158174 [LLDB] Added support for PHI nodes to IR interpreter
This allows expressions such as 'i == 1 || i == 2` to be executed using the IR interpreter, instead of relying on JIT code injection (which may not be available on some platforms).

Patch by cameron314

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

llvm-svn: 269340
2016-05-12 20:00:53 +00:00
David Blaikie bc8397cdf0 llvm-dwp: Use llvm::Error to improve diagnostic quality/error handling in llvm-dwp
llvm-svn: 269339
2016-05-12 19:59:54 +00:00
Hemant Kulkarni 04ac3d730c llvm-readobj: Fix the GNU section header flags for SHF_MASKPROC and SHF_MASKOS
llvm-svn: 269338
2016-05-12 19:58:52 +00:00
Amjad Aboud f29608265d Fixed the callee saved registers list for X86 AllRegs calling convention.
32-bit AllRegs:
SSE: xmm0-xmm7
AVX: ymm0-ymm7
AVX512: zmm0-zmm7 + k0-k7

64-bit AllRegs:
SSE: xmm0-xmm15
AVX: ymm0-ymm15
AVX512: zmm0-zmm31 + k0-k7

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

llvm-svn: 269337
2016-05-12 19:58:32 +00:00
Chris Bieneman 9183c1ab32 [obj2yaml] Fix ASAN bot failure
I was leaking out of a unique_ptr, should have just kept it in the unique_ptr.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/12738/steps/check-llvm%20asan/logs/stdio

llvm-svn: 269336
2016-05-12 19:57:07 +00:00