summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* SDAG: Implement Select instead of SelectImpl in MSP430DAGToDAGISelJustin Bogner2016-05-131-76/+57
| | | | | | | | | | | - 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: 269393
* [LoopDist] Only run LAA for loops with the pragmaAdam Nemet2016-05-131-17/+17
| | | | | | | This should fix some compile-time regressions after r267672. Thanks to Chris Matthews for bisecting it. llvm-svn: 269392
* AMDGPU: Remove verifier check for scc live insMatt Arsenault2016-05-132-16/+44
| | | | | | | | | | We only really need this to be true for SIFixSGPRCopies. I'm not sure there's any way this could happen before that point. Fixes a case where MachineCSE could introduce a cross block scc use. llvm-svn: 269391
* [ADT] Add an 'llvm::seq' function which produces an iterator range overChandler Carruth2016-05-134-2/+134
| | | | | | | | | | | | | | | | | | | | | | | | | a sequence of values. It increments through the values in the half-open range: [Begin, End), producing those values when indirecting the iterator. It should support integers, iterators, and any other type providing these basic arithmetic operations. This came up in the C++ standards committee meeting, and it seemed like a useful construct that LLVM might want as well, and I wanted to understand how easily we could solve it. I suspect this can be used to write simpler counting loops even in LLVM along the lines of: for (int i : seq(0, v.size())) { ... }; As part of this, I had to fix the lack of a proxy object returned from the operator[] in our iterator facade. Differential Revision: http://reviews.llvm.org/D17870 llvm-svn: 269390
* [clang-tidy] - PerformanceUnnecesaryCopyInitialization - only trigger for ↵Felix Berger2016-05-133-20/+35
| | | | | | | | | | | | | | decl stmts with single VarDecl. Summary: This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=27325 Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19865 llvm-svn: 269389
* [Unroll] Implement a conservative and monotonically increasing cost tracking ↵Michael Zolotukhin2016-05-137-18/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system during the full unroll heuristic analysis that avoids counting any instruction cost until that instruction becomes "live" through a side-effect or use outside the... Summary: ...loop after the last iteration. This is really hard to do correctly. The core problem is that we need to model liveness through the induction PHIs from iteration to iteration in order to get the correct results, and we need to correctly de-duplicate the common subgraphs of instructions feeding some subset of the induction PHIs. All of this can be driven either from a side effect at some iteration or from the loop values used after the loop finishes. This patch implements this by storing the forward-propagating analysis of each instruction in a cache to recall whether it was free and whether it has become live and thus counted toward the total unroll cost. Then, at each sink for a value in the loop, we recursively walk back through every value that feeds the sink, including looping back through the iterations as needed, until we have marked the entire input graph as live. Because we cache this, we never visit instructions more than twice -- once when we analyze them and put them into the cache, and once when we count their cost towards the unrolled loop. Also, because the cache is only two bits and because we are dealing with relatively small iteration counts, we can store all of this very densely in memory to avoid this from becoming an excessively slow analysis. The code here is still pretty gross. I would appreciate suggestions about better ways to factor or split this up, I've stared too long at the algorithmic side to really have a good sense of what the design should probably look at. Also, it might seem like we should do all of this bottom-up, but I think that is a red herring. Specifically, the simplification power is *much* greater working top-down. We can forward propagate very effectively, even across strange and interesting recurrances around the backedge. Because we use data to propagate, this doesn't cause a state space explosion. Doing this level of constant folding, etc, would be very expensive to do bottom-up because it wouldn't be until the last moment that you could collapse everything. The current solution is essentially a top-down simplification with a bottom-up cost accounting which seems to get the best of both worlds. It makes the simplification incremental and powerful while leaving everything dead until we *know* it is needed. Finally, a core property of this approach is its *monotonicity*. At all times, the current UnrolledCost is a conservatively low estimate. This ensures that we will never early-exit from the analysis due to exceeding a threshold when if we had continued, the cost would have gone back below the threshold. These kinds of bugs can cause incredibly hard to track down random changes to behavior. We could use a techinque similar (but much simpler) within the inliner as well to avoid considering speculated code in the inline cost. Reviewers: chandlerc Subscribers: sanjoy, mzolotukhin, llvm-commits Differential Revision: http://reviews.llvm.org/D11758 llvm-svn: 269388
* [LoopUnrollAnalyzer] Don't treat gep-instructions with simplified offset as ↵Michael Zolotukhin2016-05-133-2/+30
| | | | | | | | | | | | | | | | | | simplified. Summary: Currently we consider such instructions as simplified, which is incorrect, because if their user isn't simplified, we can't actually simplify them too. This biases our estimates of profitability: for instance the analyzer expects much more gains from unrolling memcpy loops than there actually are. Reviewers: hfinkel, chandlerc Subscribers: mzolotukhin, llvm-commits Differential Revision: http://reviews.llvm.org/D17365 llvm-svn: 269387
* [ThinLTO] Use correct pipeline for ThinLTO in gold-plugin.Teresa Johnson2016-05-131-1/+4
| | | | | | | | 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
* [ObjC][CodeGen] Remove an assert that is no longer correct.Akira Hatanaka2016-05-132-4/+27
| | | | | | | | | | | | | | | | | | 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
* Remove runtime specific code from common headerXinliang David Li2016-05-132-161/+33
| | | | llvm-svn: 269384
* dsymutil: Fix the DWOId mismatch check for cached modules.Adrian Prantl2016-05-132-6/+21
| | | | | | | | | | | | | | 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
* Preserve the FoundDecl properly in constructor overload resolution. NoRichard Smith2016-05-122-11/+7
| | | | | | functionality change; this information is not yet in use. llvm-svn: 269382
* [codeview] Try to handle errors better in record iteratorReid Kleckner2016-05-127-15/+29
| | | | llvm-svn: 269381
* [MachO] Extract MachO load command enums into a def fileChris Bieneman2016-05-122-50/+72
| | | | | | 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
* SDAG: Implement Select instead of SelectImpl in AArch64DAGToDAGISelJustin Bogner2016-05-121-802/+1161
| | | | | | | | | | | | | | 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
* Add a check for version 15 of the shared cache formatEnrico Granata2016-05-121-1/+1
| | | | | | <rdar://problem/26207478> llvm-svn: 269378
* Fix some long standing issues that caused tests to be flaky. Greg Clayton2016-05-1210-216/+323
| | | | | | | | | | | | | | | | | | 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
* llvm-readobj: Fix GNU style entry point print widthHemant Kulkarni2016-05-121-1/+1
| | | | llvm-svn: 269376
* Slit the relocation scan in two parts.Rafael Espindola2016-05-121-53/+43
| | | | | | | | | 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
* [codeview] Fix dumping VFTables, stop when we see LF_PAD*Reid Kleckner2016-05-124-2/+58
| | | | | | Also stop visiting type records when we encounter an error. llvm-svn: 269374
* Don't crash when a process' task port goes bad.Greg Clayton2016-05-121-1/+0
| | | | | | <rdar://problem/26256049> llvm-svn: 269373
* Fix libstdc++ failure where <atomic> is not able to be imported on Darwin ↵Greg Clayton2016-05-123-6/+10
| | | | | | | | 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
* Fix Clang-tidy modernize-use-bool-literals in generated code.Eugene Zelenko2016-05-121-16/+118
| | | | | | | | | | 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
* [PM] Port of the DepndenceAnalysis to the new PM.Chandler Carruth2016-05-1211-254/+224
| | | | | | | | | | | | | 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
* Move addend computation to a helper function.Rafael Espindola2016-05-121-25/+39
| | | | llvm-svn: 269369
* llvm-readobj: Change Hex output for GNU style dynamic table printHemant Kulkarni2016-05-121-3/+4
| | | | | | | Dynamic table when printed shows uppercase tag/values. This changes it to lower case when printing in GNU style llvm-svn: 269368
* Refactor constant expression evaluation of CXXConstructExpr to reduce ↵Richard Smith2016-05-121-35/+18
| | | | | | duplication between array and class initialization. llvm-svn: 269367
* Added missing makefile from patch D19124 (should fix the corresponding ↵Cameron Desrochers2016-05-121-0/+5
| | | | | | commit rL269340) llvm-svn: 269366
* Adding new kmp_aligned_malloc() entry pointJonathan Peyton2016-05-1219-6/+227
| | | | | | | | | | | | | 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
* SDAG: Implement Select instead of SelectImpl in LanaiDAGToDAGISelJustin Bogner2016-05-121-21/+13
| | | | | | | | | - 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
* Fix team reuse with foreign threadsJonathan Peyton2016-05-122-0/+84
| | | | | | | | | | | | | | 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
* Handle thunks in adjustExpr.Rafael Espindola2016-05-121-5/+9
| | | | | | | This is similar to the other changes this function does. With this all Relocations.push_back calls look similar. llvm-svn: 269362
* This reverts commit r269359 and r269360.Rafael Espindola2016-05-121-9/+5
| | | | | | I will commit again with a fixed commit message. llvm-svn: 269361
* Handle thunks in adjustExpr.Rafael Espindola2016-05-121-2/+2
| | | | | | | This is similar to the other changes this function does. With this all Relocations.push_back calls look similar. llvm-svn: 269360
* braRafael Espindola2016-05-121-3/+7
| | | | llvm-svn: 269359
* SDAG: Implement Select instead of SelectImpl in HexagonDAGToDAGISelJustin Bogner2016-05-121-139/+189
| | | | | | | | | | | | - 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
* [profile] Code refactoringXinliang David Li2016-05-122-119/+112
| | | | | | | Move runtime specific code from the common header file to runtime source. llvm-svn: 269357
* [LAA] Use std::min. NFCAdam Nemet2016-05-121-4/+2
| | | | llvm-svn: 269356
* SDAG: Clean up a dangling node in HexagonISelDAGToDAG::SelectImplJustin Bogner2016-05-121-1/+1
| | | | | | | | | 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
* [ARM] Support and tests for transform of LDR rt, = to MOVRenato Golin2016-05-126-13/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ARM] Fixup tests to take into account mov translation. NFC.Renato Golin2016-05-126-56/+56
| | | | | | | | | | | | | 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
* [ARM] Delay ARM constant pool creation. NFC.Renato Golin2016-05-125-6/+92
| | | | | | | | | | | | | | | | | | | | | 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
* Minor code refactoring /NFCXinliang David Li2016-05-121-6/+15
| | | | llvm-svn: 269351
* SDAG: Implement Select instead of SelectImpl in BPFDAGToDAGISelJustin Bogner2016-05-121-15/+10
| | | | | | | | | - 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
* SDAG: Implement Select instead of SelectImpl in AMDGPUDAGToDAGISelJustin Bogner2016-05-121-49/+67
| | | | | | | | | | | - 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
* Tidied up switch cases. NFCI.Simon Pilgrim2016-05-121-52/+48
| | | | | | 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
* [AST] Move operations enum to a definition file.Etienne Bergeron2016-05-124-474/+420
| | | | | | | | | | | | | | | | | | | 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
* [Docs] clarify semantics of x.with.overflow intrinsicsJohn Regehr2016-05-121-1/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D20151 llvm-svn: 269346
* SDAG: Clean up dangling nodes in AArch64ISelDAGToDAG::SelectImplJustin Bogner2016-05-121-5/+8
| | | | | | | | | 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
* Revert "LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()"Tom Stellard2016-05-127-85/+250
| | | | | | | | This reverts commit r269016 and also the follow-up commit r269020. This patch caused PR27705. llvm-svn: 269344
OpenPOWER on IntegriCloud