summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [DAGCombiner] Don't add volatile or indexed stores to ChainedStoresJunmo Park2016-01-281-0/+4
| | | | | | | | | | | | Summary: findBetterNeighborChains does not handle volatile or indexed stores. However, it did not check when adding stores to ChainedStores. Reviewers: arsenm Differential Revision: http://reviews.llvm.org/D16463 llvm-svn: 259024
* WebAssembly: fix buildJF Bastien2016-01-281-1/+1
| | | | | | r259016 didn't also revert r258957 which broken the WebAssembly build. llvm-svn: 259020
* SmallPtrSet: Make destructor available for inliningMatthias Braun2016-01-281-5/+0
| | | | llvm-svn: 259019
* SmallPtrSet: Share some code between copy/move constructor/assignment operatorMatthias Braun2016-01-281-33/+13
| | | | llvm-svn: 259018
* SmallPtrSet: Remove trailing whitespace, fix indentationMatthias Braun2016-01-281-13/+13
| | | | llvm-svn: 259017
* Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported ↵NAKAMURA Takumi2016-01-2811-63/+210
| | | | | | | | | | | features" It broke layering violation in LLVMIR. clang r258950 "Add backend dignostic printer for unsupported features" llvm r258951 "Refactor backend diagnostics for unsupported features" llvm-svn: 259016
* [WebAssembly] Don't stackify a register def past a get_local use in the same ↵Dan Gohman2016-01-281-1/+13
| | | | | | tree. llvm-svn: 259013
* Minor code formatting cleanup. NFC.Junmo Park2016-01-281-1/+1
| | | | llvm-svn: 259010
* [WebAssembly] Enhanced register stackificationDan Gohman2016-01-285-75/+361
| | | | | | | | | | | This patch revamps the RegStackifier pass with a new tree traversal mechanism, enabling three major new features: - Stackification of values with multiple uses, using the result value of set_local - More aggressive stackification of instructions with side effects - Reordering operands in commutative instructions to enable more stackification. llvm-svn: 259009
* Minor style cleanup of CFLAA. NFC.George Burgess IV2016-01-281-6/+11
| | | | llvm-svn: 259008
* less indenting; NFCISanjay Patel2016-01-281-107/+109
| | | | llvm-svn: 259002
* [TTI] Add getPrefetchDistance from PPCLoopDataPrefetch, NFCAdam Nemet2016-01-274-7/+16
| | | | | | | | | | | This patch is part of the work to make PPCLoopDataPrefetch target-independent (http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758). As it was discussed in the above thread, getPrefetchDistance is currently using instruction count which may change in the future. llvm-svn: 258995
* Tweak unnamed label syntax in textual IR for easier matching in tests.Evgeniy Stepanov2016-01-271-1/+1
| | | | | | | | | | | Change the unnamed label comments like ; <label>:8 ; preds = %1 to ; <label>:8: ; preds = %1 This way lit tests can match [[LABEL]]: in both asserts and no-asserts builds. llvm-svn: 258993
* [WebAssembly] Implement byval argumentsDerek Schuff2016-01-272-73/+22
| | | | | | | | | | Summary: Just does the simple allocation of a stack object and passes a pointer to the callee. Differential Revision: http://reviews.llvm.org/D16610 llvm-svn: 258989
* ARMv7k: base ABI decision on v7k Arch rather than watchos OS.Tim Northover2016-01-276-8/+9
| | | | | | | | Various bits we want to use the new ABI actually compile with "-arch armv7k -miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how slices work. llvm-svn: 258975
* One more batch of self-containing headers.Benjamin Kramer2016-01-2713-14/+20
| | | | llvm-svn: 258974
* Don't put classes in headers into anonymous namespaces.Benjamin Kramer2016-01-275-12/+11
| | | | | | You want ODR violations? That's how you get ODR violations. llvm-svn: 258973
* [SimplifyCFG] limit recursion depth when speculating instructions (PR26308)Sanjay Patel2016-01-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for: https://llvm.org/bugs/show_bug.cgi?id=26308 With the switch to using the TTI cost model in: http://reviews.llvm.org/rL228826 ...it became possible to hit a zero-cost cycle of instructions (gep -> phi -> gep...), so we need a cap for the recursion in DominatesMergePoint(). A recursion depth parameter was already added for a different reason in: http://reviews.llvm.org/rL255660 ...so we can just set a limit for it. I pulled "10" out of the air and made it an independent parameter that we can play with. It might be higher than it needs to be given the currently low default value of PHINodeFoldingThreshold (2). That's the starting cost value that we enter the recursion with, and most instructions have cost set to TCC_Basic (1), so I don't think we're going to speculate more than 2 instructions with the current parameters. As noted in the review and the TODO comment, we can do better than just limiting recursion depth. Differential Revision: http://reviews.llvm.org/D16637 llvm-svn: 258971
* Add support for objc_unsafeClaimAutoreleasedReturnValue to theJohn McCall2016-01-272-16/+30
| | | | | | | | | | | | | | | | ObjC ARC Optimizer. The main implication of this is: 1. Ensuring that we treat it conservatively in terms of optimization. 2. We put the ASM marker on it so that the runtime can recognize objc_unsafeClaimAutoreleasedReturnValue from releaseRV. <rdar://problem/21567064> Patch by Michael Gottesman! llvm-svn: 258970
* Unbreak wasm build after r258951.Benjamin Kramer2016-01-271-1/+1
| | | | llvm-svn: 258957
* Make more headers self-contained.Benjamin Kramer2016-01-273-0/+5
| | | | | | A lot of this comes from the new complete type requirement of DenseMap. llvm-svn: 258956
* Refactor backend diagnostics for unsupported featuresOliver Stannard2016-01-2711-210/+63
| | | | | | | | | | | | | | | | | | | | | The BPF and WebAssembly backends had identical code for emitting errors for unsupported features, and AMDGPU had very similar code. This merges them all into one DiagnosticInfo subclass, that can be used by any backend. There should be minimal functional changes here, but some AMDGPU tests have been updated for the new format of errors (it used a slightly different format to BPF and WebAssembly). The AMDGPU error messages will now benefit from having precise source locations when debug info is available. The implementation of DiagnosticInfoUnsupported::print must be in lib/Codegen rather than in the existing file in lib/IR/ to avoid introducing a dependency from IR to CodeGen. Differential Revision: http://reviews.llvm.org/D16590 llvm-svn: 258951
* [IndVars] Hoist DataLayout load out of loop; NFCSanjoy Das2016-01-271-2/+2
| | | | llvm-svn: 258946
* [IndVars] Use isSCEVable; NFCSanjoy Das2016-01-271-2/+1
| | | | llvm-svn: 258945
* [IndVars] Use range-for; NFCSanjoy Das2016-01-271-3/+1
| | | | llvm-svn: 258944
* Move SafeStack to CodeGen.Benjamin Kramer2016-01-275-21/+21
| | | | | | | It depends on the target machinery, that's not available for instrumentation passes. llvm-svn: 258942
* Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to ↵Benjamin Kramer2016-01-2720-62/+60
| | | | | | | | CodeGen/ It's a SelectionDAG thing, not a Target thing. llvm-svn: 258939
* Move passes that live in lib/CodeGen out of Scalar.hBenjamin Kramer2016-01-271-1/+1
| | | | llvm-svn: 258938
* Make some headers self-contained, remove unused includes that violate layering.Benjamin Kramer2016-01-275-5/+0
| | | | llvm-svn: 258937
* AMDGPU/SI: Fix commuting of 32-bit VOPC instructionsTom Stellard2016-01-271-2/+4
| | | | | | | | | | | | | | | | Summary: We didn't have entries in the commuting table for the 32-bit instructions. I don't think we hit this problem now, but we will once uniform branching is enabled. Tests will come in a later commit. Reviewers: arsenm Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D16600 llvm-svn: 258936
* [DebugInfo] Support zero-length CIE in the _eh_frame parserIgor Laevsky2016-01-271-30/+27
| | | | | | | | | | | | MCJIT emits zero-length CIE at the end of the _eh_frame section. This change ensures that parser inside DebugInfo will not crash and correctly record such cases. We are now recording DW_EH_PE_omit as a default value for FDE and LSDA encodings. Also Offset != EndAugmentationOffset assertion check will only happen if augmentation string had 'z' letter in it. Differential Revision: http://reviews.llvm.org/D16588 llvm-svn: 258931
* Reapply commit r258404 with fixMatthew Simpson2016-01-271-11/+226
| | | | | | | | | | | | | | This patch is the second attempt to reapply commit r258404. There was bug in the initial patch and subsequent fix (mentioned below). The initial patch caused an assertion because we were computing smaller type sizes for instructions that cannot be demoted. The fix first determines the instructions that will be demoted, and then applies the smaller type size to only those instructions. This should fix PR26239 and PR26307. llvm-svn: 258929
* Revert "Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed."Benjamin Kramer2016-01-272-113/+48
| | | | | | | | | and "Add a missing test case for r258847." This reverts commit r258847, r258848. Causes miscompilations and backend errors. llvm-svn: 258927
* AMDGPU/SI: Stoney has only 16 LDS banksMarek Olsak2016-01-272-6/+8
| | | | | | | | | | | | | | Summary: This is a candidate for stable, along with all patches that add the "stoney" processor. Reviewers: tstellarAMD Subscribers: arsenm Differential Revision: http://reviews.llvm.org/D16485 llvm-svn: 258922
* Move MCTargetAsmParser.h to llvm/MC/MCParser where it belongs.Benjamin Kramer2016-01-2717-30/+30
| | | | llvm-svn: 258917
* AVX512: Fix vpmovzxbw predicate for AVX1/2 instructions. Igor Breger2016-01-271-27/+46
| | | | | | Differential Revision: http://reviews.llvm.org/D16595 llvm-svn: 258915
* AVX512: Add store mask patterns.Igor Breger2016-01-272-28/+32
| | | | | | Differential Revision: http://reviews.llvm.org/D16596 llvm-svn: 258914
* [IndVarSimplify] Rewrite loop exit values with their initial values from ↵Chen Li2016-01-271-0/+80
| | | | | | | | | | | | | | | | | | | | | | loop preheader Summary: This is a revised version of D13974, and the following quoted summary are from D13974 "This patch adds support to check if a loop has loop invariant conditions which lead to loop exits. If so, we know that if the exit path is taken, it is at the first loop iteration. If there is an induction variable used in that exit path whose value has not been updated, it will keep its initial value passing from loop preheader. We can therefore rewrite the exit value with its initial value. This will help remove phis created by LCSSA and enable other optimizations like loop unswitch." D13974 was committed but failed one lnt test. The bug was that we only checked the condition from loop exit's incoming block was a loop invariant. But there could be another condition from loop header to that incoming block not being a loop invariant. This would produce miscompiled code. This patch fixes the issue by checking if the incoming block is loop header, and if not, don't perform the rewrite. The could be further improved by recursively checking all conditions leading to loop exit block, but I'd like to check in this simple version first and improve it with future patches. Reviewers: sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16570 llvm-svn: 258912
* [SLPVectorizer] Swap the checking order of isCommutative and isConsecutiveAccessHaicheng Wu2016-01-271-4/+4
| | | | | | NFC llvm-svn: 258909
* SmallPtrSet: Inline the part of insert_imp in the small caseMatthias Braun2016-01-271-16/+1
| | | | | | | | | | Most of the time we only hit the small case, so it is beneficial to pull it out of the insert_imp() implementation. This improves compile time at least for non-LTO builds. Differential Revision: http://reviews.llvm.org/D16619 llvm-svn: 258908
* Revert "Revert "[SimplifyCFG] allow speculation of exactly one expensive ↵David Majnemer2016-01-271-4/+19
| | | | | | | | | instruction (PR24818)"" This reverts commit r258903 which reverted r255660. r258903 was an accidental commit and should not have been committed. llvm-svn: 258905
* [SimplifyCFG] Don't mistake icmp of and for a tree of comparisonsDavid Majnemer2016-01-271-2/+3
| | | | | | | | | | | | | | | | SimplifyCFG tries to turn complex branch conditions into a switch. Some of it's logic attempts to reason about bitwise arithmetic produced by InstCombine. InstCombine can turn things like (X == 2) || (X == 3) into (X & 1) == 2 and so SimplifyCFG tries to detect when this occurs so that it can produce a switch instruction. However, the legality checking was not sufficient to determine whether or not this had occured. Correctly check this case by requiring that the right-hand side of the comparison be a power of two. This fixes PR26323. llvm-svn: 258904
* Revert "[SimplifyCFG] allow speculation of exactly one expensive instruction ↵David Majnemer2016-01-271-19/+4
| | | | | | | | (PR24818)" This reverts commit r255660. llvm-svn: 258903
* AMDGPU: Fix default device handlingMatt Arsenault2016-01-273-11/+17
| | | | | | | | | | | | | | | | | | | When no device name is specified, default to kaveri for HSA since SI is not supported and it woud fail. Default to "tahiti" instead of "SI" since these are effectively the same, and tahiti is an actual device. Move default device handling to the TargetMachine rather than the AMDGPUSubtarget. The module ISA version is computed from the device name provided with the target machine, so the attributes printed by the AsmPrinter were inconsistent with those computed in the subtarget. Also remove DevName field from subtarget since it's redundant with getCPU() in the superclass. llvm-svn: 258901
* [cmake] Remove /Og- flag which was working around PR24785Reid Kleckner2016-01-271-8/+0
| | | | | | With r258897, MSVC 2013 now successfully compiles Function.cpp. llvm-svn: 258899
* [llvm-tblgen] Avoid StringMatcher for GCC and MS builtin namesReid Kleckner2016-01-271-6/+1
| | | | | | | | | | | | | | | This brings the compile time of Function.cpp from ~40s down to ~4s for me locally. It also shaves off about 400KB of object file size in a release+asserts build. I also realized that the AMDGPU backend does not have any GCC builtin names to match, so the extra lookup was a no-op. I removed it to silence a zero-length string table array warning. There should be no functional change here. This change really ends the story of PR11951. llvm-svn: 258897
* Disable all standard lib functions for NVVM.Justin Lebar2016-01-261-0/+14
| | | | | | | | | | | | | | | | | Summary: NVVM doesn't have a standard library, as currently implemented, so this just isn't going to work. I'd like to revisit this, since it's hiding opportunities for optimization, but correctness comes first. Thank you to hfinkel for pointing me in the right direction here. Reviewers: tra Subscribers: echristo, jhen, llvm-commits, hfinkel Differential Revision: http://reviews.llvm.org/D16604 llvm-svn: 258884
* Fix identify_magic() to check that a file that starts with MH_MAGIC isKevin Enderby2016-01-261-2/+15
| | | | | | | | | | | | at least as big as the mach header to be identified as a Mach-O file and make sure smaller files are not identified as a Mach-O files but as unknown files. Also fix identify_magic() so it looks at all 4 bytes of the filetype field when determining the type of the Mach-O file. Then fix the macho-invalid-header test case to check that it is an unknown file and make sure it does not get the error for object_error::parse_failed. And also update the unit tests. llvm-svn: 258883
* [GVN] Split AvailableValueInBlock into two parts [NFC]Philip Reames2016-01-261-29/+69
| | | | | | | | AvailableValue is the part that represents the potential rematerialization. AvailableValueInBlock is simply a pair of an AvailableValue and a BB which we might materialize it in. This is motivated by http://reviews.llvm.org/D16608. The intent is that we'll have a single function which handles the local case which both local and non-local will use to identify available values. Once that's done, the local case can rematerialize at the use site and the non-local case can do the SSA construction as it does currently. llvm-svn: 258882
* [PGO] allow pgo name collector to disable compression (for testing)/NFCXinliang David Li2016-01-261-2/+3
| | | | llvm-svn: 258876
OpenPOWER on IntegriCloud