summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
Commit message (Collapse)AuthorAgeFilesLines
* [ConstantRange] Add umin/smin operatorsPhilip Reames2016-02-261-0/+39
| | | | | | | | This was split off from http://reviews.llvm.org/D17184. Reviewed by: Sanjoy llvm-svn: 262080
* [PM] Introduce CRTP mixin base classes to help define passes andChandler Carruth2016-02-261-36/+7
| | | | | | | | | | | | | | | | | analyses in the new pass manager. These just handle really basic stuff: turning a type name into a string statically that is nice to print in logs, and getting a static unique ID for each analysis. Sadly, the format of passes in anonymous namespaces makes using their names in tests really annoying so I've customized the names of the no-op passes to keep tests sane to read. This is the first of a few simplifying refactorings for the new pass manager that should reduce boilerplate and confusion. llvm-svn: 262004
* [LoopUnrollAnalyzer] Check that we're using SCEV for the same loop we're ↵Michael Zolotukhin2016-02-261-1/+48
| | | | | | | | | | | | | | simulating. Summary: Check that we're using SCEV for the same loop we're simulating. Otherwise, we might try to use the iteration number of the current loop in SCEV expressions for inner/outer loops IVs, which is clearly incorrect. Reviewers: chandlerc, hfinkel Subscribers: sanjoy, llvm-commits, mzolotukhin Differential Revision: http://reviews.llvm.org/D17632 llvm-svn: 261958
* [UnitTests] UnrollAnalyzer: make unit-test more general so that it can cover ↵Michael Zolotukhin2016-02-261-3/+5
| | | | | | more cases in future. llvm-svn: 261954
* Introduce analysis pass to compute PostDominators in the new pass manager. NFCHongbin Zheng2016-02-251-3/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D17537 llvm-svn: 261902
* Revert "Introduce analysis pass to compute PostDominators in the new pass ↵Hongbin Zheng2016-02-251-4/+3
| | | | | | | | manager. NFC" This reverts commit a3e5cc6a51ab5ad88d1760c63284294a4e34c018. llvm-svn: 261891
* Introduce analysis pass to compute PostDominators in the new pass manager. NFCHongbin Zheng2016-02-251-3/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D17537 llvm-svn: 261882
* PM: Implement a basic loop pass managerJustin Bogner2016-02-252-0/+206
| | | | | | | | | | | This creates the new-style LoopPassManager and wires it up with dummy and print passes. This version doesn't support modifying the loop nest at all. It will be far easier to discuss and evaluate the approaches to that with this in place so that the boilerplate is out of the way. llvm-svn: 261831
* [Support] Add a fancy helper function to get a static name for a type.Chandler Carruth2016-02-252-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | This extracts the type name from __PRETTY_FUNCTION__ for compilers that support it (I've opted Clang, GCC, and ICC into this as I've tested that they work) and from __FUNCSIG__ which is very similar on MSVC. The routine falls back gracefully on a stub "UNKNOWN_TYPE" string with compilers or formats it doesn't understand. This should be enough for a lot of common cases in LLVM where the real goal is just to log or print a type name as a debugging aid, and save a ton of boilerplate in the process. Notably, I'm planning to use this to remove all the getName() boiler plate from the new pass manager. The design and implementation is based on a bunch of advice and discussion with Richard Smith and experimenting with most versions of Clang and GCC. David Majnemer also provided excellent advice on how best to do this with MSVC. Richard also checked that ICC does something reasonable and I'll watch the build bots for other compilers. It'd be great if someone could contribute logic for xlC and/or other toolchains. Differential Revision: http://reviews.llvm.org/D17565 llvm-svn: 261819
* [PM] Remove an overly aggressive assert now that I can actually test theChandler Carruth2016-02-231-0/+32
| | | | | | | | | | | | | | | | | pattern that triggers it. This essentially requires an immutable function analysis, as that will survive anything we do to invalidate it. When we have such patterns, the function analysis manager will not get cleared between runs of the proxy. If we actually need an assert about how things are queried, we can add more elaborate machinery for computing it, but so far I'm not aware of significant value provided. Thanks to Justin Lebar for noticing this when he made a (seemingly innocuous) change to FunctionAttrs that is enough to trigger it in one test there. Now it is covered by a direct test of the pass manager code. llvm-svn: 261627
* [PM] Add a unittest for the CGSCC pass manager in the new pass managerChandler Carruth2016-02-232-0/+288
| | | | | | | | | | | system. Previously, this was only being tested with larger integration tests. That makes it hard to isolated specific issues with it, and makes the APIs themselves less well tested. Add a unittest based around the same patterns used for testing the general pass manager. llvm-svn: 261624
* [ConstantRange] Rename a method and add more docSanjoy Das2016-02-221-5/+5
| | | | | | | | Rename makeNoWrapRegion to a more obvious makeGuaranteedNoWrapRegion, and add a comment about the counter-intuitive aspects of the function. This is to help prevent cases like PR26628. llvm-svn: 261532
* Use EXPECT_EQ in the unittests instead of plain assertTobias Grosser2016-02-221-2/+3
| | | | | | This addresses post-review comments from Duncan P. N. Exon Smith to r261485. llvm-svn: 261514
* ScalarEvolution: Do not keep temporary PHI values in ValueExprMapTobias Grosser2016-02-211-0/+26
| | | | | | | | | | Before this patch simplified SCEV expressions for PHI nodes were only returned the very first time getSCEV() was called, but later calls to getSCEV always returned the non-simplified value, which had "temporarily" been stored in the ValueExprMap, but was never removed and consequently blocked the caching of the simplified PHI expression. llvm-svn: 261485
* [PM/AA] Port alias analysis evaluator to the new pass manager, and useChandler Carruth2016-02-201-0/+1
| | | | | | | | | | | | | | | | it to actually test the new pass manager AA wiring. This patch was extracted from the (somewhat too large) D12357 and rebosed on top of the slightly different design of the new pass manager AA wiring that I just landed. With this we can start testing the AA in a thorough way with the new pass manager. Some minor cleanups to the code in the pass was necessitated here, but otherwise it is a very minimal change. Differential Revision: http://reviews.llvm.org/D17372 llvm-svn: 261403
* Add profile summary support for sample profile.Easwaran Raman2016-02-191-0/+30
| | | | | | Differential Revision: http://reviews.llvm.org/D17178 llvm-svn: 261304
* [ADT] Fix PointerEmbeddedInt when the underlying type is uintptr_t.Jordan Rose2016-02-181-0/+34
| | | | | | ...and when you try to store negative values in it. llvm-svn: 261259
* [DebugInfoPDB] Add source / line number accessors for PDB.Zachary Turner2016-02-181-0/+26
| | | | | | | This patch adds a variety of different methods to query source and line number information from PDB files. llvm-svn: 261239
* [PM/AA] Teach the new pass manager to use pass-by-lambda for registeringChandler Carruth2016-02-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | analysis passes, support pre-registering analyses, and use that to implement parsing and pre-registering a custom alias analysis pipeline. With this its possible to configure the particular alias analysis pipeline used by the AAManager from the commandline of opt. I've updated the test to show this effectively in use to build a pipeline including basic-aa as part of it. My big question for reviewers are around the APIs that are used to expose this functionality. Are folks happy with pass-by-lambda to do pass registration? Are folks happy with pre-registering analyses as a way to inject customized instances of an analysis while still using the registry for the general case? Other thoughts of course welcome. The next round of patches will be to add the rest of the alias analyses into the new pass manager and wire them up here so that they can be used from opt. This will require extending the (somewhate limited) functionality of AAManager w.r.t. module passes. Differential Revision: http://reviews.llvm.org/D17259 llvm-svn: 261197
* Make a stub version of MITests, instead of reverting.NAKAMURA Takumi2016-02-183-0/+14
| | | | | | | Lit tends to find out-of-date unittests in the build tree. FIXME: It may be reverted several days after. llvm-svn: 261194
* Revert "LiveIntervalAnalysis: Remove LiveVariables requirement" and ↵Matthias Braun2016-02-183-321/+0
| | | | | | | | | | | | | | | | | | | LiveIntervalTest The commit breaks stage2 compilation on PowerPC. Reverting for now while this is analyzed. I also have to revert the LiveIntervalTest for now as that depends on this commit. Revert "LiveIntervalAnalysis: Remove LiveVariables requirement" This reverts commit r260806. Revert "Remove an unnecessary std::move to fix -Wpessimizing-move warning." This reverts commit r260931. Revert "Fix typo in LiveIntervalTest" This reverts commit r260907. Revert "Add unittest for LiveIntervalAnalysis::handleMove()" This reverts commit r260905. llvm-svn: 261189
* Add a profile summary class specific to instrumentation profiles.Easwaran Raman2016-02-171-5/+5
| | | | | | | | | Modify ProfileSummary class to make it not instrumented profile specific. Add a new InstrumentedProfileSummary class that inherits from ProfileSummary. Differential Revision: http://reviews.llvm.org/D17310 llvm-svn: 261119
* [LCG] Construct an actual call graph with call-edge SCCs nested insideChandler Carruth2016-02-171-204/+781
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reference-edge SCCs. This essentially builds a more normal call graph as a subgraph of the "reference graph" that was the old model. This allows both to exist and the different use cases to use the aspect which addresses their needs. Specifically, the pass manager and other *ordering* constrained logic can use the reference graph to achieve conservative order of visit, while analyses reasoning about attributes and other properties derived from reachability can reason about the direct call graph. Note that this isn't necessarily complete: it doesn't model edges to declarations or indirect calls. Those can be found by scanning the instructions of the function if desirable, and in fact every user currently does this in order to handle things like calls to instrinsics. If useful, we could consider caching this information in the call graph to save the instruction scans, but currently that doesn't seem to be important. An important realization for why the representation chosen here works is that the call graph is a formal subset of the reference graph and thus both can live within the same data structure. All SCCs of the call graph are necessarily contained within an SCC of the reference graph, etc. The design is to build 'RefSCC's to model SCCs of the reference graph, and then within them more literal SCCs for the call graph. The formation of actual call edge SCCs is not done lazily, unlike reference edge 'RefSCC's. Instead, once a reference SCC is formed, it directly builds the call SCCs within it and stores them in a post-order sequence. This is used to provide a consistent platform for mutation and update of the graph. The post-order also allows for very efficient updates in common cases by bounding the number of nodes (and thus edges) considered. There is considerable common code that I'm still looking for the best way to factor out between the various DFS implementations here. So far, my attempts have made the code harder to read and understand despite reducing the duplication, which seems a poor tradeoff. I've not given up on figuring out the right way to do this, but I wanted to wait until I at least had the system working and tested to continue attempting to factor it differently. This also requires introducing several new algorithms in order to handle all of the incremental update scenarios for the more complex structure involving two edge colorings. I've tried to comment the algorithms sufficiently to make it clear how this is expected to work, but they may still need more extensive documentation. I know that there are some changes which are not strictly necessarily coupled here. The process of developing this started out with a very focused set of changes for the new structure of the graph and algorithms, but subsequent changes to bring the APIs and code into consistent and understandable patterns also ended up touching on other aspects. There was no good way to separate these out without causing *massive* merge conflicts. Ultimately, to a large degree this is a rewrite of most of the core algorithms in the LCG class and so I don't think it really matters much. Many thanks to the careful review by Sanjoy Das! Differential Revision: http://reviews.llvm.org/D16802 llvm-svn: 261040
* Remove an unnecessary std::move to fix -Wpessimizing-move warning.Craig Topper2016-02-161-1/+1
| | | | llvm-svn: 260931
* [ADT] Add StringRef::{l,r}trim(char) overloads (NFC)Vedant Kumar2016-02-161-1/+1
| | | | | | | | | Add support for trimming a single kind of character from a StringRef. This makes the common case of trimming null bytes much neater. It's also probably a bit speedier too, since it avoids creating a std::bitset in find_{first,last}_not_of. llvm-svn: 260925
* Kill LLVMAddTargetDataAmaury Sechet2016-02-161-3/+0
| | | | | | | | | | | | Summary: It's red, it's dead. Reviewers: joker.eph, Wallbraker, echristo Subscribers: llvm-commits, axw Differential Revision: http://reviews.llvm.org/D17282 llvm-svn: 260919
* MITests: Update libdeps. llvm/Target/TargetOptions.h depends on MC.NAKAMURA Takumi2016-02-161-0/+1
| | | | llvm-svn: 260918
* unittests/MI: Add Core library referenceMatthias Braun2016-02-151-0/+1
| | | | llvm-svn: 260915
* Fix typo in LiveIntervalTestMatthias Braun2016-02-151-1/+1
| | | | llvm-svn: 260907
* Add unittest for LiveIntervalAnalysis::handleMove()Matthias Braun2016-02-153-0/+319
| | | | llvm-svn: 260905
* [Cloning] Clone every Function's Debug InfoKeno Fischer2016-02-131-0/+25
| | | | | | | | | | | | | | | | | | | | | | | Summary: Export the CloneDebugInfoMetadata utility, which clones all debug info associated with a function into the first module. Also use this function in CloneModule on each function we clone (the CloneFunction entrypoint already does this). Without this, cloning a module will lead to DI quality regressions, especially since r252219 reversed the Function <-> DISubprogram edge (before we could get lucky and have this edge preserved if the DISubprogram itself was, e.g. due to location metadata). This was verified to fix missing debug information in julia and a unittest to verify the new behavior is included. Patch by Yichao Yu! Thanks! Reviewers: loladiro, pcc Differential Revision: http://reviews.llvm.org/D17165 llvm-svn: 260791
* Add AMDGPU related triple vendors/OSesMatt Arsenault2016-02-131-0/+12
| | | | | | | | As support expands to more runtimes, we'll need to distinguish between more than just HSA and unknown. This also lets us stop using unknown everywhere. llvm-svn: 260790
* [PGO] Add another interface for annotateValueSiteRong Xu2016-02-121-0/+20
| | | | | | | | | Add another interface to function annotateValueSite() which directly uses the VauleData array. Differential Revision: http://reviews.llvm.org/D17108 llvm-svn: 260741
* [ADT] Revert the llvm/ADT/OptionSet.h header and unit test.Argyrios Kyrtzidis2016-02-122-116/+0
| | | | llvm-svn: 260714
* Delete the deprecated LLVMLinkModules.Rafael Espindola2016-02-121-24/+0
| | | | llvm-svn: 260683
* [unittests/ADT] OptionSetTest: ifdef out for now a specific test that fails ↵Argyrios Kyrtzidis2016-02-121-0/+4
| | | | | | on MSVC. llvm-svn: 260663
* [unittests/ADT] OptionSetTest: ifdef out a part that fails to compile on MSVC.Argyrios Kyrtzidis2016-02-121-0/+3
| | | | llvm-svn: 260655
* [ADT] Introduce ‘OptionSet’ in llvm/ADT headers, which is a utility ↵Argyrios Kyrtzidis2016-02-122-0/+109
| | | | | | class that makes it convenient to work with enumerators representing bit options. llvm-svn: 260652
* ARMv7k: use Cortex-A7 by default even for tvOSTim Northover2016-02-111-0/+12
| | | | | | Also actually test the default CPU from those triples. llvm-svn: 260621
* [lanai] Add Lanai triple.Jacques Pienaar2016-02-111-0/+21
| | | | | | | | | | Add triple for the Lanai backend. General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend". Differential Revision: http://reviews.llvm.org/D17003 llvm-svn: 260545
* [PGO] Make the number of records for each value site metada adjustableRong Xu2016-02-101-10/+31
| | | | | | | | | | The patch adds a parameter in annotateValueSite() to control the max number of records written to the value profile meta data for each value site. The default is kept as the current value of 3. Differential Revision: http://reviews.llvm.org/D17084 llvm-svn: 260450
* Fix a -Wsign-compare in Support Path unittestsReid Kleckner2016-02-101-1/+1
| | | | llvm-svn: 260418
* Silence some MSVC warnings about zero extending unsigned to void*Reid Kleckner2016-02-101-4/+4
| | | | llvm-svn: 260413
* [PGO] fix prof symbol lookup bugXinliang David Li2016-02-101-0/+6
| | | | | | | | | | | | Patch by Rong Xu The problem is exposed by intra-module indirect call promotion where prof symtab is created from module which does not contain all symbols from the program. With partial symtab, the result needs to be checked more strictly. llvm-svn: 260361
* [Orc] Add lazy-JITting support for i386.Lang Hames2016-02-101-1/+3
| | | | | | | | | | | This patch adds a new class, OrcI386, which contains the hooks needed to support lazy-JITing on i386 (currently only for Pentium 2 or above, as the JIT re-entry code uses the FXSAVE/FXRSTOR instructions). Support for i386 is enabled in the LLI lazy JIT and the Orc C API, and regression and unit tests are enabled for this architecture. llvm-svn: 260338
* WholeProgramDevirt: introduce.Peter Collingbourne2016-02-092-0/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This pass implements whole program optimization of virtual calls in cases where we know (via bitset information) that the list of callees is fixed. This includes the following: - Single implementation devirtualization: if a virtual call has a single possible callee, replace all calls with a direct call to that callee. - Virtual constant propagation: if the virtual function's return type is an integer <=64 bits and all possible callees are readnone, for each class and each list of constant arguments: evaluate the function, store the return value alongside the virtual table, and rewrite each virtual call as a load from the virtual table. - Uniform return value optimization: if the conditions for virtual constant propagation hold and each function returns the same constant value, replace each virtual call with that constant. - Unique return value optimization for i1 return values: if the conditions for virtual constant propagation hold and a single vtable's function returns 0, or a single vtable's function returns 1, replace each virtual call with a comparison of the vptr against that vtable's address. Differential Revision: http://reviews.llvm.org/D16795 llvm-svn: 260312
* Add comments to some testsXinliang David Li2016-02-091-0/+4
| | | | llvm-svn: 260200
* Further reduce test overheadXinliang David Li2016-02-091-8/+4
| | | | llvm-svn: 260198
* Use std::forward to make ErrorOr<T> constructible from a value that has a ↵Nick Lewycky2016-02-091-1/+41
| | | | | | user-defined conversion to T. No functionality change intended. llvm-svn: 260196
* Remove TrailingObjects::operator delete. It's still suffering fromRichard Smith2016-02-091-2/+2
| | | | | | | | | compiler-specific issues. Instead, repeat an 'operator delete' definition in each derived class that is actually deleted, and give up on the static type safety of an error when sized delete is accidentally used on a type derived from TrailingObjects. llvm-svn: 260190
OpenPOWER on IntegriCloud