summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert 258486 -- for a better fix coming soonXinliang David Li2016-01-221-60/+55
| | | | llvm-svn: 258538
* Add ArrayRef support to EndianStream.Rafael Espindola2016-01-221-0/+30
| | | | | | | | | | Using an array instead of ArrayRef would allow type inference, but (short of using C99) one would still need to write typedef uint16_t VT[]; LE.write(VT{0x1234, 0x5678}); llvm-svn: 258535
* [PGO] add an interface needed by icall promotionXinliang David Li2016-01-221-1/+3
| | | | llvm-svn: 258509
* [PGO] eliminate use of static variableXinliang David Li2016-01-221-55/+60
| | | | llvm-svn: 258486
* [Orc] Try to turn Orc execution unit tests back on for Linux.Lang Hames2016-01-201-1/+1
| | | | | | | The fix in r258324 (plus r258354) should allow Orc execution tests to run on Linux. llvm-svn: 258358
* Fix a bug in testXinliang David Li2016-01-201-2/+2
| | | | llvm-svn: 258276
* [PGO] Add a new interface to be used by Indirect Call PromotionXinliang David Li2016-01-201-0/+36
| | | | llvm-svn: 258271
* [Orc] Refactor ObjectLinkingLayer::addObjectSet to defer loading objects untilLang Hames2016-01-191-0/+72
| | | | | | | | | | | | | | | | they're needed. Prior to this patch objects were loaded (via RuntimeDyld::loadObject) when they were added to the ObjectLinkingLayer, but were not relocated and finalized until a symbol address was requested. In the interim, another object could be loaded and finalized with the same memory manager, causing relocation/finalization of the first object to fail (as the first finalization call may have marked the allocated memory for the first object read-only). By deferring the loadObject call (and subsequent memory allocations) until an object file is needed we can avoid prematurely finalizing memory. llvm-svn: 258185
* [Orc] Revert r258031 - it broke the builders.Lang Hames2016-01-181-1/+1
| | | | llvm-svn: 258034
* [Orc] Expand a comment explaining a unit test.Lang Hames2016-01-181-0/+5
| | | | llvm-svn: 258032
* [Orc] Enable ORC execution unit tests on non-windows platforms.Lang Hames2016-01-181-1/+1
| | | | | | | | | | | Previously these were Darwin-only. Since the switch to direct binary emission of stubs, trampolines and resolver blocks, these should work on other *nix platforms too. These tests can be enabled on Windows once known issues with ORC's handling of Windows symbol mangling (see e.g. https://llvm.org/PR25940) have been fixed. llvm-svn: 258031
* [InstructionsTest] delete via unique_ptr (NFC)Joseph Tremoulet2016-01-151-10/+6
| | | | | | | | | | | | | | Summary: Simplify the memory management of mock IR in test AlterInvokeBundles. Reviewers: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16211 llvm-svn: 257892
* [Verifier] Check parentage of GVs in dbg metadataKeno Fischer2016-01-141-1/+23
| | | | | | | | | | | | | | | Summary: Before this the Verifier didn't complain if the GlobalVariable referenced from a DIGlobalVariable was not in fact in the correct module (it would crash while writing bitcode though). Fix this by always checking parantage of GlobalValues while walking constant expressions and changing the DIGlobalVariable visitor to also visit the constant it contains. Reviewers: rafael Differential Revision: http://reviews.llvm.org/D16059 llvm-svn: 257825
* [Verifier] Verify that a GlobalValue is only used in this ModuleKeno Fischer2016-01-141-2/+16
| | | | | | | | | | | | | Summary: We already have the inverse verification that we only use globals that are defined in this module. This essentially catches the same mistake, but when verifying the module that contains the definition. Reviewers: rafael Differential Revision: http://reviews.llvm.org/D15272 llvm-svn: 257823
* Update to use new name alignTo().Rui Ueyama2016-01-142-15/+14
| | | | llvm-svn: 257804
* InstructionsTest.cpp: Fix a warning. [-Wsign-compare]NAKAMURA Takumi2016-01-141-1/+1
| | | | llvm-svn: 257752
* [UnitTest] Fix warning, NFC.Joseph Tremoulet2016-01-141-1/+1
| | | | | | Use an unsigned literal to avoid signedness mismatch in the compare. llvm-svn: 257747
* [OperandBundles] Copy DebugLoc with calls/invokesJoseph Tremoulet2016-01-141-2/+61
| | | | | | | | | | | | | | | | | Summary: The overloads of CallInst::Create and InvokeInst::Create that are used to adjust operand bundles purport to create a new instruction "identical in every way except [for] the operand bundles", so copy the DebugLoc along with everything else. Reviewers: sanjoy, majnemer Subscribers: majnemer, dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D16157 llvm-svn: 257745
* Fix PointerIntPair so that it can use an enum class as its integer template ↵Michael Gottesman2016-01-131-0/+27
| | | | | | | | | | | | | | | | | | | | argument. Summary: The problem here is that an enum class can not be implicitly converted to an integer. That assumption snuck back into PointerIntPair. This commit fixes the issue and more importantly adds some unittests to make sure that we do not break this again. rdar://23594806 Reviewers: gribozavr Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16131 llvm-svn: 257574
* [Support] Add saturating multiply-add support functionNathan Slingerland2016-01-121-0/+54
| | | | | | | | | | | | Summary: Add SaturatingMultiplyAdd convenience function template since A + (X * Y) comes up frequently when doing weighted arithmetic. Reviewers: davidxl, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15385 llvm-svn: 257532
* function names start with a lower case letter ; NFCSanjay Patel2016-01-121-8/+8
| | | | llvm-svn: 257496
* [Orc] Add support for remote JITing to the ORC API.Lang Hames2016-01-112-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds utilities to ORC for managing a remote JIT target. It consists of: 1. A very primitive RPC system for making calls over a byte-stream. See RPCChannel.h, RPCUtils.h. 2. An RPC API defined in the above system for managing memory, looking up symbols, creating stubs, etc. on a remote target. See OrcRemoteTargetRPCAPI.h. 3. An interface for creating high-level JIT components (memory managers, callback managers, stub managers, etc.) that operate over the RPC API. See OrcRemoteTargetClient.h. 4. A helper class for building servers that can handle the RPC calls. See OrcRemoteTargetServer.h. The system is designed to work neatly with the existing ORC components and functionality. In particular, the ORC callback API (and consequently the CompileOnDemandLayer) is supported, enabling lazy compilation of remote code. Assuming this doesn't trigger any builder failures, a follow-up patch will be committed which tests these utilities by using them to replace LLI's existing remote-JITing demo code. llvm-svn: 257305
* [RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method ofLang Hames2016-01-101-2/+3
| | | | | | | | | | | | | | RuntimeDyld::MemoryManager. The RuntimeDyld::MemoryManager::reserveAllocationSpace method is called when object files are loaded, and gives clients a chance to pre-allocate memory for all segments. Previously only the size of each segment (code, ro-data, rw-data) was supplied but not the alignment. This hasn't caused any problems so far, as most clients allocate via the MemoryBlock interface which returns page-aligned blocks. Adding alignment arguments enables finer grained allocation while still satisfying alignment restrictions. llvm-svn: 257294
* OrcJITTests//ObjectLinkingLayerTest.cpp: Appease msc18's C2327. It seems ↵NAKAMURA Takumi2016-01-101-9/+9
| | | | | | | | | | | definition of nested class would confuse the context. llvm\unittests\ExecutionEngine\Orc\ObjectLinkingLayerTest.cpp(115) : error C2327: 'llvm::OrcExecutionTest::TM' : is not a type name, static, or enumerator llvm\unittests\ExecutionEngine\Orc\ObjectLinkingLayerTest.cpp(115) : error C2065: 'TM' : undeclared identifier FYI, "this->TM" was valid even before moving class SectionMemoryManagerWrapper. llvm-svn: 257290
* [ADT] Add an abstraction for embedding an integer within a pointer-likeChandler Carruth2016-01-102-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | type. This makes it easy and safe to use a set of flags as one elmenet of a tagged union with pointers. There is quite a bit of code that has historically done this by casting arbitrary integers to "pointers" and assuming that this was safe and reliable. It is neither, and has started to rear its head by triggering safety asserts in various abstractions like PointerLikeTypeTraits when the integers chosen are invariably poor choices for *some* platform and *some* situation. Not to mention the (hopefully unlikely) prospect of one of these integers actually getting allocated! With this, it will be straightforward to build type safe abstractions like this without being error prone. The abstraction itself is also remarkably simple thanks to the implicit conversion. This use case and pattern was also independently created by the folks working on Swift, and they're going to incrementally add any missing functionality they find. Differential Revision: http://reviews.llvm.org/D15844 llvm-svn: 257284
* [ADT] Add a sum type abstraction for pointer-like types.Chandler Carruth2016-01-102-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a much more general and powerful form of PointerUnion. It provides a reasonably complete sum type (from type theory) for pointer-like types. It has several significant advantages over the existing PointerUnion infrastructure: 1) It allows more than two pointer types to participate without awkward nesting structures. 2) It directly exposes the tag so that it is convenient to write switches over the possible members. 3) It can re-use the same type for multiple tag values, something that has been worked around by either abusing PointerIntPair or defining nonce types and doing unsafe pointer casting. 4) It supports customization of the PointerLikeTypeTraits used for specific member types. This means it could (in theory) be used even with types that are over-aligned on allocation to expose larger numbers of bits to the tag. All in all, I think it is at least complimentary to the existing infrastructure, and a strict improvement for some use cases. Differential Revision: http://reviews.llvm.org/D15843 llvm-svn: 257282
* [Orc][RuntimeDyld] Prevent duplicate calls to finalizeMemory on shared memoryLang Hames2016-01-093-4/+86
| | | | | | | | | | | | | | | | | | | | | | | managers. Prior to this patch, recursive finalization (where finalization of one RuntimeDyld instance triggers finalization of another instance on which the first depends) could trigger memory access failures: When the inner (dependent) RuntimeDyld instance and its memory manager are finalized, memory allocated (but not yet relocated) by the outer instance is locked, and relocation in the outer instance fails with a memory access error. This patch adds a latch to the RuntimeDyld::MemoryManager base class that is checked by a new method: RuntimeDyld::finalizeWithMemoryManagerLocking, ensuring that shared memory managers are only finalized by the outermost RuntimeDyld instance. This allows ORC clients to supply the same memory manager to multiple calls to addModuleSet. In particular it enables the use of user-supplied memory managers with the CompileOnDemandLayer which must reuse the supplied memory manager for each function that is lazily compiled. llvm-svn: 257263
* InstrProfTest.cpp: Fix a warning. [-Wsign-compare]NAKAMURA Takumi2016-01-081-1/+1
| | | | llvm-svn: 257157
* Add value site truncation unit testXinliang David Li2016-01-081-10/+56
| | | | llvm-svn: 257153
* [PGO] Ensure vp data in indexed profile always sortedXinliang David Li2016-01-081-28/+0
| | | | | | | | | Done in InstrProfWriter to eliminate the need for client code to do the sorting. The operation is done once and reused many times so it is more efficient. Update unit test to remove sorting. Also update expected output of affected tests. llvm-svn: 257145
* [PGO] Fix a bug in InstProfWriter addRecordXinliang David Li2016-01-081-0/+56
| | | | | | | | | | For a new record with weight != 1, only edge profiling counters are scaled, VP data is not properly scaled. This patch refactors the code and fixes the problem. Also added sort by count interface (for follow up patch). llvm-svn: 257143
* Fix crash when printing instructions that have a metadata attached but no ↵Mehdi Amini2016-01-072-0/+38
| | | | | | | | | | | | | | | | | | parent. Fix PR24852 (crash with -debug -instcombine) Patch by Than McIntosh <thanm@google.com> Summary: Add guards to the asm writer to prevent crashing when dumping an instruction that has no basic block. Differential Revision: http://reviews.llvm.org/D15798 From: Than McIntosh <thanm@google.com> llvm-svn: 257094
* Add unittest for new CanReplace flag on MDNodesTeresa Johnson2016-01-061-0/+14
| | | | | | | | This adds a unittest for the support added in r256648 to add a flag that can be used to prevent RAUW on temporary metadata used as a map key. llvm-svn: 256938
* Add != to YAMLParser's basic_collection_iterator.Jordan Rose2016-01-061-0/+72
| | | | | | | | | ...and mark it as merely an input_iterator rather than a forward_iterator, since it is destructive. And then rewrite == to take advantage of that. Patch by Alex Denisov! llvm-svn: 256913
* Add explicit string checks in testXinliang David Li2016-01-041-2/+15
| | | | llvm-svn: 256796
* Fix several accidental DOS line endings in source filesDimitry Andric2016-01-031-7/+7
| | | | | | | | | | | | | | | Summary: There are a number of files in the tree which have been accidentally checked in with DOS line endings. Convert these to native line endings. There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those. Reviewers: joerg, aaron.ballman Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D15848 llvm-svn: 256707
* add FMF for CreateCall variantSanjay Patel2015-12-311-0/+10
| | | | | | | The version with OpBundles was missed in: http://reviews.llvm.org/rL255555 llvm-svn: 256674
* [PGO]: Implement Func PGO name string compressionXinliang David Li2015-12-311-0/+61
| | | | | | | | | | This is part of the effort/prepration to reduce the size instr-pgo (object, binary, memory footprint, and raw data). The functionality is currently off by default and not yet used by any clients. llvm-svn: 256667
* [ADT] Teach alignment helpers to work correctly for abstract classes.Chandler Carruth2015-12-291-0/+20
| | | | | | | | | | | | This is necessary to use them as part of pointer traits and is generally useful. I've added unit test coverage to isolate and ensure this works correctly. I'll watch the build bots to try to see if any compilers can't tolerate this bit of magic (and much credit goes to Richard Smith for coming up with this magical production!) but give a shout if you see issues. llvm-svn: 256553
* [TrailingObjects] Dynamically realign under-aligned trailing objects.James Y Knight2015-12-291-0/+17
| | | | | | | | | | | | | | Previously, the code enforced non-decreasing alignment of each trailing type. However, it's easy enough to allow for realignment as needed, and thus avoid the developer having to think about the possiblilities for alignment requirements on all architectures. (E.g. on Linux/x86, a struct with an int64 member is 4-byte aligned, while on other 32-bit archs -- and even with other OSes on x86 -- it has 8-byte alignment. This sort of thing is irritating to have to manually deal with.) llvm-svn: 256533
* [ADT] Use a nonce type with at least 4 byte alignment.Chandler Carruth2015-12-291-0/+1
| | | | | | | | | We didn't actually statically check this, and so it worked 25% of the time for me. =/ Really sorry it took so long to fix, I shouldn't leave the commit log editor window open without saving and landing the commit. =[ llvm-svn: 256528
* [ADT] Don't use a fixture just to get a nonce type for this unittest.Chandler Carruth2015-12-281-12/+12
| | | | | | | Instead, actually produce a nonce type in the test and use that. This makes the test, IMO, both simpler and more clear. llvm-svn: 256518
* InstrProfTest.cpp: Don't assume string literals are always merged.NAKAMURA Takumi2015-12-271-29/+37
| | | | | | | MSC18 Debug didn't merge them. FIXME: I tweaked just to appease a builder. Almost string literals should be addressed identically there. llvm-svn: 256459
* [Function] Properly remove use when clearing personalityKeno Fischer2015-12-231-0/+24
| | | | | | | | | | | | | | | | | Summary: We need to actually remove the use of the personality function, otherwise we can run into trouble if we want to e.g. delete the personality function because ther's no way to get rid of its uses. Do this by resetting to ConstantPointerNull value that the operands are set to when first allocated. Reviewers: vsk, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15752 llvm-svn: 256345
* Unbreak LLVM_ENABLE_THREADS=OFF builds.Nico Weber2015-12-231-3/+19
| | | | llvm-svn: 256308
* [unittest] Use Support/thread.h instead of <thread> (second try)Vedant Kumar2015-12-221-1/+1
| | | | llvm-svn: 256292
* [unittest] Use Support/Thread.h instead of <thread> to fix the Windows buildVedant Kumar2015-12-221-1/+1
| | | | llvm-svn: 256290
* [Support] Allow multiple paired calls to {start,stop}Timer()Vedant Kumar2015-12-222-0/+50
| | | | | | | Differential Revision: http://reviews.llvm.org/D15619 Reviewed-by: rafael llvm-svn: 256258
* fix leak in a test, make the sanitizer bot greenKostya Serebryany2015-12-211-1/+2
| | | | llvm-svn: 256179
* ThreadPool unittests: do not hold mutex when calling condition_variable:notify()Mehdi Amini2015-12-191-11/+11
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 256111
OpenPOWER on IntegriCloud