summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [asan] Fix size of shadow incorrectly calculated in r279178Vitaly Buka2016-08-192-4/+3
| | | | | | | | | | | | Summary: r279178 generates 8 times more stores than necessary. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23708 llvm-svn: 279222
* [PM] NFC refactoring: remove the AnalysisManagerBase class, folding itChandler Carruth2016-08-191-156/+95
| | | | | | | | | | | | | | | | | | | | | | into the AnalysisManager class template. Back when I first added this base class there were separate analysis managers and some plausible reason why it would be a useful factoring of common code between them. However, after a lot of refactoring cleaning, we now have *entirely* shared code. The base class was just an arbitrary division between code in one class template and a separate class template. It didn't add anything and forced lots of indirection through "derived_this" for no real gain. We can always factor a base CRTP class out with common code if there is ever some *other* analysis manager that wants to share a subset of logic. But for now, folding things into the primary template is a non-trivial simplification with no down sides I see. It shortens the code considerably, removes an unhelpful abstraction, and will make subsequent patches *dramatically* less complex which enhance the analysis manager infrastructure to effectively cope with invalidation. llvm-svn: 279221
* [ELF] - Do not change binding of symbols when creating relocatable output.George Rimar2016-08-192-0/+21
| | | | | | | | | | | | | Spec says "A hidden symbol contained in a relocatable object must be either removed or converted to STB_LOCAL binding by the link-editor when the relocatable object is included in an executable file or shared object". But we previously converted symbols to STB_LOCAL even when -r was specified. Broken binary was produced, this is PR28967, patch fixes the issue. Differential revision: https://reviews.llvm.org/D23514 llvm-svn: 279220
* [modules] Add missing include.Vassil Vassilev2016-08-191-0/+1
| | | | llvm-svn: 279219
* Revert "[CMake] Fix ASM building in llvm/runtimes"Jonas Hahnfeld2016-08-191-0/+19
| | | | | | This reverts the TSAN parts of commit r279215. llvm-svn: 279218
* [PM] Redesign how the new PM detects whether an analysis result providesChandler Carruth2016-08-193-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | its own invalidate method. Previously, the technique would assume that if a result didn't have an invalidate method that didn't exactly match the expected signature it didn't have one at all. This is in fact not the case. And we had analyses with incorrect signatures for the invalidate method in the tree that would be erroneously invalidated in certain cases! Yikes. Moreover a result might legitimately want to have multiple overloads for the invalidate method, and if one changes or a new one is needed we again really want a compiler error. For example in the tree we had not added the overload for a *function* IR unit to the invalidate routine for TLI. Doh. So a new techique for the SFINAE detection here: if the result has *any* member spelled "invalidate" we turn off the synthesis of a default version. We don't care if it is a member function or a member variable or how many overloads there are. Once a result has something by that name it must provide suitable overloads for the contexts in which it is used. This seems much more resilient and durable. Huge props to Richard Smith who helped me figure out how on earth we could even do this in C++. It took quite some doing. The technique is remarkably clean however, and merely requires that the analysis results are not *final* classes. I think that's a requirement we can live with even if it is a bit odd. I've fixed the two bad in-tree analysis results. And this will make my next change which changes the API for invalidate much easier to validate as correct. llvm-svn: 279217
* [PM] Rework the new PM support for building the ModuleSummaryIndex toChandler Carruth2016-08-194-91/+55
| | | | | | | | | | | | | | | | | | | | | | directly produce the index as the value type result. This requires making the index movable which is straightforward. It greatly simplifies things by allowing us to completely avoid the builder API and the layers of abstraction inherent there. Instead both pass managers can directly construct these when run by value. They still won't be constructed truly eagerly thanks to the optional in the legacy PM. The code that directly builds the index can also just share a direct function. A notable change here is that the result type of the analysis for the new PM is no longer a reference type. This was really problematic when making changes to how we handle result types to make our interface requirements *much* more strict and precise. But I think this is an overall improvement. Differential Revision: https://reviews.llvm.org/D23701 llvm-svn: 279216
* [CMake] Fix ASM building in llvm/runtimesJonas Hahnfeld2016-08-192-21/+2
| | | | | | | | | | When compiler-rt's CMake is not directly invoked, it will currently not call project() and thus ASM will not be enabled. We also don't need to put the .S files through the C compiler then. Differential Revision: https://reviews.llvm.org/D23656 llvm-svn: 279215
* Fix tests in llvm/test/tools/gold/X86 to satisfy r279014.NAKAMURA Takumi2016-08-197-9/+9
| | | | | | They would unexpectedly pass if test/tools/gold/X86/Output had outputs of previous tests. llvm-svn: 279214
* [Profile] Fix edge count read bugXinliang David Li2016-08-191-2/+2
| | | | | | Use uint64_t to avoid value truncation before scaling. llvm-svn: 279213
* [LTO] Move callback member from base class to the derived where it is used (NFC)Mehdi Amini2016-08-191-12/+10
| | | | llvm-svn: 279212
* Constify some path in the bitcode writer (NFC)Mehdi Amini2016-08-192-7/+7
| | | | llvm-svn: 279211
* [LTO] Add a move to inialize member in ctor initialization list (NFC)Mehdi Amini2016-08-191-1/+1
| | | | llvm-svn: 279210
* [Profile] Simple code refactoring for reuse /NFCXinliang David Li2016-08-191-12/+16
| | | | llvm-svn: 279209
* add all missing gtest tests to the Xcode lldb-gtest targetTodd Fiala2016-08-191-9/+159
| | | | | | | | Exclusions: ModuleCacheTest: https://llvm.org/bugs/show_bug.cgi?id=29045 SymbolFilePDBTests: https://llvm.org/bugs/show_bug.cgi?id=29046 llvm-svn: 279208
* clang/test/Modules/prebuilt-module.m: Prune "-triple" to fix a configuration ↵NAKAMURA Takumi2016-08-191-1/+1
| | | | | | mismatch. llvm-svn: 279207
* Re-commit [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-197-9/+140
| | | | | | There was a premature cast to pointer type in emitPointerArithmetic which caused assertion in tests with assertion enabled. llvm-svn: 279206
* fixup macOS gtest runningTodd Fiala2016-08-191-0/+22
| | | | | | | Needed to explicitly turn off RTTI (since lldb-core builds with -fno-rtti) and specify -DGTEST_HAVE_RTTI=0. llvm-svn: 279205
* [XRay] Synthesize a reference to the xray_instr_mapDean Michael Berris2016-08-192-0/+18
| | | | | | | | | | | | | | | | | | | | | Without the synthesized reference to a symbol in the xray_instr_map, linker section garbage collection will helpfully remove the whole xray_instr_map section from the final executable (or archive). This will cause the runtime to not be able to identify the sleds and hot-patch the calls/jumps into the runtime trampolines. This change adds a reference from the text section at the end of the function to keep around the associated xray_instr_map section as well. We also make sure that we catch this reference in the test. Reviewers: chandlerc, echristo, majnemer, mehdi_amini Subscribers: mehdi_amini, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D23398 llvm-svn: 279204
* fix broken gdb-remote gtestTodd Fiala2016-08-192-2/+45
| | | | | | | | This change adds the Process/gdb-remote gtests to the Xcode build. It also adds a virtual method impl to the continuation delegate that I added with the StructuredDataPlugin change. llvm-svn: 279203
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-19131-60/+11357
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* [RuntimeDyld][MCJIT] Un-XFAIL some tests that were fixed by r279182.Lang Hames2016-08-1910-10/+10
| | | | llvm-svn: 279201
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-19130-11355/+60
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Revert "RegScavenging: Add scavengeRegisterBackwards()"Matthias Braun2016-08-1910-551/+209
| | | | | | | | | | | The ppc64 multistage bot fails on this. This reverts commit r279124. Also Revert "CodeGen: Add/Factor out LiveRegUnits class; NFCI" because it depends on the previous change This reverts commit r279171. llvm-svn: 279199
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-19130-60/+11355
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* [ADT] Add the worlds simplest STL extra. Or at least close to it.Chandler Carruth2016-08-193-0/+46
| | | | | | | | | | | | | | | | | This is a little class template that just builds an inheritance chain of empty classes. Despite how simple this is, it can be used to really nicely create ranked overload sets. I've added a unittest as much to document this as test it. You can pass an object of this type as an argument to a function overload set an it will call the first viable and enabled candidate at or below the rank of the object. I'm planning to use this in a subsequent commit to more clearly rank overload candidates used for SFINAE. All credit for this technique and both lines of code here to Richard Smith who was helping me rewrite the SFINAE check in question to much more effectively capture the intended set of checks. llvm-svn: 279197
* C++ Modules TS: support parsing the 'module' declaration (including extensionsRichard Smith2016-08-198-36/+217
| | | | | | | | from p0273r0 approved by EWG). We'll eventually need to handle this from the lexer as well, in order to disallow preprocessor directives preceding the module declaration and to support macro import. llvm-svn: 279196
* [www] Add analyzer FAQ about not releasing ivars in -dealloc.Devin Coughlin2016-08-191-0/+10
| | | | llvm-svn: 279183
* [RuntimeDyld] Add support for ELF R_ARM_REL32 and R_ARM_GOT_PREL.Lang Hames2016-08-191-0/+16
| | | | | | | | | | | | | | | | Patch by William Dillon. Thanks William! This patch adds support for the R_ARM_REL32 and R_ARM_GOT_PREL ELF ARM relocations to RuntimeDyld, which should allow JITing of code that produces these relocations. No test case: Unfortunately RuntimeDyldELF's GOT building mechanism (which uses a separate section for GOT entries) isn't compatible with RuntimeDyldChecker. The correct fix for this is to fix RuntimeDyldELF's GOT support (it's fundamentally broken at the moment: separate sections aren't guaranteed to be in range of a GOT entry load), but that's a non-trivial job. llvm-svn: 279182
* [analyzer] Weaken assertion in trackNullOrUndefValue()Devin Coughlin2016-08-192-5/+27
| | | | | | | | | | | | | | | | | We should ignore paren casts when making sure that the semantic expression in a PseudoObjectExpr for an ObjC getter is a message send. This has no other intended functionality change. Adding a test for this exposed an interesting issue in another test case that only manifests under ARC. trackNullOrUndefValue() is not properly suppressing for nil values that are the result of nil propagation from a nil receiver when the nil is returned from a function. I've added a FIXME for that missing suppression. rdar://problem/27290568 llvm-svn: 279181
* EHABI: cover switch once moreSaleem Abdulrasool2016-08-181-0/+8
| | | | | | | | When making WMMX support optional, we uncovered the switch. Add the missing entries. Since the entry is a break leading to a dead path, it should get optimized out yet retain the switch overage. llvm-svn: 279180
* [asan] Optimize store size in FunctionStackPoisoner::poisonRedZonesVitaly Buka2016-08-184-47/+63
| | | | | | | | | | | | Summary: Reduce store size to avoid leading and trailing zeros. Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23648 llvm-svn: 279178
* Include X86CallFrameOptimization in the opt-bisect process.Andrew Kaylor2016-08-181-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D23683 llvm-svn: 279175
* AArch64: remove extraneous paddingSaleem Abdulrasool2016-08-181-3/+3
| | | | | | | | | | The structs BarrierOp, PrefetchOp, PSBHintOp are in AArch64AsmParser.cpp (inside anonymous namespace). This diff changes the order of fields and removes the excessive padding (8 bytes). Patch by Alexander Shaposhnikov! llvm-svn: 279173
* [CMake] Add variables for tracking which runtimes are includedChris Bieneman2016-08-181-0/+4
| | | | | | This allows sub-projects to have conditionals based on the presence of other projects. llvm-svn: 279172
* CodeGen: Add/Factor out LiveRegUnits class; NFCIMatthias Braun2016-08-185-68/+229
| | | | | | | | | | | | | This is a set of register units intended to track register liveness, it is similar in spirit to LivePhysRegs. You can also think of this as the liveness tracking parts of the RegisterScavenger factored out into an own class. This was proposed in http://llvm.org/PR27609 Differential Revision: http://reviews.llvm.org/D21916 llvm-svn: 279171
* [Documentation] Fixed style in modernize-use-emplace.rst.Eugene Zelenko2016-08-181-4/+3
| | | | llvm-svn: 279170
* Fix link quotes on AArch64's CompilerWriterInfo section.Jacques Pienaar2016-08-181-2/+2
| | | | | | | | | | Reviewers: t.p.northover Subscribers: t.p.northover, aemerson, rengolin Differential Revision: https://reviews.llvm.org/D23697 llvm-svn: 279169
* CodeGen: If Convert blocks that would form a diamond when tail-merged.Kyle Butt2016-08-183-82/+366
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following function currently relies on tail-merging for if conversion to succeed. The common tail of cond_true and cond_false is extracted, and this then forms a diamond pattern that can be successfully if converted. If this block does not get extracted, either because tail-merging is disabled or the threshold is higher, we should still recognize this pattern and if-convert it. Fixed a regression in the original commit. Need to un-reverse branches after reversing them, or other conversions go awry. Regression on self-hosting bots with no obvious explanation. Tidied up range handling to be more obviously correct, but there was no smoking gun. define i32 @t2(i32 %a, i32 %b) nounwind { entry: %tmp1434 = icmp eq i32 %a, %b ; <i1> [#uses=1] br i1 %tmp1434, label %bb17, label %bb.outer bb.outer: ; preds = %cond_false, %entry %b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ] %a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ] br label %bb bb: ; preds = %cond_true, %bb.outer %indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ] %tmp. = sub i32 0, %b_addr.021.0.ph %tmp.40 = mul i32 %indvar, %tmp. %a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph %tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph br i1 %tmp3, label %cond_true, label %cond_false cond_true: ; preds = %bb %tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph %tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph %indvar.next = add i32 %indvar, 1 br i1 %tmp1437, label %bb17, label %bb cond_false: ; preds = %bb %tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0 %tmp14 = icmp eq i32 %a_addr.026.0, %tmp10 br i1 %tmp14, label %bb17, label %bb.outer bb17: ; preds = %cond_false, %cond_true, %entry %a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ] ret i32 %a_addr.026.1 } Without tail-merging or diamond-tail if conversion: LBB1_1: @ %bb @ =>This Inner Loop Header: Depth=1 cmp r0, r1 ble LBB1_3 @ BB#2: @ %cond_true @ in Loop: Header=BB1_1 Depth=1 subs r0, r0, r1 cmp r1, r0 it ne cmpne r0, r1 bgt LBB1_4 LBB1_3: @ %cond_false @ in Loop: Header=BB1_1 Depth=1 subs r1, r1, r0 cmp r1, r0 bne LBB1_1 LBB1_4: @ %bb17 bx lr With diamond-tail if conversion, but without tail-merging: @ BB#0: @ %entry cmp r0, r1 it eq bxeq lr LBB1_1: @ %bb @ =>This Inner Loop Header: Depth=1 cmp r0, r1 ite le suble r1, r1, r0 subgt r0, r0, r1 cmp r1, r0 bne LBB1_1 @ BB#2: @ %bb17 bx lr llvm-svn: 279168
* IfConversion: Rescan diamonds.Kyle Butt2016-08-181-34/+115
| | | | | | | | | | | The cost of predicating a diamond is only the instructions that are not shared between the two branches. Additionally If a predicate clobbering instruction occurs in the shared portion of the branches (e.g. a cond move), it may still be possible to if convert the sub-cfg. This change handles these two facts by rescanning the non-shared portion of a diamond sub-cfg to recalculate both the predication cost and whether both blocks are pred-clobbering. llvm-svn: 279167
* IfConversion: Handle inclusive ranges more carefully.Kyle Butt2016-08-181-22/+56
| | | | | | | | | | | This may affect calculations for thresholds, but is not a significant change in behavior. The problem was that an inclusive range must have an additonal flag to showr that it is empty, because otherwise begin == end implies that the range has one element, and it may not be possible to move past on either side. llvm-svn: 279166
* AMDGPU: Add clang builtin for ds_swizzle.Changpeng Fang2016-08-184-0/+15
| | | | | | | | | | | Summary: int __builtin_amdgcn_ds_swizzle (int a, int imm); while imm is a constant. Differential Revision: http://reviews.llvm.org/D23682 llvm-svn: 279165
* PR28794: Don't try to instantiate function templates which are not visible.Vassil Vassilev2016-08-188-69/+123
| | | | | | Reviewed by Richard Smith. llvm-svn: 279164
* C++ Modules TS: Add parsing support for module import declaration.Richard Smith2016-08-187-28/+81
| | | | llvm-svn: 279163
* [ELF] Improve error reporting for relocationsPetr Hosek2016-08-1814-19/+27
| | | | | | | | | | | | We should always include symbol name when reporting relocations error to simplify debugging of these issues. Without symbol names users have to manually investigate which of the libraries contain invalid relocations which can be cumbersome when linking multiple libraries. Differential Revision: https://reviews.llvm.org/D23690 llvm-svn: 279162
* llvm-objdump: Add Hexagon printer changes for -S/-l optionsHemant Kulkarni2016-08-185-0/+105
| | | | | | Differential Revision: https://reviews.llvm.org/D23521 llvm-svn: 279161
* [CMake] Create convenience targets for runtime projectsChris Bieneman2016-08-181-0/+7
| | | | | | Each runtime project has a top-level target that is the name of the runtime (minus the "lib" prefix if applicable). This creates top-level targets mapping to runtime projects. llvm-svn: 279160
* CodeGen: Rename a variable to better fit LLVM style. NFCJustin Bogner2016-08-181-6/+6
| | | | llvm-svn: 279159
* [SystemZ] Use valid base/index regs for inline asmZhan Jun Liau2016-08-182-2/+25
| | | | | | | | | | | | | | | Summary: Inline asm memory constraints can have the base or index register be assigned to %r0 right now. Make sure that we assign only ADDR64 registers to the base and index. Reviewers: uweigand Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23367 llvm-svn: 279157
* [Analysis] Change several Analysis pieces to use NodeRef. NFC.Tim Shen2016-08-183-66/+74
| | | | | | | | | | Reviewers: dblaikie, grosser Subscribers: mzolotukhin, llvm-commits Differential Revision: https://reviews.llvm.org/D23625 llvm-svn: 279156
OpenPOWER on IntegriCloud