summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [SimplifyCFG] Swap to using TargetTransformInfo for costJames Molloy2015-02-111-50/+28
| | | | | | | | | | | | | | | | | | analysis. We're already using TTI in SimplifyCFG, so remove the hard-baked "cheapness" heuristic and use TTI directly. Generally NFC intended, but we're using a slightly different heuristic now so there is a slight test churn. Test changes: * combine-comparisons-by-cse.ll: Removed unneeded branch check. * 2014-08-04-muls-it.ll: Test now doesn't branch but emits muleq. * coalesce-subregs.ll: Superfluous block check. * 2008-01-02-hoist-fp-add.ll: fadd is safe to speculate. Change to udiv. * PhiBlockMerge.ll: Superfluous CFG checking code. Main checks still present. * select-gep.ll: A variable GEP is not expensive, just TCC_Basic, according to the TTI. llvm-svn: 228826
* [mips] Merge disassemblers into a single implementation.Daniel Sanders2015-02-111-84/+18
| | | | | | | | | | | | | | | | | | | | Summary: Currently we have Mips32 and Mips64 disassemblers and this causes the target triple to affect the disassembly despite all the relevant information being in the ELF header. These implementations do not need to be separate. This patch merges them together such that the appropriate tables are checked for the subtarget (e.g. Mips64 is checked when GP64 is enabled). Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7498 llvm-svn: 228825
* [LoopReroll] Introduce the concept of DAGRootSets.James Molloy2015-02-111-202/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A DAGRootSet models an induction variable being used in a rerollable loop. For example: x[i*3+0] = y1 x[i*3+1] = y2 x[i*3+2] = y3 Base instruction -> i*3 +---+----+ / | \ ST[y1] +1 +2 <-- Roots | | ST[y2] ST[y3] There may be multiple DAGRootSets, for example: x[i*2+0] = ... (1) x[i*2+1] = ... (1) x[i*2+4] = ... (2) x[i*2+5] = ... (2) x[(i+1234)*2+5678] = ... (3) x[(i+1234)*2+5679] = ... (3) This concept is similar to the "Scale" member used previously, but allows multiple independent sets of roots based off the same induction variable. llvm-svn: 228821
* AsmParser: Validate alloca's typeDavid Majnemer2015-02-111-0/+3
| | | | | | An alloca's type should be weird things like metadata. llvm-svn: 228820
* DataLayout: Report when the preferred alignment is less than the ABIDavid Majnemer2015-02-111-0/+3
| | | | llvm-svn: 228819
* Verifier: Check for null operands in !llvm.module.flagsDavid Majnemer2015-02-112-3/+3
| | | | llvm-svn: 228818
* [X86] Split information collection from actual transformation in call frame ↵Michael Kuperstein2015-02-111-59/+100
| | | | | | | | | | | optimization This splits collecting information from actually performing the transformation, so that we can add a heuristic in between the two. NFC. Differential Revision: http://reviews.llvm.org/D7497 llvm-svn: 228817
* [PBQP] Cautiously update edge costs in the solverArnaud A. de Grandmaison2015-02-112-3/+5
| | | | | | | | | | | | | | | | | | The NodeMetadata are maintained in an incremental way. When an edge between 2 nodes has its cost updated, in the course of graph reduction for example, the NodeMetadata need first to have the old edge cost removed, then the new edge cost added. Only once the NodeMetadata have been fully updated, it becomes safe to consider promoting the nodes to the ConservativelyAllocatable or OptimallyReducible sets. Previously, this promotion was occuring right after the removing the old cost, and this was breaking the assumption that a ConservativelyAllocatable should not be spilled. This patch also adds asserts to: - enforces the invariant that a node's reduction can not be downgraded, - only not provably allocatable or optimally reducible nodes can be spilled. llvm-svn: 228816
* Verifier: Make sure !llvm.ident's operand isn't nullDavid Majnemer2015-02-111-1/+1
| | | | llvm-svn: 228815
* AsmParser: Don't crash when insertvalue has bad operandsDavid Majnemer2015-02-111-1/+6
| | | | llvm-svn: 228813
* AsmParser: Switch some vectors to mapsDavid Majnemer2015-02-112-21/+12
| | | | | | This speeds up parsing .ll files with metadata nodes with large IDs. llvm-svn: 228812
* Fix build for CMake < 2.8.12.Peter Collingbourne2015-02-111-1/+1
| | | | llvm-svn: 228810
* Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.Zachary Turner2015-02-1128-3/+87
| | | | | | | | | | This allows IDEs to recognize the entire set of header files for each of the core LLVM projects. Differential Revision: http://reviews.llvm.org/D7526 Reviewed By: Chris Bieneman llvm-svn: 228798
* InstrProf: Lower coverage mappings by setting their sections appropriatelyJustin Bogner2015-02-111-0/+41
| | | | | | | | | | | | | | | Add handling for __llvm_coverage_mapping to the InstrProfiling pass. We need to make sure the constant and any profile names it refers to are in the correct sections, which is easier and cleaner to do here where we have to know about profiling sections anyway. This is really tricky to test without a frontend, so I'm committing the test for the fix in clang. If anyone knows a good way to test this within LLVM, please let me know. Fixes PR22531. llvm-svn: 228793
* Temporary workaround to fix MSVC 2012 build problemsAndrew Kaylor2015-02-111-1/+11
| | | | llvm-svn: 228788
* Don't promote asynch EH invokes of nounwind functions to callsReid Kleckner2015-02-115-5/+32
| | | | | | | | | | | If the landingpad of the invoke is using a personality function that catches asynch exceptions, then it can catch a trap. Also add some landingpads to invalid LLVM IR test cases that lack them. Over-the-shoulder reviewed by David Majnemer. llvm-svn: 228782
* R600/SI: Store immediate offsets > 12-bits in soffsetTom Stellard2015-02-111-13/+19
| | | | | | | This will save us from having to extend these offsets to 64-bits and storing them in a pair of vgprs. llvm-svn: 228776
* R600/SI: Add soffset operand to mubuf addr64 instructionTom Stellard2015-02-115-28/+33
| | | | | | We were previously hard-coding soffset to 0. llvm-svn: 228775
* Fix some warnings due to -Wcovered-switch-default.Zachary Turner2015-02-112-8/+0
| | | | llvm-svn: 228773
* Convert std::make_unique<> to llvm::make_unique<>.Zachary Turner2015-02-102-11/+12
| | | | llvm-svn: 228768
* Fix makeLibCall argument (signed) in SoftenFloatRes_XINT_TO_FP functionPetar Jovanovic2015-02-101-1/+1
| | | | | | | | | | | | | | The isSigned argument of makeLibCall function was hard-coded to false (unsigned). This caused zero extension on MIPS64 soft float. As the result SingleSource/Benchmarks/Stanford/FloatMM test and SingleSource/UnitTests/2005-07-17-INT-To-FP test failed. The solution was to use the proper argument. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D7292 llvm-svn: 228765
* Debug Info: Support variables that are described by more than one MMIAdrian Prantl2015-02-105-35/+68
| | | | | | | | | | table entry. This happens when SROA splits up an alloca and the resulting allocas cannot be lowered to SSA values because their address is passed to a function. Fixes PR22502. llvm-svn: 228764
* Fix indentation.Adrian Prantl2015-02-101-1/+1
| | | | llvm-svn: 228763
* EarlyCSE: It isn't safe to CSE across synchronization boundariesDavid Majnemer2015-02-101-0/+3
| | | | | | This fixes PR22514. llvm-svn: 228760
* Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.Zachary Turner2015-02-1038-45/+801
| | | | | | | | | | | | | This makes llvm-pdbdump available on all platforms, although it will currently fail to create a dumper if there is no PDB reader implementation for the current platform. It implements dumping of compilands and children, which is less information than was previously available, but it has to be rewritten from scratch using the new set of interfaces, so the rest of the functionality will be added back in subsequent commits. llvm-svn: 228755
* X86: @llvm.frameaddress should defer to SelectionDAG for Win CFIDavid Majnemer2015-02-101-2/+7
| | | | llvm-svn: 228754
* [Object] Reformat the code with clang-formatSimon Atanasyan2015-02-101-6/+5
| | | | | | No functional changes. llvm-svn: 228751
* X86: Make @llvm.frameaddress work correctly with Windows unwind codesDavid Majnemer2015-02-103-5/+34
| | | | | | | | | Simply loading or storing the frame pointer is not sufficient for Windows targets. Instead, create a synthetic frame object that we will lower later. References to this synthetic object will be replaced with the correct reference to the frame address. llvm-svn: 228748
* Provide DIA implementation of DebugInfoPDB.Zachary Turner2015-02-1011-0/+1338
| | | | | | | | | | | | | | | | | This implements DebugInfoPDB when the DIA SDK is present on the system. Specifically, this means that the following conditions are met: 1) You are building on Windows. 2) You are building with MSVC. 3) Visual Studio did not corrupt the installation of DIA due to a known issue with side-by-side installations of VS2012 and VS2013. If all of these conditions are true, you will be able to pass a value of PDB_Reader::DIA to PDB::createPdbReader(). There are no tests for this yet, as any test will be in the form of a lit test which tests the llvm-pdbdump.exe, which still needs to be rewritten in terms of this library. llvm-svn: 228747
* Reformat (and remove some tabs) to make debugging this code aEric Christopher2015-02-101-4/+7
| | | | | | little easier to step through. llvm-svn: 228746
* Adding support for llvm.eh.begincatch and llvm.eh.endcatch intrinsics and ↵Andrew Kaylor2015-02-102-0/+195
| | | | | | | | beginning the documentation of native Windows exception handling. Differential Revision: http://reviews.llvm.org/D7398 llvm-svn: 228733
* DeadArgElim: arguments affect all returned sub-values by default.Tim Northover2015-02-101-4/+16
| | | | | | | | | | Unless we meet an insertvalue on a path from some value to a return, that value will be live if *any* of the return's components are live, so all of those components must be added to the MaybeLiveUses. Previously we were deleting arguments if sub-value 0 turned out to be dead. llvm-svn: 228731
* Fix up r228725, missed change in PPCSubtarget definitionBill Schmidt2015-02-101-6/+6
| | | | llvm-svn: 228728
* IR: Add MDNode::replaceWithPermanent()Duncan P. N. Exon Smith2015-02-101-0/+16
| | | | | | | | | | | | | | | | Add new API for converting temporaries that may self-reference. Self-referencing nodes are not allowed to be uniqued, so sending them into `replaceWithUniqued()` is dangerous (and this commit adds assertions that prevent it). `replaceWithPermanent()` has similar semantics to `get()` followed by calls to `replaceOperandWith()`. In particular, if there's a self-reference, it returns a distinct node; otherwise, it returns a uniqued one. Like `replaceWithUniqued()` and `replaceWithDistinct()` (well, it calls out to them) it mutates the temporary node in place if possible, only calling `replaceAllUsesWith()` on a uniquing collision. llvm-svn: 228726
* [PowerPC] Fix reverted patch r227976 to avoid register assignment issuesBill Schmidt2015-02-1011-114/+379
| | | | | | | | | | | | | | | | | | | See full discussion in http://reviews.llvm.org/D7491. We now hide the add-immediate and call instructions together in a separate pseudo-op, which is tagged to define GPR3 and clobber the call-killed registers. The PPCTLSDynamicCall pass prior to RA now expands this op into the two separate addi and call ops, with explicit definitions of GPR3 on both instructions, and explicit clobbers on the call instruction. The pass is now marked as requiring and preserving the LiveIntervals and SlotIndexes analyses, and fixes these up after the replacement sequences are introduced. Self-hosting has been verified on LE P8 and BE P7 with various optimization levels, etc. It has also been verified with the --no-tls-optimize flag workaround removed. llvm-svn: 228725
* X86: Emit Win64 SaveXMM opcodes at the right offset in the right orderDavid Majnemer2015-02-101-19/+18
| | | | | | | | | | | Walk the instructions marked FrameSetup and consider any stores of XMM registers to the stack as needing a SaveXMM opcode. This fixes PR22521. Differential Revision: http://reviews.llvm.org/D7527 llvm-svn: 228724
* [PowerPC] Support the (old) cntlz instruction aliasHal Finkel2015-02-101-0/+3
| | | | | | | Some old assembly code uses the cntlz alias for cntlzw, binutils supports this, and we should too. Fixes PR22519. llvm-svn: 228719
* [Hexagon] Adding vector load with post-increment instructions. Adding ↵Colin LeMahieu2015-02-104-4/+319
| | | | | | decoder function for 64bit control register class. llvm-svn: 228708
* [mips][microMIPS] Implement movep instructionZoran Jovanovic2015-02-107-0/+237
| | | | | | Differential Revision: http://reviews.llvm.org/D7465 llvm-svn: 228703
* Two comment typo fixes in lib/CodeGen/SelectionDAG/DAGCombiner.cpp.Jonas Paulsson2015-02-101-2/+2
| | | | llvm-svn: 228700
* [ARM] Add armv6s[-]m as an alias to armv6[-]mBradley Smith2015-02-101-2/+3
| | | | llvm-svn: 228696
* [X86][AVX2] Missing AVX2 memory folding instructionsSimon Pilgrim2015-02-101-3/+35
| | | | | | | | Added most of the missing vector folding patterns for AVX2 (as well as fixing the vpermpd and verpmq patterns) Differential Revision: http://reviews.llvm.org/D7492 llvm-svn: 228688
* Bugfix for missed dependency from store to load in buildSchedGraph().Jonas Paulsson2015-02-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: When handling underlying objects for a store, the vector of previous mem uses, mapped to the same Value, is afterwards cleared (regardless of ThisMayAlias). This means that during handling of the next store using the same Value, adjustChainDeps() must be called, otherwise a dependency might be missed. For example, three spill/reload (NonAliasing) memory accesses using the same Value 'a', with different offsets: SU(2): store @a SU(1): store @a, Offset:1 SU(0): load @a In this case we have: * SU(1) does not need a dep against SU(0). Therefore,SU(0) ends up in RejectMemNodes and is removed from the mem-uses list (AliasMemUses or NonAliasMemUses), as this list is cleared. * SU(2) needs a dep against SU(0). Therefore, SU(2) must check RejectMemNodes by calling adjustChainDeps(). Previously, for store SUs, adjustChainDeps() was only called if MayAlias was true, missing the S(2) to S(0) dependency in the case above. The fix is to always call adjustChainDeps(), regardless of MayAlias, since this applies both for AliasMemUses and NonAliasMemUses. No testcase found for any in-tree target. llvm-svn: 228686
* [X86][XOP] Added XOP memory folding patterns + testsSimon Pilgrim2015-02-101-5/+100
| | | | | | | | | | This patch adds the complete AMD Bulldozer XOP instruction set to the memory folding pattern tables for stack folding, etc. Note: Many of the XOP instructions have multiple table entries as it can fold loads from different sources. Differential Revision: http://reviews.llvm.org/D7484 llvm-svn: 228685
* [mips][microMIPS] Fix disassembling of 16-bit microMIPS instructions LWM16 ↵Jozef Kolek2015-02-102-7/+25
| | | | | | | | and SWM16 Differential Revision: http://reviews.llvm.org/D7436 llvm-svn: 228683
* [X86][FastIsel] Avoid introducing legacy SSE instructions if the target has AVX.Andrea Di Biagio2015-02-101-28/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch teaches X86FastISel how to select AVX instructions for scalar float/double convert operations. Before this patch, X86FastISel always selected legacy SSE instructions for FPExt (from float to double) and FPTrunc (from double to float). For example: \code define double @foo(float %f) { %conv = fpext float %f to double ret double %conv } \end code Before (with -mattr=+avx -fast-isel) X86FastIsel selected a CVTSS2SDrr which is legacy SSE: cvtss2sd %xmm0, %xmm0 With this patch, X86FastIsel selects a VCVTSS2SDrr instead: vcvtss2sd %xmm0, %xmm0, %xmm0 Added test fast-isel-fptrunc-fpext.ll to check both the register-register and the register-memory float/double conversion variants. Differential Revision: http://reviews.llvm.org/D7438 llvm-svn: 228682
* Revert r228556: InstCombine: propagate nonNull through assumeChandler Carruth2015-02-101-8/+1
| | | | | | | | | This commit isn't using the correct context, and is transfoming calls that are operands to loads rather than calls that are operands to an icmp feeding into an assume. I've replied on the original review thread with a very reduced test case and some thoughts on how to rework this. llvm-svn: 228677
* [X86] Preserve mem refs on newly created 'Store' node instead of 'Load' node ↵Craig Topper2015-02-101-1/+1
| | | | | | | | | | when handling store unfolding. Bug spotted by Steve King. I have no idea how to test this. llvm-svn: 228672
* [X86] Remove unnecessary alignment checks from the load folding tables.Craig Topper2015-02-101-44/+44
| | | | llvm-svn: 228671
* Teach llvm_add_library() to find include dirs.Zachary Turner2015-02-101-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since header files are not compilation units, CMake does not require you to specify them in the CMakeLists.txt file. As a result, unless a header file is explicitly added, CMake won't know about it, and when generating IDE-based projects, CMake won't put the header files into the IDE project. LLVM currently tries to deal with this in two ways: 1) It looks for all .h files that are in the project directory, and adds those. 2) llvm_add_library() understands the ADDITIONAL_HEADERS argument, which allows one to list an arbitrary list of headers. This patch takes things one step further. It adds the ability for llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which will specify a list of folders which CMake will glob for header files. Furthermore, it will glob not only for .h files, but also for .inc files. Included in this CL is an update to one of the existing users of ADDITIONAL_HEADERS to use this new argument instead, to serve as an illustration of how this cleans up the CMake. The big advantage of this new approach is that until now, there was no way for the IDE projects to locate the header files that are in the include tree. In other words, if you are in, for example, lib/DebugInfo/DWARF, the corresponding includes for this project will be located under include/llvm/DebugInfo/DWARF. Now, in the CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write: ADDITIONAL_HEADER_DIRS ../../include/llvm/DebugInfo/DWARF as an argument to llvm_add_library(), and all header files will get added to the IDE project. Differential Revision: http://reviews.llvm.org/D7460 Reviewed By: Chris Bieneman llvm-svn: 228670
OpenPOWER on IntegriCloud