summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [ThinLTO] Add funtions in callees metadata to CallGraphEdgesTaewook Oh2018-03-133-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If there's a callees metadata attached to the indirect call instruction, add CallGraphEdges to the callees mentioned in the metadata when computing FunctionSummary. * Why this is necessary: Consider following code example: ``` (foo.c) static int f1(int x) {...} static int f2(int x); static int (*fptr)(int) = f2; static int f2(int x) { if (x) fptr=f1; return f1(x); } int foo(int x) { (*fptr)(x); // !callees metadata of !{i32 (i32)* @f1, i32 (i32)* @f2} would be attached to this call. } (bar.c) int bar(int x) { return foo(x); } ``` At LTO time when `foo.o` is imported into `bar.o`, function `foo` might be inlined into `bar` and PGO-guided indirect call promotion will run after that. If the profile data tells that the promotion of `@f1` or `@f2` is beneficial, the optimizer will check if the "promoted" `@f1` or `@f2` (such as `@f1.llvm.0` or `@f2.llvm.0`) is available. Without this patch, importing `!callees` metadata would only add promoted declarations of `@f1` and `@f2` to the `bar.o`, but still the optimizer will assume that the function is available and perform the promotion. The result of that is link failure with `undefined reference to @f1.llvm.0`. This patch fixes this problem by adding callees in the `!callees` metadata to CallGraphEdges so that their definition would be properly imported into. One may ask that there already is a logic to add indirect call promotion targets to be added to CallGraphEdges. However, if profile data says "indirect call promotion is only beneficial under a certain inline context", the logic wouldn't work. In the code example above, if profile data is like ``` bar:1000000:100000 1:100000 1: foo:100000 1: 100000 f1:100000 ``` , Computing FunctionSummary for `foo.o` wouldn't add `foo->f1` to CallGraphEdges. (Also, it is at least "possible" that one can provide profile data to only link step but not to compilation step). Reviewers: tejohnson, mehdi_amini, pcc Reviewed By: tejohnson Subscribers: inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D44399 llvm-svn: 327358
* Use PLT relocations in test.Rafael Espindola2018-03-131-4/+4
| | | | | | | | Currently lld creates plain plt entries when a R_386_PC32 resolves to a symbol in a shared library. That is a bug (PR36678). Don't depend on that behavior on this test. llvm-svn: 327357
* [ExpressionParser] Fix crash when evaluating invalid expresssions.Davide Italiano2018-03-133-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Typical example, illformed comparisons (operator== where LHS and RHS are not compatible). If a symbol matched `operator==` in any of the object files lldb inserted a generic function declaration in the ASTContext on which Sema operates. Maintaining the AST context invariants is fairly tricky and sometimes resulted in crashes inside clang (or assertions hit). The real reason why this feature exists in the first place is that of allowing users to do something like: (lldb) call printf("patatino") even if the debug informations for printf() is not available. Eventually, we might reconsider this feature in its entirety, but for now we can't remove it as it would break a bunch of users. Instead, try to limit it to non-C++ symbols, where getting the invariants right is hopefully easier. Now you can't do in lldb anymore (lldb) call _Zsomethingsomething(1,2,3) but that doesn't seem to be such a big loss. <rdar://problem/35645893> llvm-svn: 327356
* [LegalizeTypes] In SplitVecOp_TruncateHelper, use GetSplitVector on the ↵Craig Topper2018-03-132-330/+167
| | | | | | input instead of creating new extract_subvectors. llvm-svn: 327355
* Add missing "env" so that test added in r327322 passes on Windows bots.Douglas Yung2018-03-131-1/+1
| | | | llvm-svn: 327354
* [lld] Fix comdat testsAlexander Shaposhnikov2018-03-133-0/+10
| | | | | | | This diff adjusts the comdat tests after changing the format of llvm-readobj output for .group sections. llvm-svn: 327353
* [CFG] [analyzer] Don't add construction context to a return-by-reference call.Artem Dergachev2018-03-124-6/+62
| | | | | | | | | | | | | | Call expressions that return objects by an lvalue reference or an rvalue reference have a value type in the AST but wear an auxiliary flag of being an lvalue or an xvalue respectively. Use the helper method for obtaining the actual return type of the function. Fixes a crash. Differential Revision: https://reviews.llvm.org/D44273 llvm-svn: 327352
* ObjCARC: address review comments from majnemerSaleem Abdulrasool2018-03-121-8/+5
| | | | | | | I forgot to incorporate these comments into the original revision. This is just code cleanup addressing the feedback, NFC. llvm-svn: 327351
* [lit] `llvm-mc` is now a dependency to run tests.Davide Italiano2018-03-121-0/+1
| | | | llvm-svn: 327350
* [llvm] Fix mc testsAlexander Shaposhnikov2018-03-121-0/+4
| | | | | | | This diff adjusts the mc tests after changing the format of llvm-readobj output for .group sections. llvm-svn: 327349
* [analyzer] Support temporaries conjured by conservatively evaluated functions.Artem Dergachev2018-03-123-17/+81
| | | | | | | | | | | | | | Properly perform destruction and lifetime extension of such temporaries. C++ object-type return values of conservatively evaluated functions are now represented as compound values of well-defined temporary object regions. The function creates a region that represents the temporary object and will later be used for destruction or materialization, invalidates it, and returns the invalidated compound value of the object. Differential Revision: https://reviews.llvm.org/D44131 llvm-svn: 327348
* [analyzer] NFC: Move the code for setting temp object lifetime into method.Artem Dergachev2018-03-123-61/+69
| | | | | | Differential Revision: https://reviews.llvm.org/D44129 llvm-svn: 327347
* Revert "Reland "[clang-doc] Setup clang-doc frontend framework""Julie Hockett2018-03-1224-2119/+0
| | | | | | | This reverts commit r327295 since it was causing the Windows bots to fail. llvm-svn: 327346
* [analyzer] Destroy and lifetime-extend inlined function return values properly.Artem Dergachev2018-03-122-29/+214
| | | | | | | | | | | | | | | This patch uses the newly added CFGCXXRecordTypedCall element at the call site of the caller to construct the return value within the callee directly into the caller's stack frame. This way it is also capable of populating the temporary destructor and lifetime extension maps for the temporary, which allows temporary destructors and lifetime extension to work correctly. This patch does not affect temporaries that were returned from conservatively evaluated functions. Differential Revision: https://reviews.llvm.org/D44124 llvm-svn: 327345
* [clangd] Remove Tagged and some related APIs from ClangdServer.Sam McCall2018-03-1214-296/+199
| | | | | | | | | | | | Context can do what Tagged was intended to support (snapshot filesystems), and less intrusively. getTaggedFileSystem() no longer needs a filename. Cleanups while here: - code-complete now returns errors as Expected, like other functions - added an alias Callback<T> for the usual callback function type llvm-svn: 327344
* [CFG] [analyzer] Add construction context to C++ return-by-value call elements.Artem Dergachev2018-03-126-74/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new CFGStmt sub-class, CFGCXXRecordTypedCall, which replaces the regular CFGStmt for the respective CallExpr whenever the CFG has additional information to provide regarding the lifetime of the returned value. This additional call site information is represented by a ConstructionContext (which was previously used for CFGConstructor elements) that provides references to CXXBindTemporaryExpr and MaterializeTemporaryExpr that surround the call. This corresponds to the common C++ calling convention solution of providing the target address for constructing the return value as an auxiliary implicit argument during function call. One of the use cases for such extra context at the call site would be to perform any sort of inter-procedural analysis over the CFG that involves functions returning objects by value. In this case the elidable constructor at the return site would construct the object explained by the context at the call site, and its lifetime would also be managed by the caller, not the callee. The extra context would also be useful for properly handling the return-value temporary at the call site, even if the callee is not being analyzed inter-procedurally. Differential Revision: https://reviews.llvm.org/D44120 llvm-svn: 327343
* [InstCombine] add test to show fmul transform creates extra fdiv; NFCSanjay Patel2018-03-122-88/+107
| | | | | | Also, move fmul reassociation tests to the same file as other fmul transforms. llvm-svn: 327342
* [llvm-readobj] Extend the output of -elf-section-groupsAlexander Shaposhnikov2018-03-123-1/+20
| | | | | | | | | | | | | | This diff extends the output of -elf-section-groups (llvm style, gnu style is unchanged since it's meant to be compatible with binutils readelf) with sh_link and sh_info. This change will enable us to use llvm-readobj -elf-section-groups for testing llvm-objcopy's support for .group sections. Test plan: make check-all Differential revision: https://reviews.llvm.org/D44280 llvm-svn: 327341
* BlockExtractor: Don’t delete functions directlyVolkan Keles2018-03-123-3/+18
| | | | | | | Blocks may have function calls, so don’t erase functions directly to avoid erasing a function that has a user. llvm-svn: 327340
* [PatternMatch] enhance m_NaN() to ignore undef elements in vectorsSanjay Patel2018-03-122-15/+10
| | | | llvm-svn: 327339
* [Sanitizers] Add more standard compliant posix_memalign implementation for LSan.Alex Shlyapnikov2018-03-127-9/+36
| | | | | | | | | | | | | | | Summary: Add more standard compliant posix_memalign implementation for LSan and use corresponding sanitizer's posix_memalign implenetations in allocation wrappers on Mac. Reviewers: eugenis, fjricci Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44335 llvm-svn: 327338
* [asan] poison_heap=0 should not disable __asan_handle_no_return.Evgeniy Stepanov2018-03-123-2/+15
| | | | | | | | | | Reviewers: kcc, alekseyshl, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44339 llvm-svn: 327337
* ObjCARC: teach the cloner about funcletsSaleem Abdulrasool2018-03-122-1/+148
| | | | | | | | | | | | | | In the case that the CallInst that is being moved has an associated operand bundle which is a funclet, the move will construct an invalid instruction. The new site will have a different token and needs to be reassociated with the new instruction. Unfortunately, there is no way to alter the bundle after the construction of the instruction. Replace the call instruction cloning with a custom helper to clone the instruction and reassociate the funclet token. llvm-svn: 327336
* [InstSimplify] add fcmp tests for constant NaN vector with undef elt; NFCSanjay Patel2018-03-121-1/+19
| | | | llvm-svn: 327335
* Re-land "[Sema] Make getCurFunction() return null outside function parsing"Reid Kleckner2018-03-1210-101/+116
| | | | | | | | | | | | | | This relands r326965. There was a null dereference in typo correction that was triggered in Sema/diagnose_if.c. We are not always in a function scope when doing typo correction. The fix is to add a null check. LLVM's optimizer made it hard to find this bug. I wrote it up in a not-very-well-editted blog post here: http://qinsb.blogspot.com/2018/03/ub-will-delete-your-null-checks.html llvm-svn: 327334
* [docs] Adding clang-doc to CTE toctree to fix docs build errorJulie Hockett2018-03-122-0/+4
| | | | llvm-svn: 327333
* [X86][Btver2] Clean up formatting/comments in scheduler model. NFCI.Simon Pilgrim2018-03-121-11/+18
| | | | | | Moved 'special cases' to be closer to other system classes. llvm-svn: 327332
* Re-add change for https://reviews.llvm.org/D42582 with added directories.Jim Ingham2018-03-1214-3/+281
| | | | llvm-svn: 327331
* Introduce a setting to disable Spotlight while running the test suiteAdrian Prantl2018-03-126-4/+31
| | | | | | | | | | | This is a more principled approach to disabling Spotlight .dSYM lookups while running the testsuite, most importantly it also works for the LIT-based tests, which I overlooked in my initial fix (renaming the test build dir to lldb-tests.noindex). Differential Revision: https://reviews.llvm.org/D44342 llvm-svn: 327330
* Remove the LoopInstSimplify pass (-loop-instsimplify)Vedant Kumar2018-03-1210-273/+5
| | | | | | | | | | | | LoopInstSimplify is unused and untested. Reading through the commit history the pass also seems to have a high maintenance burden. It would be best to retire the pass for now. It should be easy to recover if we need something similar in the future. Differential Revision: https://reviews.llvm.org/D44053 llvm-svn: 327329
* Improve caching scheme in ProvenanceAnalysis.Michael Zolotukhin2018-03-123-8/+20
| | | | | | | | | | | | | | | | | | | | | | Summary: ProvenanceAnalysis::related(A, B) currently memoizes its results, and on big tests the cache grows too large, and we're spending most of the time growing/looking through DenseMap. This patch reduces the size of the cache by normalizing keys first: we do that by calling GetUnderlyingObjCPtr on the input values. The results of GetUnderlyingObjCPtr are also memoized in a separate cache. The patch doesn't bring noticable changes to compile time on CTMark, however significantly helps one of our internal tests. Reviewers: gottesmm Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D44270 llvm-svn: 327328
* Revert "Improve prologue handling to support functions with multiple entry ↵Vedant Kumar2018-03-129-82/+3
| | | | | | | | | | | | | | | points." This reverts commit r327318. It breaks the Xcode and CMake Darwin builders: clang: error: no such file or directory: '.../source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp' clang: error: no input files More details are in https://reviews.llvm.org/D42582. llvm-svn: 327327
* [WebAssembly] Refactor to avoid conflating global and fucntion index space. NFCSam Clegg2018-03-127-88/+96
| | | | | | Differential Revision: https://reviews.llvm.org/D44358 llvm-svn: 327326
* [WebAssembly] Verify contents of relocation target before writing itSam Clegg2018-03-123-0/+61
| | | | | | | | | | | | Verify that the location where a relocation is about the be applied contains the expected existing value. This is essentially a sanity check to catch bugs in the compiler and the linker. Differential Revision: https://reviews.llvm.org/D44349 llvm-svn: 327325
* nan: ImplementJan Vesely2018-03-126-0/+52
| | | | | | | | Passes CTS on carrizo and turks Reviewer: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327324
* travis: Add build using llvm-6Jan Vesely2018-03-121-0/+22
| | | | | | Acked-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327323
* [Tooling] Clear the PreambleSrcLocCache when preamble is discarded during ↵Alex Lorenz2018-03-125-0/+17
| | | | | | | | | | | reparsing This ensures that diagnostics are not remapped to incorrect preamble locations after the second reparse with a remapped header file occurs. rdar://37502480 llvm-svn: 327322
* [scudo] Secondary allocator overhaul to support WindowsKostya Kortchinsky2018-03-122-56/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The need for this change stems from the fact that Windows doesn't support partial unmapping (`MEM_RELEASE` implies the entire allocated region). So we now have to keep track of the reserved region and the committed region, so that we can function without the trimming we did when dealing with larger alignments. Instead of just having a `ReservedAddressRange` per chunk, we introduce a `LargeChunkHeader` (and `LargeChunk` namespace) that additionally holds the committed size and the usable size. The former is needed for stats purposes, the latter is used by the frontend. Requiring both is debatable, we could only work with the usable size but then be off by up to a page per chunk when dealing with stats. Additionally, we introduce more stats since they turned out to be useful for experiments, and a `PrintStats` function that will be used by the combined allocator in later patch. Reviewers: alekseyshl, flowerhack Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43949 llvm-svn: 327321
* [llvm-readobj][ELF] Move ELF note parsing into libObjectScott Linder2018-03-124-47/+254
| | | | | | | | | Clean up the parsing of notes in llvm-readobj, improve bounds checking, and allow the parsing code to be reused. Differential Revision: https://reviews.llvm.org/D43958 llvm-svn: 327320
* [PowerPC][NFC] Explicitly state types on FP SDAG patterns in anticipation of ↵Lei Huang2018-03-123-132/+158
| | | | | | adding the f128 type llvm-svn: 327319
* Improve prologue handling to support functions with multiple entry points.Jim Ingham2018-03-129-3/+82
| | | | | | | | https://reviews.llvm.org/D42582 Patch from Leandro Lupori. llvm-svn: 327318
* Check that ubsan is the only supported sanitizer on OpenBSDVedant Kumar2018-03-121-0/+19
| | | | | | | | Patch by David Carlier! Differential Revision: https://reviews.llvm.org/D44069 llvm-svn: 327317
* [AArch64] Fold adds with tprel_lo12_nc and secrel_lo12 into a following ldr/strMartin Storsjo2018-03-125-25/+28
| | | | | | Differential Revision: https://reviews.llvm.org/D44355 llvm-svn: 327316
* [InstCombine] Replace calls to getNumUses with hasNUses or hasNUsesOrMoreCraig Topper2018-03-122-5/+5
| | | | | | | | | | getNumUses is a linear time operation. It traverses the user linked list to the end and counts as it goes. Since we are only interested in small constant counts, we should use hasNUses or hasNUsesMore more that terminate the traversal as soon as it can provide the answer. There are still two other locations in InstCombine, but changing those would force a rebase of D44266 which if accepted would remove them. Differential Revision: https://reviews.llvm.org/D44398 llvm-svn: 327315
* [CallSiteSplitting] Use !Instruction::use_empty instead of checking for a ↵Craig Topper2018-03-121-1/+1
| | | | | | | | non-zero return from getNumUses getNumUses is a linear operation. It walks a linked list to get a count. So in this case its better to just ask if there are any users rather than how many. llvm-svn: 327314
* [Driver] Add text description of --help-hidden so it is shown in helpJan Korous2018-03-121-1/+2
| | | | llvm-svn: 327313
* [NFC] Replace iterators in PrintHelp with range-based forJan Korous2018-03-121-6/+4
| | | | llvm-svn: 327312
* [NFC] PrintHelp cleanupJan Korous2018-03-121-3/+1
| | | | llvm-svn: 327311
* [Hexagon] Fix typo in testcaseKrzysztof Parzyszek2018-03-121-1/+1
| | | | llvm-svn: 327310
* [analyzer] Move the GCDAsyncSemaphoreChecker to optin.performanceGeorge Karpenkov2018-03-124-43/+82
| | | | | | | | rdar://38383753 Differential Revision: https://reviews.llvm.org/D44228 llvm-svn: 327309
OpenPOWER on IntegriCloud