summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Use ErrorOr for the ::create factory on instrumented and sample profilers.Diego Novillo2014-11-033-8/+7
| | | | | | | | | | | | | | | | | Summary: As discussed in http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141027/242445.html, the creation of reader and writer instances is better done using ErrorOr. There are no functional changes, but several callers needed to be adjusted. Reviewers: bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6076 llvm-svn: 221120
* Support REG_SEQUENCE in tablegen.Matt Arsenault2014-11-021-1/+1
| | | | | | | | | The problem is mostly that variadic output instruction aren't handled, so it is rejected for having an inconsistent number of operands, and then the right number of operands isn't emitted. llvm-svn: 221117
* InstCombine: Don't assume that m_ZExt matches an InstructionDavid Majnemer2014-11-011-0/+2
| | | | | | | | | | | | m_ZExt might bind against a ConstantExpr instead of an Instruction. Assuming this, using cast<Instruction>, results in InstCombine crashing. Instead, introduce ZExtOperator to bridge both Instruction and ConstantExpr ZExts. This fixes PR21445. llvm-svn: 221069
* Renamed CCState members that appear to misspell 'Processed' as 'Proceed'. NFC.Daniel Sanders2014-11-011-10/+10
| | | | | | | | | | | | Reviewers: rnk Reviewed By: rnk Subscribers: rnk, llvm-commits Differential Revision: http://reviews.llvm.org/D5978 llvm-svn: 221061
* [tablegen] Add CustomCallingConv and use it to tablegen-erate the outermost ↵Daniel Sanders2014-11-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | parts of the Mips O32 implementation Summary: CustomCallingConv is simply a CallingConv that tablegen should not generate the implementation for. It allows regular CallingConv's to delegate to these custom functions. This is (currently) necessary for Mips and we cannot use CCCustom without having to adapt to the different API that CCCustom uses. This brings us a bit closer to being able to remove MipsCC::analyzeCallOperands and MipsCC::analyzeFormalArguments in favour of the common implementation. No functional change to the targets. Depends on D3341 Reviewers: vmedic Reviewed By: vmedic Subscribers: vmedic, llvm-commits Differential Revision: http://reviews.llvm.org/D5965 llvm-svn: 221052
* Add show and merge tools for sample PGO profiles.Diego Novillo2014-11-013-22/+93
| | | | | | | | | | | | | | | | | | | | | Summary: This patch extends the 'show' and 'merge' commands in llvm-profdata to handle sample PGO formats. Using the 'merge' command it is now possible to convert one sample PGO format to another. The only format that is currently not working is 'gcc'. I still need to implement support for it in lib/ProfileData. The changes in the sample profile support classes are needed for the merge operation. Reviewers: bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6065 llvm-svn: 221032
* IR: MDNode => Value: Instruction::getAllMetadata()Duncan P. N. Exon Smith2014-11-011-2/+4
| | | | | | | Change `Instruction::getAllMetadata()` to modify a vector of `Value` instead of `MDNode` and update call sites. This is part of PR21433. llvm-svn: 221027
* IR: MDNode => Value: Instruction::getMetadata()Duncan P. N. Exon Smith2014-11-011-4/+4
| | | | | | | | | | Change `Instruction::getMetadata()` to return `Value` as part of PR21433. Update most callers to use `Instruction::getMDNode()`, which wraps the result in a `cast_or_null<MDNode>`. llvm-svn: 221024
* IR: MDNode => Value: Add Instruction::getMDNode()Duncan P. N. Exon Smith2014-10-311-0/+20
| | | | | | | | | | Add `Instruction::getMDNode()` that casts to `MDNode` before changing `Instruction::getMetadata()` to return `Value`. This avoids adding `cast_or_null<MDNode>` boiler-plate throughout the code. Part of PR21433. llvm-svn: 221023
* Work around bugs in MSVC "14" CTP 3's conversion logicReid Kleckner2014-10-311-0/+4
| | | | | | | | | | It appears to ignore or find ambiguous MachineInstrBuilder's conversion operators that allow conversion to MachineInstr* and MachineBasicBlock::bundle_iterator. As a workaround, add an explicit way to get the MachineInstr. llvm-svn: 221017
* Define LLVM_NOEXCEPT with MSVC 14 CTP 3 or newerReid Kleckner2014-10-311-1/+1
| | | | | | | | | | We have to use _MSC_FULL_VER here as CTP 2 and earlier didn't define noexcept to my knowledge. Fixes build error in lib/Support/Error.cpp when inheriting from std::error_category, which has a noexcept virtual method. llvm-svn: 221013
* [Object] Modify OwningBinary's interface to separate inspection from ownership.Lang Hames2014-10-311-11/+12
| | | | | | | | The getBinary and getBuffer method now return ordinary pointers of appropriate const-ness. Ownership is transferred by calling takeBinary(), which returns a pair of the Binary and a MemoryBuffer. llvm-svn: 221003
* IR: MDNode => Value: Instruction::setMetadata()Duncan P. N. Exon Smith2014-10-312-4/+4
| | | | | | | Change `Instruction::setMetadata()` API to accept `Value` instead of `MDNode`. Part of PR21433. llvm-svn: 220994
* [PowerPC] Initial VSX intrinsic support, with min/max for vector doubleBill Schmidt2014-10-311-0/+51
| | | | | | | | | | | | | Now that we have initial support for VSX, we can begin adding intrinsics for programmer access to VSX instructions. This patch adds basic support for VSX intrinsics in general, and tests it by implementing intrinsics for minimum and maximum for the vector double data type. The LLVM portion of this is quite straightforward. There is a companion patch for Clang. llvm-svn: 220988
* [CodeGenPrepare] Move extractelement close to store if they can be combined.Quentin Colombet2014-10-311-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an optimization in CodeGenPrepare to move an extractelement right before a store when the target can combine them. The optimization may promote any scalar operations to vector operations in the way to make that possible. ** Context ** Some targets use different register files for both vector and scalar operations. This means that transitioning from one domain to another may incur copy from one register file to another. These copies are not coalescable and may be expensive. For example, according to the scheduling model, on cortex-A8 a vector to GPR move is 20 cycles. ** Motivating Example ** Let us consider an example: define void @foo(<2 x i32>* %addr1, i32* %dest) { %in1 = load <2 x i32>* %addr1, align 8 %extract = extractelement <2 x i32> %in1, i32 1 %out = or i32 %extract, 1 store i32 %out, i32* %dest, align 4 ret void } As it is, this IR generates the following assembly on armv7: vldr d16, [r0] @vector load vmov.32 r0, d16[1] @ cross-register-file copy: 20 cycles orr r0, r0, #1 @ scalar bitwise or str r0, [r1] @ scalar store bx lr Whereas we could generate much faster code: vldr d16, [r0] @ vector load vorr.i32 d16, #0x1 @ vector bitwise or vst1.32 {d16[1]}, [r1:32] @ vector extract + store bx lr Half of the computation made in the vector is useless, but this allows to get rid of the expensive cross-register-file copy. ** Proposed Solution ** To avoid this cross-register-copy penalty, we promote the scalar operations to vector operations. The penalty will be removed if we manage to promote the whole chain of computation in the vector domain. Currently, we do that only when the chain of computation ends by a store and the target is able to combine an extract with a store. Stores are the most likely candidates, because other instructions produce values that would need to be promoted and so, extracted as some point[1]. Moreover, this is customary that targets feature stores that perform a vector extract (see AArch64 and X86 for instance). The proposed implementation relies on the TargetTransformInfo to decide whether or not it is beneficial to promote a chain of computation in the vector domain. Unfortunately, this interface is rather inaccurate for this level of details and although this optimization may be beneficial for X86 and AArch64, the inaccuracy will lead to the optimization being too aggressive. Basically in TargetTransformInfo, everything that is legal has a cost of 1, whereas, even if a vector type is legal, usually a vector operation is slightly more expensive than its scalar counterpart. That will lead to too many promotions that may not be counter balanced by the saving of the cross-register-file copy. For instance, on AArch64 this penalty is just 4 cycles. For now, the optimization is just enabled for ARM prior than v8, since those processors have a larger penalty on cross-register-file copies, and the scope is limited to basic blocks. Because of these two factors, we limit the effects of the inaccuracy. Indeed, I did not want to build up a fancy cost model with block frequency and everything on top of that. [1] We can imagine targets that can combine an extractelement with other instructions than just stores. If we want to go into that direction, the current interfaces must be augmented and, moreover, I think this becomes a global isel problem. Differential Revision: http://reviews.llvm.org/D5921 <rdar://problem/14170854> llvm-svn: 220978
* Object, COFF: Cleanup symbol type code, improve binutils compatibilityDavid Majnemer2014-10-311-6/+23
| | | | | | | Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things. llvm-svn: 220952
* Threading.h: Give named parameters to llvm::call_once(flag,UserFn). ↵NAKAMURA Takumi2014-10-311-2/+1
| | | | | | [-Wdocumentation] llvm-svn: 220941
* Removing the static initializer in ManagedStatic.cpp by using llvm_call_once ↵Chris Bieneman2014-10-301-0/+37
| | | | | | | | | | | | | | | | | | | to initialize the ManagedStatic mutex. Summary: This patch adds an llvm_call_once which is a wrapper around std::call_once on platforms where it is available and devoid of bugs. The patch also migrates the ManagedStatic mutex to be allocated using llvm_call_once. These changes are philosophically equivalent to the changes added in r219638, which were reverted due to a hang on Win32 which was the result of a bug in the Windows implementation of std::call_once. Reviewers: aaron.ballman, chapuni, chandlerc, rnk Reviewed By: rnk Subscribers: majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D5922 llvm-svn: 220932
* Fix comment spelling and tidy diagnostic call in profile reader.Diego Novillo2014-10-302-4/+3
| | | | | | No functional changes. llvm-svn: 220922
* Add profile writing capabilities for sampling profiles.Diego Novillo2014-10-303-104/+369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch finishes up support for handling sampling profiles in both text and binary formats. The new binary format uses uleb128 encoding to represent numeric values. This makes profiles files about 25% smaller. The profile writer class can write profiles in the existing text and the new binary format. In subsequent patches, I will add the capability to read (and perhaps write) profiles in the gcov format used by GCC. Additionally, I will be adding support in llvm-profdata to manipulate sampling profiles. There was a bit of refactoring needed to separate some code that was in the reader files, but is actually common to both the reader and writer. The new test checks that reading the same profile encoded as text or raw, produces the same results. Reviewers: bogner, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6000 llvm-svn: 220915
* [Mips] Add new Mips specific e_flags.Simon Atanasyan2014-10-301-0/+6
| | | | | | No functional changes. llvm-svn: 220910
* Fix getRelocationValueString to return the symbol name for EM_386.Jan Wen Voung2014-10-291-0/+1
| | | | | | | | | | | | | | Summary: This helps llvm-objdump -r to print out the symbol name along with the relocation type on x86. Adjust existing tests from checking for "Unknown" to check for the symbol now. Test Plan: Adjusted test/Object tests. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5987 llvm-svn: 220866
* [C API] PR19859: Add functions to query and modify branches.Peter Zotov2014-10-281-0/+61
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com>. llvm-svn: 220817
* [C API] PR19859: Add LLVMGetFCmpPredicate and LLVMConstRealGetDouble.Peter Zotov2014-10-281-0/+18
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com>. llvm-svn: 220814
* X86: Implement the vectorcall calling conventionReid Kleckner2014-10-281-1/+5
| | | | | | | | | | | | | | | | | | | | This is a Microsoft calling convention that supports both x86 and x86_64 subtargets. It passes vector and floating point arguments in XMM0-XMM5, and passes them indirectly once they are consumed. Homogenous vector aggregates of up to four elements can be passed in sequential vector registers, but this part is not implemented in LLVM and will be handled in Clang. On 32-bit x86, it is similar to fastcall in that it uses ecx:edx as integer register parameters and is callee cleanup. On x86_64, it delegates to the normal win64 calling convention. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D5943 llvm-svn: 220745
* Remove the PreserveSource linker mode.Rafael Espindola2014-10-281-19/+5
| | | | | | | | | | | | | | | | | | | | I noticed that it was untested, and forcing it on caused some tests to fail: LLVM :: Linker/metadata-a.ll LLVM :: Linker/prefixdata.ll LLVM :: Linker/type-unique-odr-a.ll LLVM :: Linker/type-unique-simple-a.ll LLVM :: Linker/type-unique-simple2-a.ll LLVM :: Linker/type-unique-simple2.ll LLVM :: Linker/type-unique-type-array-a.ll LLVM :: Linker/unnamed-addr1-a.ll LLVM :: Linker/visibility1.ll If it is to be resurrected, it has to be fixed and we should probably have a -preserve-source command line option in llvm-mc and run tests with and without it. llvm-svn: 220741
* Make it easier to pass a custom diagnostic handler to the IR linker.Rafael Espindola2014-10-271-2/+15
| | | | llvm-svn: 220732
* [ScalarEvolution] Guard dump() with #ifJingyue Wu2014-10-271-0/+2
| | | | | | to be consistent with its definition in ScalarEvolution.cpp llvm-svn: 220721
* [PBQP] Remove a spurious 'typename' keyword. This was causing an error on MSVC.Lang Hames2014-10-271-1/+1
| | | | llvm-svn: 220690
* [PBQP] Clarify ambiguous-looking typedef.Lang Hames2014-10-271-1/+1
| | | | | | This was causing an error on the hexagon bots. llvm-svn: 220689
* [PBQP] Unique allowed-sets for nodes in the PBQP graph and use pairs of theseLang Hames2014-10-273-49/+189
| | | | | | | | | | | sets as keys into a cache of interference matrice values in the Interference constraint adder. Creating interference matrices was one of the large remaining time-sinks in PBQP. Caching them reduces the total compile time (when using PBQP) on the nightly test suite by ~10%. llvm-svn: 220688
* Add MapVector::rbegin(), MapVector::rend() to completment ↵Michael Gottesman2014-10-271-17/+11
| | | | | | | | | | MapVector::begin(), MapVector::end(). These just delegate to the underlying vector type in the MapVector. Also just add in some sanity unittests. llvm-svn: 220687
* Prune CRLF.NAKAMURA Takumi2014-10-276-8/+8
| | | | llvm-svn: 220678
* [PBQP] Tidying up as per Dave Blaikie's suggesions for r220642.Lang Hames2014-10-261-3/+3
| | | | llvm-svn: 220655
* [PBQP] Explicitly define copy/move operations for NodeMetadata to keep VS happy.Lang Hames2014-10-261-4/+31
| | | | | | | Hopefully this fixes the bug that was introduced in r220642, and not-quite-fixed in r220649. llvm-svn: 220653
* Add an option to the LTO code generator to disable vectorization during LTOArnold Schwaighofer2014-10-261-1/+4
| | | | | | | | | | | | | | | | | | | | We used to always vectorize (slp and loop vectorize) in the LTO pass pipeline. r220345 changed it so that we used the PassManager's fields 'LoopVectorize' and 'SLPVectorize' out of the desire to be able to disable vectorization using the cl::opt flags 'vectorize-loops'/'slp-vectorize' which the before mentioned fields default to. Unfortunately, this turns off vectorization because those fields default to false. This commit adds flags to the LTO library to disable lto vectorization which reconciles the desire to optionally disable vectorization during LTO and the desired behavior of defaulting to enabled vectorization. We really want tools to set PassManager flags directly to enable/disable vectorization and not go the route via cl::opt flags *in* PassManagerBuilder.cpp. llvm-svn: 220652
* [PBQP] Re-commit r220642 with a workaround for quirky Visual Studio behavior.Lang Hames2014-10-261-14/+26
| | | | | | | | | Apparently unique_ptr'ifying NodeMetadata exposed an issue in VS where it occasionally tries to synthesize copy constructors instead of moves. Hopefully explicitly deleting the copy constructor and defining the move constructor will fix this. llvm-svn: 220649
* Revert "[PBQP] Unique-ptrify some PBQP Metadata structures. No functional ↵Hans Wennborg2014-10-261-8/+14
| | | | | | | | | | | | | | | | | | | | | | change." (r220642) It broke the Windows build: [1/19] Building CXX object lib\CodeGen\CMakeFiles\LLVMCodeGen.dir\RegAllocPBQP.cpp.obj C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/CodeGen/RegAllocPBQP.h(132) : error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>' with [ _Ty=unsigned int [] ] D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\memory(1600) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr' with [ _Ty=unsigned int [] ] This diagnostic occurred in the compiler generated function 'llvm::PBQP::RegAlloc::NodeMetadata::NodeMetadata(const llvm::PBQP::RegAlloc::NodeMetadata &)' llvm-svn: 220645
* [PBQP] Unique-ptrify some PBQP Metadata structures. No functional change.Lang Hames2014-10-261-14/+8
| | | | llvm-svn: 220642
* [PBQP] Tidy up CostAllocator.h: fix variable case, rename CostPool to ValuePool.Lang Hames2014-10-261-37/+37
| | | | | | | | No functional change. This just brings things more in-line with coding standards, and makes ValuePool's functionality clearer (it's not tied to pooling costs, and we may want to use it to hold other things in the future). llvm-svn: 220641
* Unbreak the build.Benjamin Kramer2014-10-251-0/+1
| | | | llvm-svn: 220617
* Clean up assume intrinsic pattern matching, no need to check that the ↵Benjamin Kramer2014-10-251-3/+4
| | | | | | | | argument is a value. Also make it const safe and remove superfluous casting. NFC. llvm-svn: 220616
* Update the error handling of lib/Linker.Rafael Espindola2014-10-253-13/+7
| | | | | | Instead of passing a std::string&, use the new diagnostic infrastructure. llvm-svn: 220608
* Modernize the error handling of the Materialize function.Rafael Espindola2014-10-243-3/+5
| | | | llvm-svn: 220600
* Don't ever call materializeAllPermanently during LTO.Rafael Espindola2014-10-245-8/+24
| | | | | | | | | | To do this, change the representation of lazy loaded functions. The previous representation cannot differentiate between a function whose body has been removed and one whose body hasn't been read from the .bc file. That means that in order to drop a function, the entire body had to be read. llvm-svn: 220580
* remove class/function/variable names from comments; NFCSanjay Patel2014-10-241-20/+13
| | | | llvm-svn: 220577
* Use rsqrt (X86) to speed up reciprocal square root calcsSanjay Patel2014-10-241-1/+4
| | | | | | | | | | | | | | | | | | | | | This is a first step for generating SSE rsqrt instructions for reciprocal square root calcs when fast-math is allowed. For now, be conservative and only enable this for AMD btver2 where performance improves significantly - for example, 29% on llvm/projects/test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c (if we convert the data type to single-precision float). This patch adds a two constant version of the Newton-Raphson refinement algorithm to DAGCombiner that can be selected by any target via a parameter returned by getRsqrtEstimate().. See PR20900 for more details: http://llvm.org/bugs/show_bug.cgi?id=20900 Differential Revision: http://reviews.llvm.org/D5658 llvm-svn: 220570
* These functions are not actually defined for NDEBUG or !LLVM_DUMP_ENABLED, ↵Aaron Ballman2014-10-242-0/+6
| | | | | | so guarding the declarations as well. NFC, silences MSVC warnings in release builds. llvm-svn: 220565
* Make getDISubprogram(const Function *F) available in LLVMTimur Iskhodzhanov2014-10-231-0/+5
| | | | | | Reviewed at http://reviews.llvm.org/D5950 llvm-svn: 220536
* PR21189: Teach llvm-readobj to dump bits of COFF symbol subsections required ↵Timur Iskhodzhanov2014-10-231-1/+6
| | | | | | | | | to debug using VS2012+ Reviewed at http://reviews.llvm.org/D5755 Thanks to Andrey Guskov for his help investigating this! llvm-svn: 220526
OpenPOWER on IntegriCloud