summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/CodeExtractor
Commit message (Collapse)AuthorAgeFilesLines
* [CodeExtractor] Allow extracting blocks with exception handlingSergey Dmitriev2018-05-112-0/+108
| | | | | | | | | | | | | | | | | This is a CodeExtractor improvement which adds support for extracting blocks which have exception handling constructs if that is legal to do. CodeExtractor performs validation checks to ensure that extraction is legal when it finds invoke instructions or EH pads (landingpad, catchswitch, or cleanuppad) in blocks to be extracted. I have also added an option to allow extraction of blocks with alloca instructions, but no validation is done for allocas. CodeExtractor caller has to validate it himself before allowing alloca instructions to be extracted. By default allocas are still not allowed in extraction blocks. Differential Revision: https://reviews.llvm.org/D45904 llvm-svn: 332151
* [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.Shiva Chen2018-05-093-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
* [PartialInlining] Fix Crash from holding a reference to a destructed ORE.Sean Fertile2018-04-201-0/+170
| | | | | | | | | | | | | The callback used to create an ORE for the legacy PI pass caches the allocated object in a unique_ptr in the runOnModule function, and returns a reference to that object. Under certian circumstances we can end up holding onto that reference after the OREs destruction. Rather then allowing the new and legacy passes to create ORE object in diffrent ways, create the ORE at the point of use. Differential Revision: https://reviews.llvm.org/D43219 llvm-svn: 330473
* [PartialInlining] Use isInlineViable to detect constructs preventing inlining.Florian Hahn2018-03-101-0/+63
| | | | | | | | | | | | | Use isInlineViable to prevent inlining of functions with non-inlinable constructs, in case cost analysis is skipped. Reviewers: efriedma, sfertile, davide, davidxl Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D42846 llvm-svn: 327207
* [PartialInliner] Update test (NFC).Florian Hahn2018-02-041-4/+5
| | | | llvm-svn: 324199
* [InlineFunction] Set arg attrs even if there only are VarArg attrs.Florian Hahn2018-02-041-0/+23
| | | | | | | | | | | | When using the partial inliner, we might have attributes for forwarded varargs, but the CodeExtractor does not create an empty argument attribute set for regular arguments in that case, because it does not know of the additional arguments. So in case we have attributes for VarArgs, we also have to make sure we create (empty) attributes for all regular arguments. This fixes PR36210. llvm-svn: 324197
* [CodeExtractor] Use subset of function attributes for extracted function.Florian Hahn2018-01-071-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | In addition to target-dependent attributes, we can also preserve a white-listed subset of target independent function attributes. The white-list excludes problematic attributes, most prominently: * attributes related to memory accesses, as alloca instructions could be moved in/out of the extracted block * control-flow dependent attributes, like no_return or thunk, as the relerelevant instructions might or might not get extracted. Thanks @efriedma and @aemerson for providing a set of attributes that cannot be propagated. Reviewers: efriedma, davidxl, davide, silvas Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D41334 llvm-svn: 321961
* [InlineFunction] Set debug loc for call to forward varargs.Florian Hahn2017-12-091-0/+67
| | | | | | | | | | | | Reviewers: aprantl, dblaikie, rnk Reviewed By: rnk Subscribers: eraman, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D40432 llvm-svn: 320252
* [CodeExtractor] Add debug locations for new call and branch instrs.Florian Hahn2017-12-081-0/+104
| | | | | | | | | | | | | | | | | | | | | | | Summary: If a partially inlined function has debug info, we have to add debug locations to the call instruction calling the outlined function. We use the debug location of the first instruction in the outlined function, as the introduced call transfers control to this statement and there is no other equivalent line in the source code. We also use the same debug location for the branch instruction added to jump from artificial entry block for the outlined function, which just jumps to the first actual basic block of the outlined function. Reviewers: davide, aprantl, rriddle, dblaikie, danielcdh, wmi Reviewed By: aprantl, rriddle, danielcdh Subscribers: eraman, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D40413 llvm-svn: 320199
* - Removed unused lamba (IsReturnBlock) causing build bots to fail for r319398Graham Yiu2017-11-302-0/+289
| | | | | | - Added lit testcases that were supposed to be part of r319398 llvm-svn: 319399
* [PartialInliner] Inline vararg functions that forward varargs.Florian Hahn2017-11-131-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch extends the partial inliner to support inlining parts of vararg functions, if the vararg handling is done in the outlined part. It adds a `ForwardVarArgsTo` argument to InlineFunction. If it is non-null, all varargs passed to the inlined function will be added to all calls to `ForwardVarArgsTo`. The partial inliner takes care to only pass `ForwardVarArgsTo` if the varargs handing is done in the outlined function. It checks that vastart is not part of the function to be inlined. `test/Transforms/CodeExtractor/PartialInlineNoInline.ll` (already part of the repo) checks we do not do partial inlining if vastart is used in a basic block that will be inlined. Reviewers: davide, davidxl, grosser Reviewed By: davide, davidxl, grosser Subscribers: gyiu, grosser, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D39607 llvm-svn: 318028
* [PartialInliner] Skip call sites where inlining fails.Florian Hahn2017-11-031-0/+45
| | | | | | | | | | | | | | | | | | Summary: InlineFunction can fail, for example when trying to inline vararg fuctions. In those cases, we do not want to bump partial inlining counters or set AnyInlined to true, because this could leave an unused function hanging around. Reviewers: davidxl, davide, gyiu Reviewed By: davide Subscribers: llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D39581 llvm-svn: 317314
* [CodeExtractor] Fix iterator invalidation in findOrCreateBlockForHoisting.Florian Hahn2017-11-011-1/+5
| | | | | | | | | | | | | | | | | | | Summary: By replacing branches to CommonExitBlock, we remove the node from CommonExitBlock's predecessors, invalidating the iterator. The problem is exposed when the common exit block has multiple predecessors and needs to sink lifetime info. The modification in the test case trigger the issue. Reviewers: davidxl, davide, wmi Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39112 llvm-svn: 317084
* Clean up a test caseXinliang David Li2017-06-271-34/+41
| | | | llvm-svn: 306468
* [CodeExtractor] Prevent extraction of block involving blockaddressSerge Guelton2017-06-272-0/+79
| | | | | | | | | BlockAddress are only valid within their function context, which does not interact well with CodeExtractor. Detect this case and prevent it. Differential Revision: https://reviews.llvm.org/D33839 llvm-svn: 306448
* [PartialInlining] Support shrinkwrap life_range markersXinliang David Li2017-06-115-0/+359
| | | | | | Differential Revision: http://reviews.llvm.org/D33847 llvm-svn: 305170
* [PartialInlining] Minor cost anaysis tuningXinliang David Li2017-06-022-0/+105
| | | | | | Also added a test option and 2 cost analysis related tests. llvm-svn: 304599
* [PartialInlining] Reduce outlining overhead by removing unneeded live-out(s)Xinliang David Li2017-06-012-0/+123
| | | | | | Differential Revision: http://reviews.llvm.org/D33694 llvm-svn: 304375
* [PartialInlining] Shrinkwrap allocas with live range contained in outline ↵Xinliang David Li2017-05-304-0/+267
| | | | | | | | region. Differential Revision: http://reviews.llvm.org/D33618 llvm-svn: 304245
* [PartialInlining] Profile based cost analysisXinliang David Li2017-05-129-12/+160
| | | | | | | | | | | | Implemented frequency based cost/saving analysis and related options. The pass is now in a state ready to be turne on in the pipeline (in follow up). Differential Revision: http://reviews.llvm.org/D32783 llvm-svn: 302967
* Cleanup tests to not share a DISubprogram between multiple Functions.Adrian Prantl2017-05-041-24/+30
| | | | | | rdar://problem/31926379 llvm-svn: 302166
* [PartialInlining] Add more early filteringXinliang David Li2017-05-021-0/+19
| | | | | | | This is a follow up to the previous inline cost patch for quicker filtering. llvm-svn: 301959
* [PartialInlining] Hook up inline cost analysisXinliang David Li2017-05-022-3/+43
| | | | | | Differential Revision: http://reviews.llvm.org/D32666 llvm-svn: 301894
* [PartialInlining]: Improve partial inlining to handle complex conditionsXinliang David Li2017-04-277-7/+315
| | | | | | Differential Revision: http://reviews.llvm.org/D32249 llvm-svn: 301561
* [PartialInine]: add triaging optionsXinliang David Li2017-04-231-0/+73
| | | | | | | There are more bugs (runtime failures) triggered when partial inlining is turned on. Add options to help triaging problems. llvm-svn: 301148
* [PartialInliner] Partial inliner needs to check use kind before transformationXinliang David Li2017-04-211-0/+56
| | | | | | Differential Revision: https://reviews.llvm.org/D32373 llvm-svn: 301042
* [PartialInliner] Fix crash when inlining functions with unreachable blocks.Davide Italiano2017-04-211-0/+38
| | | | | | | | | | | | | | | | CodeExtractor looks up the dominator node corresponding to return blocks when splitting them. If one of these blocks is unreachable, there's no node in the Dom and CodeExtractor crashes because it doesn't check for domtree node validity. In theory, we could add just a check for skipping null DTNodes in `splitReturnBlock` but the fix I propose here is slightly different. To the best of my knowledge, unreachable blocks are irrelevant for the algorithm, therefore we can just skip them when building the candidate set in the constructor. Differential Revision: https://reviews.llvm.org/D32335 llvm-svn: 300946
* CodeExtractor : Add ability to preserve profile data.Sean Silva2016-08-022-0/+67
| | | | | | | | | | | Added ability to estimate the entry count of the extracted function and the branch probabilities of the exit branches. Patch by River Riddle! Differential Revision: https://reviews.llvm.org/D22744 llvm-svn: 277411
* Revert r277313 and r277314.Sean Silva2016-08-012-67/+0
| | | | | | | | | | | | | | | They seem to trigger an LSan failure: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15140/steps/check-llvm%20asan/logs/stdio Revert "Add the tests for r277313" This reverts commit r277314. Revert "CodeExtractor : Add ability to preserve profile data." This reverts commit r277313. llvm-svn: 277317
* Move this test to x86-specific directory.Sean Silva2016-08-012-0/+3
| | | | | | | | | No bots have yelled yet, but this test references an x86 intrinsic. Also, it invokes llc on x86 IR. Fixup to r277315. llvm-svn: 277316
* Fix - CodeExtractor : Inherit Target Dependent Attributes from the parent ↵Sean Silva2016-08-011-0/+40
| | | | | | | | | | | | | | | | | | | function. When extracting a set of blocks make sure to inherit all of the target dependent attributes to make sure that the function will be valid for lowering. One example is the "target-features" attribute for x86, if the extracted region has functionality that relies on a specific feature it will fail to be lowered. This also allows for extracted functions to be valid for inlining, at least back into the parent function, as the target attributes are tested when inlining for compatibility. Patch by River Riddle! Differential Revision: https://reviews.llvm.org/D22713 llvm-svn: 277315
* Add the tests for r277313Sean Silva2016-08-012-0/+67
| | | | | | Forgot to `git add` them. llvm-svn: 277314
* Move the personality function from LandingPadInst to FunctionDavid Majnemer2015-06-172-4/+4
| | | | | | | | | | | | | | | | | | | The personality routine currently lives in the LandingPadInst. This isn't desirable because: - All LandingPadInsts in the same function must have the same personality routine. This means that each LandingPadInst beyond the first has an operand which produces no additional information. - There is ongoing work to introduce EH IR constructs other than LandingPadInst. Moving the personality routine off of any one particular Instruction and onto the parent function seems a lot better than have N different places a personality function can sneak onto an exceptional function. Differential Revision: http://reviews.llvm.org/D10429 llvm-svn: 239940
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | load instruction Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 llvm-svn: 230794
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-1/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-3/+1
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* Update this test to the new EH model.Bill Wendling2011-09-201-0/+4
| | | | | | | Though I think it may be obsolete with the loop extract changes. And I couldn't get the old version of LLVM to compile so that I could reduce this testcase. llvm-svn: 140197
* Update to new EH model.Bill Wendling2011-09-201-1/+4
| | | | llvm-svn: 140177
* Revert r140083 and r140084 until buildbots can be fixed.Bill Wendling2011-09-191-4/+1
| | | | llvm-svn: 140094
* Update test to remove the 'unwind' instruction.Bill Wendling2011-09-191-1/+4
| | | | llvm-svn: 140084
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-171-20/+0
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-119-9/+9
| | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. llvm-svn: 81537
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-089-9/+9
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-201-1/+1
| | | | llvm-svn: 51349
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-201-1/+1
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. llvm-svn: 51328
* Remove llvm-upgrade and update test cases.Tanya Lattner2008-03-019-238/+239
| | | | llvm-svn: 47793
* Convert .cvsignore filesJohn Criswell2007-06-291-3/+0
| | | | llvm-svn: 37801
* For PR1319:Reid Spencer2007-04-151-2/+2
| | | | | | Upgrade to use new Tcl exec based test harness llvm-svn: 36055
* Make the llvm-runtest function much more amenable by eliminating all theReid Spencer2007-04-111-1/+1
| | | | | | | | global variables that needed to be passed in. This makes it possible to add new global variables with only a couple changes (Makefile and llvm-dg.exp) instead of touching every single dg.exp file. llvm-svn: 35918
* Regression is gone, don't try to find it on clean target.Reid Spencer2007-01-1711-0/+466
llvm-svn: 33296
OpenPOWER on IntegriCloud