summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* If we see UTF-8 BOM sequence at the beginning of a response file, we shallYunzhong Gao2015-01-241-0/+12
| | | | | | | | remove these bytes before parsing. Phabricator Revision: http://reviews.llvm.org/D7156 llvm-svn: 226988
* [PM] Port instcombine to the new pass manager!Chandler Carruth2015-01-243-143/+65
| | | | | | | | | | | | | | | | | | | | This is exciting as this is a much more involved port. This is a complex, existing transformation pass. All of the core logic is shared between both old and new pass managers. Only the access to the analyses is separate because the actual techniques are separate. This also uses a bunch of different and interesting analyses and is the first time where we need to use an analysis across an IR layer. This also paves the way to expose instcombine utility functions. I've got a static function that implements the core pass logic over a function which might be mildly interesting, but more interesting is likely exposing a routine which just uses instructions *already in* the worklist and combines until empty. I've switched one of my favorite instcombine tests to run with both as well to make sure this keeps working. llvm-svn: 226987
* [Bitcode] Diagnose errors instead of asserting from bad inputFilipe Cabecinhas2015-01-241-1/+5
| | | | | | | | | | | | | | | Eventually we can make some of these pass the error along to the caller. Reports a fatal error if: We find an invalid abbrev record We try to get an invalid abbrev number We can't fill the current word due to an EOF Fixed an invalid bitcode test to check for output with FileCheck Bugs found with afl-fuzz llvm-svn: 226986
* [PM] Rework how the TargetLibraryInfo pass integrates with the new passChandler Carruth2015-01-243-21/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | manager to support the actual uses of it. =] When I ported instcombine to the new pass manager I discover that it didn't work because TLI wasn't available in the right places. This is a somewhat surprising and/or subtle aspect of the new pass manager design that came up before but I think is useful to be reminded of: While the new pass manager *allows* a function pass to query a module analysis, it requires that the module analysis is already run and cached prior to the function pass manager starting up, possibly with a 'require<foo>' style utility in the pass pipeline. This is an intentional hurdle because using a module analysis from a function pass *requires* that the module analysis is run prior to entering the function pass manager. Otherwise the other functions in the module could be in who-knows-what state, etc. A somewhat surprising consequence of this design decision (at least to me) is that you have to design a function pass that leverages a module analysis to do so as an optional feature. Even if that means your function pass does no work in the absence of the module analysis, you have to handle that possibility and remain conservatively correct. This is a natural consequence of things being able to invalidate the module analysis and us being unable to re-run it. And it's a generally good thing because it lets us reorder passes arbitrarily without breaking correctness, etc. This ends up causing problems in one case. What if we have a module analysis that is *definitionally* impossible to invalidate. In the places this might come up, the analysis is usually also definitionally trivial to run even while other transformation passes run on the module, regardless of the state of anything. And so, it follows that it is natural to have a hard requirement on such analyses from a function pass. It turns out, that TargetLibraryInfo is just such an analysis, and InstCombine has a hard requirement on it. The approach I've taken here is to produce an analysis that models this flexibility by making it both a module and a function analysis. This exposes the fact that it is in fact safe to compute at any point. We can even make it a valid CGSCC analysis at some point if that is useful. However, we don't want to have a copy of the actual target library info state for each function! This state is specific to the triple. The somewhat direct and blunt approach here is to turn TLI into a pimpl, with the state and mutators in the implementation class and the query routines primarily in the wrapper. Then the analysis can lazily construct and cache the implementations, keyed on the triple, and on-demand produce wrappers of them for each function. One minor annoyance is that we will end up with a wrapper for each function in the module. While this is a bit wasteful (one pointer per function) it seems tolerable. And it has the advantage of ensuring that we pay the absolute minimum synchronization cost to access this information should we end up with a nice parallel function pass manager in the future. We could look into trying to mark when analysis results are especially cheap to recompute and more eagerly GC-ing the cached results, or we could look at supporting a variant of analyses whose results are specifically *not* cached and expected to just be used and discarded by the consumer. Either way, these seem like incremental enhancements that should happen when we start profiling the memory and CPU usage of the new pass manager and not before. The other minor annoyance is that if we end up using the TLI in both a module pass and a function pass, those will be produced by two separate analyses, and thus will point to separate copies of the implementation state. While a minor issue, I dislike this and would like to find a way to cleanly allow a single analysis instance to be used across multiple IR unit managers. But I don't have a good solution to this today, and I don't want to hold up all of the work waiting to come up with one. This too seems like a reasonable thing to incrementally improve later. llvm-svn: 226981
* [AArch64][LoadStoreOptimizer] Form LDPSW when possible.Quentin Colombet2015-01-241-1/+15
| | | | | | | | | This patch adds the missing LD[U]RSW variants to the load store optimizer, so that we generate LDPSW when possible. <rdar://problem/19583480> llvm-svn: 226978
* [x86] Fix a commentBruno Cardoso Lopes2015-01-241-1/+1
| | | | llvm-svn: 226974
* R600/SI: Emit .hsa.version section for amdhsa OSTom Stellard2015-01-231-1/+13
| | | | llvm-svn: 226970
* Fix assertion when C++ EH filters are present in functions using SEHReid Kleckner2015-01-231-2/+2
| | | | | | Should fix PR22305. llvm-svn: 226969
* Address more review comments for DIExpression::iterator.Adrian Prantl2015-01-232-11/+16
| | | | | | | | - input_iterator - define an operator-> - make constructors private were possible llvm-svn: 226967
* llvm-cov: Don't use llvm::outs() in library codeJustin Bogner2015-01-231-41/+43
| | | | | | | Nothing in lib/ should be using llvm::outs() directly. Thread it in from the caller instead. llvm-svn: 226961
* llvm-cov: Use range-for (NFC)Justin Bogner2015-01-231-49/+21
| | | | llvm-svn: 226960
* [x86] Combine x86mmx/i64 to v2i64 conversion to use scalar_to_vectorBruno Cardoso Lopes2015-01-231-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle the poor codegen for i64/x86xmm->v2i64 (%mm -> %xmm) moves. Instead of using stack store/load pair to do the job, use scalar_to_vector directly, which in the MMX case can use movq2dq. This was the current behavior prior to improvements for vector legalization of extloads in r213897. This commit fixes the regression and as a side-effect also remove some unnecessary shuffles. In the new attached testcase, we go from: pshufw $-18, (%rdi), %mm0 movq %mm0, -8(%rsp) movq -8(%rsp), %xmm0 pshufd $-44, %xmm0, %xmm0 movd %xmm0, %eax ... To: pshufw $-18, (%rdi), %mm0 movq2dq %mm0, %xmm0 movd %xmm0, %eax ... Differential Revision: http://reviews.llvm.org/D7126 rdar://problem/19413324 llvm-svn: 226953
* llvm-cov: clang-format the GCOV files (NFC)Justin Bogner2015-01-231-85/+133
| | | | llvm-svn: 226952
* Fix the MSVC build with the new Orc JIT APIsReid Kleckner2015-01-231-2/+2
| | | | llvm-svn: 226949
* [Orc] Remove a bunch of constructors from ObjectLinkingLayer.Lang Hames2015-01-231-1/+2
| | | | | | | These constructors were causing trouble for MSVC and older GCCs. This should fix more of the build failures from r226940. llvm-svn: 226946
* R600/SI: Move i64 -> v2i32 load promotion into AMDGPUDAGToDAGISel::Select()Tom Stellard2015-01-232-3/+22
| | | | | | | | | | | We used to do this promotion during DAG legalization, but this caused an infinite loop in ExpandUnalignedLoad() because it assumed that i64 loads were legal if i64 was a legal type. It also seems better to report i64 loads as legal, since they actually are and we were just promoting them to simplify our tablegen files. llvm-svn: 226945
* [Object][ELF] Test unknown type.Michael J. Spencer2015-01-232-1/+2
| | | | llvm-svn: 226943
* [YAMLIO] Add support for numeric values in enums.Michael J. Spencer2015-01-231-0/+14
| | | | llvm-svn: 226942
* [Orc] LLVMLinkInOrcMCJITReplacement shouldn't be in the anonymous namespace.Lang Hames2015-01-231-1/+2
| | | | | | This should fix some of the builder errors from r226940. llvm-svn: 226941
* [Orc] New JIT APIs.Lang Hames2015-01-2314-8/+886
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new set of JIT APIs to LLVM. The aim of these new APIs is to cleanly support a wider range of JIT use cases in LLVM, and encourage the development and contribution of re-usable infrastructure for LLVM JIT use-cases. These APIs are intended to live alongside the MCJIT APIs, and should not affect existing clients. Included in this patch: 1) New headers in include/llvm/ExecutionEngine/Orc that provide a set of components for building JIT infrastructure. Implementation code for these headers lives in lib/ExecutionEngine/Orc. 2) A prototype re-implementation of MCJIT (OrcMCJITReplacement) built out of the new components. 3) Minor changes to RTDyldMemoryManager needed to support the new components. These changes should not impact existing clients. 4) A new flag for lli, -use-orcmcjit, which will cause lli to use the OrcMCJITReplacement class as its underlying execution engine, rather than MCJIT itself. Tests to follow shortly. Special thanks to Michael Ilseman, Pete Cooper, David Blaikie, Eric Christopher, Justin Bogner, and Jim Grosbach for extensive feedback and discussion. llvm-svn: 226940
* Move the accessor functions from DIExpression::iterator into a wrapperAdrian Prantl2015-01-232-12/+11
| | | | | | | | DIExpression::Operand, so we can write range-based for loops. Thanks to David Blaikie for the idea. llvm-svn: 226939
* [mips] fix spelling of 'disassembler'Alexei Starovoitov2015-01-231-3/+3
| | | | | | trivial first commit llvm-svn: 226935
* LowerSwitch: replace unreachable default with popular case destinationHans Wennborg2015-01-231-63/+135
| | | | | | | | | | | | SimplifyCFG currently does this transformation, but I'm planning to remove that to allow other passes, such as this one, to exploit the unreachable default. This patch takes care to keep track of what case values are unreachable even after the transformation, allowing for more efficient lowering. Differential Revision: http://reviews.llvm.org/D6697 llvm-svn: 226934
* Classify functions by EH personality type rather than using the tripleReid Kleckner2015-01-238-17/+32
| | | | | | | | | | | | | | | This mostly reverts commit r222062 and replaces it with a new enum. At some point this enum will grow at least for other MSVC EH personalities. Also beefs up the way we were sniffing the personality function. Previously we would emit the Itanium LSDA despite using __C_specific_handler. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D6987 llvm-svn: 226920
* Debug Info / PR22309: Allow union types to be emitted as unsigned constants.Adrian Prantl2015-01-231-1/+2
| | | | llvm-svn: 226919
* Remove some local variables in place of just querying for themEric Christopher2015-01-231-6/+4
| | | | | | in the couple of asserts. llvm-svn: 226917
* [mips] Add new error message and improve testing for parsing the .module ↵Toma Tabacu2015-01-231-26/+27
| | | | | | | | | | | | | | | | | | | | | | | directive. Summary: We used to silently ignore any empty .module's and we used to give an error saying that we found an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number). We now give an error saying that we "expected .module option identifier" in both of those cases. I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7095 llvm-svn: 226905
* This patch fixes issue with lowering below mentioned pattern :-Jyoti Allur2015-01-231-7/+10
| | | | | | | | | | | | | | | | | | _foo: smull r0, r1, r1, r0 smull r2, r3, r3, r2 adds r0, r2, r0 adc r1, r3, r1 bx lr to _foo: smull r0, r1, r1, r0 smlal r0, r1, r3, r2 bx lr llvm-svn: 226904
* [x86] Change u8imm operands to always print as unsigned. This makes shuffle ↵Craig Topper2015-01-235-0/+15
| | | | | | masks and the like make way more sense. llvm-svn: 226902
* DAGCombine: always constant fold FMA when target disable FP exceptionsMehdi Amini2015-01-231-1/+1
| | | | | | | | | | | | | | | | | Summary: When trying to constant fold an FMA in the DAG, getNode() fails to fold the FMA if an operand is not finite. In this case this patch allows the constant folding if !TLI->hasFloatingPointExceptions() Reviewers: resistor Reviewed By: resistor Subscribers: hfinkel, llvm-commits Differential Revision: http://reviews.llvm.org/D6912 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 226901
* [X86] Add IntrNoMem to the AVX512 conflict intrinsics.Craig Topper2015-01-231-1/+9
| | | | llvm-svn: 226897
* Add STB_GNU_UNIQUE to the ELF writer.Rafael Espindola2015-01-232-3/+9
| | | | | | This lets llvm-mc assemble files produced by gcc. llvm-svn: 226895
* Reformat.NAKAMURA Takumi2015-01-231-3/+2
| | | | llvm-svn: 226888
* MipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]NAKAMURA Takumi2015-01-231-3/+2
| | | | llvm-svn: 226887
* R600: Try to use lower types for 64bit division if possibleJan Vesely2015-01-222-13/+39
| | | | | | | | v2: add and enable tests for SI Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 226881
* SelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENTJan Vesely2015-01-221-0/+30
| | | | | | | | | | | | v2: use getZExtValue add missing break codestyle v3: add few more comments Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 226880
* R600: Simplify LowerUDIVREMJan Vesely2015-01-221-19/+11
| | | | | | | | | | | optimizations can handle removing the Hi part operations. The generated code is identical for R600, ~10% icount reduction for SI v2: rebase Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 226879
* IR: Change GenericDwarfNode::getHeader() to StringRefDuncan P. N. Exon Smith2015-01-222-8/+6
| | | | | | | Simplify the API to use a `StringRef` directly rather than exposing the `MDString` bits underneath. llvm-svn: 226876
* IR: DwarfNode => DebugNode, NFCDuncan P. N. Exon Smith2015-01-224-24/+24
| | | | | | | | | These things are potentially used for non-DWARF data (see the discussion in PR22235), so take the `Dwarf` out of the name. Since the new name gives fewer clues, update the doxygen to properly describe what they are. llvm-svn: 226874
* [X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.Simon Pilgrim2015-01-221-2/+5
| | | | | | | | Minor tweak now that D7042 is complete, we can enable stack folding for (V)MOVDDUP and do proper testing. Added missing AVX ymm folding patterns and fixed alignment for AVX VMOVSLDUP / VMOVSHDUP. llvm-svn: 226873
* [PM] Actually add the new pass manager support for the assumption cache.Chandler Carruth2015-01-221-0/+15
| | | | | | | | | | | | | | | I had already factored this analysis specifically to enable doing this, but hadn't actually committed the necessary wiring to get at this from the new pass manager. This also nicely shows how the separate cache object can be directly managed by the new pass manager. This analysis didn't have any direct tests and so I've added a printer pass and a boring test case. I chose to print the i1 value which is being assumed rather than the call to llvm.assume as that seems much more useful for testing... but suggestions on an even better printing strategy welcome. My main goal was to make sure things actually work. =] llvm-svn: 226868
* Remove dead leak detector parts that fell out of use in r224703.Benjamin Kramer2015-01-223-109/+1
| | | | llvm-svn: 226867
* IR: Update references to temporaries before deletingDuncan P. N. Exon Smith2015-01-221-0/+1
| | | | | | | | | | | | | | | | During `MDNode::deleteTemporary()`, call `replaceAllUsesWith(nullptr)` to update all tracking references to `nullptr`. This fixes PR22280, where inverted destruction order between tracking references and the temporaries themselves caused a use-after-free in `LLParser`. An alternative fix would be to add an assertion that there are no users, and continue to fix inverted destruction order in clients (like `LLParser`), but instead I decided to make getting-teardown-right easy. (If someone disagrees let me know.) llvm-svn: 226866
* Refactoring cl::parser construction and initialization.Chris Bieneman2015-01-221-2/+2
| | | | | | | | | | | | | | | Summary: Some parsers need references back to the option they are members of. This is used for handling the argument string as well as by the various pass name parsers for making pass names into flags. Making parsers that need to refer back to the option have a reference to the option eliminates some of the members of various parsers, and enables further code cleanup. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7131 llvm-svn: 226864
* Intrinsics: introduce llvm_any_ty aka ValueType AnyRamkumar Ramachandra2015-01-225-13/+9
| | | | | | | | | | | | | | | Specifically, gc.result benefits from this greatly. Instead of: gc.result.int.* gc.result.float.* gc.result.ptr.* ... We now have a gc.result.* that can specialize to literally any type. Differential Revision: http://reviews.llvm.org/D7020 llvm-svn: 226857
* Revert "Don't remove a landing pad if the invoke requires a table entry."Reid Kleckner2015-01-221-17/+3
| | | | | | | | | | | | This reverts commit r176827. Björn Steinbrink pointed out that this didn't actually fix the bug (PR15555) it was attempting to fix. With this reverted, we can now remove landingpad cleanups that immediately resume unwinding, converting the invoke to a call. llvm-svn: 226850
* merge consecutive stores of extracted vector elements (PR21711)Sanjay Patel2015-01-221-92/+162
| | | | | | | | | | | | | | | | | | This is a 2nd try at the same optimization as http://reviews.llvm.org/D6698. That patch was checked in at r224611, but reverted at r225031 because it caused a failure outside of the regression tests. The cause of the crash was not recognizing consecutive stores that have mixed source values (loads and vector element extracts), so this patch adds a check to bail out if any store value is not coming from a vector element extract. This patch also refactors the shared logic of the constant source and vector extracted elements source cases into a helper function. Differential Revision: http://reviews.llvm.org/D6850 llvm-svn: 226845
* Revert "PR21408: Workaround the appearance of duplicate variables due to ↵David Blaikie2015-01-221-6/+1
| | | | | | | | | | | problems when inlining two calls to the same function from the same call site." The underlying bug has been fixed in r226736 so there's no need to workaround this anymore. This reverts commit r220923. llvm-svn: 226842
* AArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.Tim Northover2015-01-221-42/+35
| | | | | | | | | | | | Currently, we're adding a uint64_t describing the current subtarget so that matching can check whether the specified register is valid. However, we want to move to a bitset for those bits (x86 has more than 64 of them). This can't live in a union so it's probably better to do the checks early (especially as there are only 3 of them). llvm-svn: 226841
* Rewrite DIExpression::printInternal() to use the iterator interface.Adrian Prantl2015-01-221-9/+5
| | | | | | NFC. llvm-svn: 226836
OpenPOWER on IntegriCloud