summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix some cases were ArrayRefs were being passed by reference. Also remove ↵Craig Topper2014-08-273-6/+6
| | | | | | 'const' from some other ArrayRef uses since its implicitly const already. llvm-svn: 216524
* InstCombine: Optimize GEP's involving ptrtoint betterDavid Majnemer2014-08-271-11/+29
| | | | | | | | | | | | | | We supported transforming: (gep i8* X, -(ptrtoint Y)) to: (inttoptr (sub (ptrtoint X), (ptrtoint Y))) However, this only fired if 'X' had type i8*. Generalize this to support various types of different sizes. This results in much better CodeGen, especially for pointers to packed structs. llvm-svn: 216523
* Remove type unit skeletons. GDB no longer needs them & this saves a heap of ↵David Blaikie2014-08-271-22/+1
| | | | | | space. llvm-svn: 216521
* [FastISel][AArch64] Fix address simplification.Juergen Ributzka2014-08-271-8/+103
| | | | | | | | | | | | When a shift with extension or an add with shift and extension cannot be folded into the memory operation, then the address calculation has to be materialized separately. While doing so the code forgot to consider a possible sign-/zero- extension. This fix folds now also the sign-/zero-extension into the add or shift instruction which is used to materialize the address. This fixes rdar://problem/18141718. llvm-svn: 216511
* [FastISel][AArch64] Fold Sign-/Zero-Extend into the shift immediate instruction.Juergen Ributzka2014-08-271-55/+249
| | | | llvm-svn: 216510
* Pass a std::unique_ptr<MemoryBuffer>& to getLazyBitcodeModule.Rafael Espindola2014-08-264-15/+15
| | | | | | | By taking a reference we can do the ownership transfer in one place instead of expecting every caller to do it. llvm-svn: 216492
* Pass a MemoryBufferRef when we can avoid taking ownership.Rafael Espindola2014-08-269-49/+40
| | | | | | | | | | | | | The attached patch simplifies a few interfaces that don't need to take ownership of a buffer. For example, both parseAssembly and parseBitcodeFile will parse the entire buffer before returning. There is no need to take ownership. Using a MemoryBufferRef makes it obvious in the type signature that there is no ownership transfer. llvm-svn: 216488
* Give ExecutionEngine of top level buffers.Rafael Espindola2014-08-263-3/+12
| | | | | | | Long term the idea if for the engine to not own the buffers, but for now this is consistent with the rest of the API. llvm-svn: 216484
* MC: Split the x86 asm matcher implementations by dialectReid Kleckner2014-08-262-33/+198
| | | | | | | | | | | | | | | | | | | The existing matcher has lots of AT&T assembly dialect assumptions baked into it. In particular, the hack for resolving the size of a memory operand by appending the four most common suffixes doesn't work at all. The Intel assembly dialect mnemonic table has ambiguous entries, so we need to try matching multiple times with different operand sizes, since that's the only way to choose different instruction variants. This makes us more compatible with gas's implementation of Intel assembly syntax. MSVC assumes you want byte-sized operations for the instructions that we reject as ambiguous. Reviewed By: grosbach Differential Revision: http://reviews.llvm.org/D4747 llvm-svn: 216481
* Revert r210342 and r210343, add test case for the crasher.Joerg Sonnenberger2014-08-261-91/+0
| | | | | | PR 20642. llvm-svn: 216475
* Convert MC command line option for fatal assembler warnings into aJoerg Sonnenberger2014-08-262-8/+4
| | | | | | proper flag. llvm-svn: 216471
* Return a std::unique_ptr from the IRReader.h functions. NFC.Rafael Espindola2014-08-261-16/+15
| | | | llvm-svn: 216466
* Simplify LTOModule::makeLTOModule a bit. NFC.Rafael Espindola2014-08-261-3/+1
| | | | | | | Just call parseBitcodeFile instead of getLazyBitcodeModule followed by materializeAllPermanently. llvm-svn: 216461
* Merge TempDir and system_temp_directory.Rafael Espindola2014-08-263-90/+106
| | | | | | | | | We had two functions for finding the temp or cache directory. Each had a different set of smarts about OS specific APIs. With this patch system_temp_directory becomes the only way to do it. llvm-svn: 216460
* Silence unused function warning in Release builds.Benjamin Kramer2014-08-261-0/+2
| | | | llvm-svn: 216458
* Change the return value of "getEnd()" from a MachineInstr* to a ↵James Molloy2014-08-261-1/+1
| | | | | | | | MachineBasicBlock::iterator. It seems on Darwin the illegal round-trip ::iterator -> MachineInstr* -> ::iterator breaks execution horribly when the iterator is not a real MachineInstr, like ::end(). llvm-svn: 216455
* ARM: Add patterns for dbgYi Kong2014-08-262-2/+3
| | | | llvm-svn: 216451
* This patch enables SimplifyUsingDistributiveLaws() to handle following pattens.Dinesh Dwivedi2014-08-262-54/+45
| | | | | | | | | | | | (X >> Z) & (Y >> Z) -> (X&Y) >> Z for all shifts. (X >> Z) | (Y >> Z) -> (X|Y) >> Z for all shifts. (X >> Z) ^ (Y >> Z) -> (X^Y) >> Z for all shifts. These patterns were previously handled separately in visitAnd()/visitOr()/visitXor(). Differential Revision: http://reviews.llvm.org/D4951 llvm-svn: 216443
* InstSimplify: Fold gep X, (sub 0, ptrtoint(X)) to nullDavid Majnemer2014-08-261-21/+32
| | | | | | | Save InstCombine some work if we can perform this fold during InstSimplify. llvm-svn: 216441
* InstSimplify: Simplify trivial pointer expressions like b + (e - b)David Majnemer2014-08-261-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | consider: long long *f(long long *b, long long *e) { return b + (e - b); } we would lower this to something like: define i64* @f(i64* %b, i64* %e) { %1 = ptrtoint i64* %e to i64 %2 = ptrtoint i64* %b to i64 %3 = sub i64 %1, %2 %4 = ashr exact i64 %3, 3 %5 = getelementptr inbounds i64* %b, i64 %4 ret i64* %5 } This should fold away to just 'e'. N.B. This adds m_SpecificInt as a convenient way to match against a particular 64-bit integer when using LLVM's match interface. llvm-svn: 216439
* AArch64: use std::fill instead of memsetDylan Noblesmith2014-08-261-1/+1
| | | | | | Followup based on review. llvm-svn: 216436
* Revert "AArch64: use std::vector for temp array"Dylan Noblesmith2014-08-261-4/+5
| | | | | | This reverts commit r216365. llvm-svn: 216433
* Analysis: cleanupDylan Noblesmith2014-08-261-3/+2
| | | | | | Address review comments. llvm-svn: 216432
* Revert "Analysis: unique_ptr-ify DependenceAnalysis::collectCoeffInfo"Dylan Noblesmith2014-08-261-8/+8
| | | | | | This reverts commit r216358. llvm-svn: 216431
* Revert "NVPTX: remove another raw delete call"Dylan Noblesmith2014-08-261-1/+3
| | | | | | This reverts commit r216364. llvm-svn: 216430
* Revert "Support/APFloat: unique_ptr-ify temp arrays"Dylan Noblesmith2014-08-261-8/+11
| | | | | | This reverts commit rr216359. llvm-svn: 216429
* Revert "Support/Path: remove raw delete"Dylan Noblesmith2014-08-261-2/+2
| | | | | | This reverts commit r216360. llvm-svn: 216428
* ExecutionEngine: address review commentsDylan Noblesmith2014-08-261-7/+6
| | | | llvm-svn: 216427
* CodeGen/LiveVariables: use vector::assign()Dylan Noblesmith2014-08-261-8/+4
| | | | | | Address review comments. llvm-svn: 216426
* musttail: Don't eliminate varargs packs if there is a forwarding callReid Kleckner2014-08-261-2/+7
| | | | | | Also clean up and beef up this grep test for the feature. llvm-svn: 216425
* fix typos in commentsSanjay Patel2014-08-261-4/+4
| | | | llvm-svn: 216424
* Declare that musttail calls in variadic functions forward the ellipsisReid Kleckner2014-08-263-3/+30
| | | | | | | | | | | | | | | | | Summary: There is no functionality change here except in the way we assemble and dump musttail calls in variadic functions. There's really no need to separate out the bits for musttail and "is forwarding varargs" on call instructions. A musttail call by definition has to forward the ellipsis or it would fail verification. Reviewers: chandlerc, nlewycky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4892 llvm-svn: 216423
* ArgPromotion: Don't touch variadic functionsReid Kleckner2014-08-251-0/+7
| | | | | | | | | | | | | | | | Adding, removing, or changing non-pack parameters can change the ABI classification of pack parameters. Clang and other frontends encode the classification in the IR of the call site, but the callee side determines it dynamically based on the number of registers consumed so far. Changing the prototype affects the number of registers consumed would break such code. Dead argument elimination performs a similar task and already has a similar check to avoid this problem. Patch by Thomas Jablin! llvm-svn: 216421
* [MCJIT][SystemZ] Use a simpler expression for indirect relocation offsets.Lang Hames2014-08-251-1/+1
| | | | | | | | The expressions 'Reloc.Addend - Addend' and 'Reloc.Offset' should always be equal in this context. The latter is prefered - we want to remove the RelocationValueRef::Addend field in the future. llvm-svn: 216418
* Fix bug in llvm::sys::argumentsFitWithinSystemLimits().Rafael Espindola2014-08-251-2/+2
| | | | | | | | | | | | | This patch fixes a subtle bug in the UNIX implementation of llvm::sys::argumentsFitWithinSystemLimits() regarding the misuse of a static variable. This bug causes our cached number that stores the system command line maximum length to be halved after each call to the function. With a sufficient number of calls to this function, it will eventually report any given command line string to be over system limits. Patch by Rafael Auler. llvm-svn: 216415
* [MCJIT] Dump section memory both before and after relocations are applied.Lang Hames2014-08-251-5/+8
| | | | | | Also switch section memory dump format from 8 to 16 columns. llvm-svn: 216413
* Refactor argument serialization logic when executing process. NFC.Rafael Espindola2014-08-251-13/+17
| | | | | | | | | | | | This patch refactors the argument serialization logic used in the Execute function, used to launch new Windows processes. There is a critical step that joins char** arguments into a single string, building the command line used to launch the new process, and the readability of this code is improved if this part is refactored in its own helper function. Patch by Rafael Auler! llvm-svn: 216411
* [FastISel][AArch64] Refactor float zero materialization. NFCI.Juergen Ributzka2014-08-251-20/+29
| | | | llvm-svn: 216403
* [MCJIT] Make RuntimeDyld dump section contents in -debug mode.Lang Hames2014-08-252-4/+34
| | | | llvm-svn: 216400
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-2515-79/+72
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* [x86] Fix a bug in r216319 where I was missing a 'break'.Chandler Carruth2014-08-251-0/+2
| | | | | | | | | | | This actually was caught by existing tests but those tests were disabled with an XFAIL because of PR20736. While working on fixing that, I noticed the test failure, and tracked it down to this. We even have a really nice Clang warning that would have caught this but it isn't enabled in LLVM! =[ I may look at enabling it. llvm-svn: 216391
* Remove dangling initializers in GlobalDCEBruno Cardoso Lopes2014-08-252-1/+10
| | | | | | | | | | | | | | GlobalDCE deletes global vars and updates their initializers to nullptr while leaving underlying constants to be cleaned up later by its uses. The clean up may never happen, fix this by forcing it every time it's safe to destroy constants. Final patch by Rafael Espindola http://reviews.llvm.org/D4931 <rdar://problem/17523868> llvm-svn: 216390
* [AArch32] Add patterns for VCVT{A,N,P,M}.Chad Rosier2014-08-251-9/+13
| | | | | | | Patterns for lowering libm calls to VCVT{A,N,P,M} are also included. Phabricator Revision: http://reviews.llvm.org/D5033 llvm-svn: 216388
* [SKX] avx512_icmp_packed multiclass extensionRobert Khasanov2014-08-251-27/+173
| | | | | | | | | | | | | Extended avx512_icmp_packed multiclass by masking versions. Added avx512_icmp_packed_rmb multiclass for embedded broadcast versions. Added corresponding _vl multiclasses. Added encoding tests for CPCMP{EQ|GT}* instructions. Add more fields for X86VectorVTInfo. Added AVX512VLVectorVTInfo that include X86VectorVTInfo for 512/256/128-bit versions Differential Revision: http://reviews.llvm.org/D5024 llvm-svn: 216383
* MergeFunctions, tiny refactoring:Stepan Dyatkovskiy2014-08-251-3/+3
| | | | | | cmpAPFloat has been renamed to cmpAPFloats (multiple form). llvm-svn: 216376
* MergeFunctions, tiny refactoring:Stepan Dyatkovskiy2014-08-251-5/+5
| | | | | | cmpAPInt has been renamed to cmpAPInts (multiple form). llvm-svn: 216375
* MergeFunctions, tiny refactoring:Stepan Dyatkovskiy2014-08-251-12/+11
| | | | | | cmpType has been renamed to cmpTypes (multiple form). llvm-svn: 216374
* MergeFunctions, tiny refactoring:Stepan Dyatkovskiy2014-08-251-5/+5
| | | | | | cmpGEP has been renamed to cmpGEPs (multiple form). llvm-svn: 216373
* Allow vectorization of division by uniform power of 2.Karthik Bhat2014-08-258-47/+103
| | | | | | | | This patch adds support to recognize division by uniform power of 2 and modifies the cost table to vectorize division by uniform power of 2 whenever possible. Updates Cost model for Loop and SLP Vectorizer.The cost table is currently only updated for X86 backend. Thanks to Hal, Andrea, Sanjay for the review. (http://reviews.llvm.org/D4971) llvm-svn: 216371
* CodeGen/LiveVariables: hoist out code in nested loopsDylan Noblesmith2014-08-251-110/+121
| | | | | | This makes runOnMachineFunction vastly more readable. llvm-svn: 216368
OpenPOWER on IntegriCloud