summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
* [SCEV] Opportunistically interpret unsigned constraints as signedSanjoy Das2015-10-221-0/+13
| | | | | | | | | | | | | | | Summary: An unsigned comparision is equivalent to is corresponding signed version if both the operands being compared are positive. Teach SCEV to use this fact when profitable. Reviewers: atrick, hfinkel, reames, nlewycky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13687 llvm-svn: 251051
* [SCEV] Teach SCEV some axioms about non-wrapping arithmeticSanjoy Das2015-10-221-0/+8
| | | | | | | | | | | | | | | | | | | Summary: - A s< (A + C)<nsw> if C > 0 - A s<= (A + C)<nsw> if C >= 0 - (A + C)<nsw> s< A if C < 0 - (A + C)<nsw> s<= A if C <= 0 Right now `C` needs to be a constant, but we can later generalize it to be a non-constant if needed. Reviewers: atrick, hfinkel, reames, nlewycky Subscribers: sanjoy, llvm-commits Differential Revision: http://reviews.llvm.org/D13686 llvm-svn: 251050
* Avoid storing a second copy of each string in StringTableBuilder.Rafael Espindola2015-10-221-12/+4
| | | | | | This was only use in the extremely uncommon case of @@@ symbols on ELF. llvm-svn: 251039
* MachineScheduler: Add a way to disable the 'ReduceLatency' heuristicMatthias Braun2015-10-221-1/+5
| | | | llvm-svn: 251037
* CodeGen: increase bits allocated for LegalizeActionsTim Northover2015-10-221-11/+12
| | | | | | | | | | | The array handling CondCodes only allocated 2 bits to describe the desired action for each type. The new addition of a "LibCall" option overflowed this and caused corruption for Custom actions. No in-tree targets have a Custom CondCodeAction, so unfortunately it can't be tested. llvm-svn: 251033
* Change makeLibCall to take an ArrayRef<SDValue> instead of pointer and size. ↵Craig Topper2015-10-221-3/+3
| | | | | | This removes the need to pass a hardcoded size in many places. NFC llvm-svn: 251032
* Use ArrayRef instead of pointer and size. NFCCraig Topper2015-10-221-6/+6
| | | | llvm-svn: 251029
* [X86][AVX512] extend vcvtph2ps to support xmm/ymm and sae versionsAsaf Badouh2015-10-221-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D13945 llvm-svn: 251018
* [ValueTracking] Add a new predicate: isKnownNonEqual()James Molloy2015-10-221-0/+7
| | | | | | | | | | | | | | isKnownNonEqual(A, B) returns true if it can be determined that A != B. At the moment it only knows two facts, that a non-wrapping add of nonzero to a value cannot be that value: A + B != A [where B != 0, addition is nsw or nuw] and that contradictory known bits imply two values are not equal. This patch also hooks this up to InstSimplify; InstSimplify had a peephole for the first fact but not the second so this teaches InstSimplify a new trick too (alas no measured performance impact!) llvm-svn: 251012
* [IR] Add a `makeNoWrapRegion` method to `ConstantRange`Sanjoy Das2015-10-221-0/+11
| | | | | | | | | | | | Summary: This will be used in a future change to ScalarEvolution. Reviewers: hfinkel, reames, nlewycky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13612 llvm-svn: 250975
* [OperandBundles] Teach AliasAnalysis about operand bundlesSanjoy Das2015-10-222-4/+11
| | | | | | | | | | | | | | | | | | | Summary: If a `CallSite` has operand bundles, then do not peek into the called function to get a more precise `ModRef` answer. This is tested using `argmemonly`, `-basicaa` and `-gvn`; but the functionality is not specific to any of these. Depends on D13961 Reviewers: reames, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13962 llvm-svn: 250974
* [OperandBundles] Make function attributes conservatively correctSanjoy Das2015-10-222-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This makes attribute accessors on `CallInst` and `InvokeInst` do the (conservatively) right thing. This essentially involves, in some cases, *not* falling back querying the attributes on the called `llvm::Function` when operand bundles are present. Attributes locally present on the `CallInst` or `InvokeInst` will still override operand bundle semantics. The LangRef has been amended to reflect this. Note: this change does not do anything prevent `-function-attrs` from inferring `CallSite` local attributes after inspecting the called function -- that will be done as a separate change. I've used `-adce` and `-early-cse` to test these changes. There is nothing special about these passes (and they did not require any changes) except that they seemed be the easiest way to write the tests. This change does not add deal with `argmemonly`. That's a later change because alias analysis requires a related fix before `argmemonly` can be tested. Reviewers: reames, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13961 llvm-svn: 250973
* [PM]: Fix a doc typo. NFCJustin Bogner2015-10-211-1/+1
| | | | llvm-svn: 250962
* [Orc] Clean up a comment.Lang Hames2015-10-211-4/+4
| | | | llvm-svn: 250940
* Revert r250923 as config.h is not an installed header.Yaron Keren2015-10-211-1/+0
| | | | llvm-svn: 250924
* Include llvm/Config/config.h in FileSystem.h as it depends upon ↵Yaron Keren2015-10-211-0/+1
| | | | | | HAVE_SYS_STAT_H which is defined (or not) in config.h. llvm-svn: 250923
* Backing out commit r250906 as it broke lld.Kevin Enderby2015-10-212-42/+14
| | | | llvm-svn: 250908
* This removes the eating of the error in Archive::Child::getSize() when the ↵Kevin Enderby2015-10-212-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | characters in the size field in the archive header for the member is not a number. To do this we have all of the needed methods return ErrorOr to push them up until we get out of lib. Then the tools and can handle the error in whatever way is appropriate for that tool. So the solution is to plumb all the ErrorOr stuff through everything that touches archives. This include its iterators as one can create an Archive object but the first or any other Child object may fail to be created due to a bad size field in its header. Thanks to Lang Hames on the changes making child_iterator contain an ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add operator overloading for * and -> . We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash” and using report_fatal_error() to move the error checking will cause the program to stop, neither of which are really correct in library code. There are still some uses of these that should be cleaned up in this library code for other than the size field. Also corrected the code where the size gets us to the “at the end of the archive” which is OK but past the end of the archive will return object_error::parse_failed now. The test cases use archives with text files so one can see the non-digit character, in this case a ‘%’, in the size field. llvm-svn: 250906
* [Option] Use an ArrayRef to store the Option Infos in OptTable. NFCCraig Topper2015-10-211-5/+3
| | | | llvm-svn: 250901
* [AA] Enhance the new AliasAnalysis infrastructure with an optionalChandler Carruth2015-10-212-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "external" AA wrapper pass. This is a generic hook that can be used to thread custom code into the primary AAResultsWrapperPass for the legacy pass manager in order to allow it to merge external AA results into the AA results it is building. It does this by threading in a raw callback and so it is *very* powerful and should serve almost any use case I have come up with for extending the set of alias analyses used. The only thing not well supported here is using a *different order* of alias analyses. That form of extension *is* supportable with the new pass manager, and I can make the callback structure here more elaborate to support it in the legacy pass manager if this is a critical use case that people are already depending on, but the only use cases I have heard of thus far should be reasonably satisfied by this simpler extension mechanism. It is hard to test this using normal facilities (the built-in AAs don't use this for obvious reasons) so I've written a fairly extensive set of custom passes in the alias analysis unit test that should be an excellent test case because it models the out-of-tree users: it adds a totally custom AA to the system. This should also serve as a reasonably good example and guide for out-of-tree users to follow in order to rig up their existing alias analyses. No support in opt for commandline control is provided here however. I'm really unhappy with the kind of contortions that would be required to support that. It would fully re-introduce the analysis group self-recursion kind of patterns. =/ I've heard from out-of-tree users that this will unblock their use cases with extending AAs on top of the new infrastructure and let us retain the new analysis-group-free-world. Differential Revision: http://reviews.llvm.org/D13418 llvm-svn: 250894
* Revert "Add missing #include, found by modules build."Mehdi Amini2015-10-211-1/+0
| | | | | | | | | | | This reverts commit r250239. It seems unwanted changes got committed here, and part of the patch does not seem correct. For instance RoundUpToAlignment() is called without its returned value actually used. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 250882
* Adding support for TargetLoweringBase::LibCallArtyom Skrobov2015-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: TargetLoweringBase::Expand is defined as "Try to expand this to other ops, otherwise use a libcall." For ISD::UDIV and ISD::SDIV, the choice between the two possibilities was defined in a rather convoluted way: - if DIVREM is legal, expand to DIVREM - if DIVREM has a custom lowering, expand to DIVREM - if DIVREM libcall is defined and a remainder from the same division is computed elsewhere, expand to a DIVREM libcall - else, expand to a DIV libcall This had the undesirable effect that if both DIV and DIVREM are implemented as libcalls, then ISD::UDIV and ISD::SDIV are expanded to the heavier DIVREM libcall, even when the remainder isn't used. The new code adds a new LegalizeAction, TargetLoweringBase::LibCall, so that backends can directly control whether they prefer an expansion or a conversion to a libcall. This makes the generic lowering code even more generic, allowing its reuse in a wider range of target-specific configurations. The useful effect is that ARM backend will now generate a call to __aeabi_{i,u}div rather than __aeabi_{i,u}divmod in cases where it doesn't need the remainder. There's no functional change outside the ARM backend. Reviewers: t.p.northover, rengolin Subscribers: t.p.northover, llvm-commits, aemerson Differential Revision: http://reviews.llvm.org/D13862 llvm-svn: 250826
* AVX512: Implemented encoding and intrinsics for VPBROADCASTB/W/D/Q instructions.Igor Breger2015-10-201-5/+48
| | | | | | Differential Revision: http://reviews.llvm.org/D13884 llvm-svn: 250819
* [x86] Fix AVX maskload/store intrinsic prototypes.Andrea Di Biagio2015-10-201-8/+8
| | | | | | | | | | | | | | | | | | | | | The mask value type for maskload/maskstore GCC builtins is never a vector of packed floats/doubles. This patch fixes the following issues: 1. The mask argument for builtin_ia32_maskloadpd and builtin_ia32_maskstorepd should be of type llvm_v2i64_ty and not llvm_v2f64_ty. 2. The mask argument for builtin_ia32_maskloadpd256 and builtin_ia32_maskstorepd256 should be of type llvm_v4i64_ty and not llvm_v4f64_ty. 3. The mask argument for builtin_ia32_maskloadps and builtin_ia32_maskstoreps should be of type llvm_v4i32_ty and not llvm_v4f32_ty. 4. The mask argument for builtin_ia32_maskloadps256 and builtin_ia32_maskstoreps256 should be of type llvm_v8i32_ty and not llvm_v8f32_ty. Differential Revision: http://reviews.llvm.org/D13776 llvm-svn: 250817
* [Orc] Make CompileOnDemandLayer::findSymbol call BaseLayer::findSymbol if noLang Hames2015-10-201-1/+1
| | | | | | symbol definition is found in the logical dylibs. llvm-svn: 250796
* [Orc] Fix MSVC bugs introduced in r250749.Lang Hames2015-10-191-3/+10
| | | | llvm-svn: 250758
* [Orc] Use '= default' for move constructor/assignment as per dblaikie's review.Lang Hames2015-10-191-12/+3
| | | | | | Thanks Dave! llvm-svn: 250749
* Fix -Wdeprecated regarding ORC copying ValueMaterializersDavid Blaikie2015-10-192-3/+8
| | | | | | | | | | | | As usual, this is a polymorphic hierarchy without polymorphic ownership, so simply make the dtor protected non-virtual, protected default copy ctor/assign, and make derived classes final. The derived classes will pick up correct default public copy ops (and dtor) implicitly. (wish I could add -Wdeprecated to the build, but last time I tried it triggered on some system headers I still need to look into/figure out) llvm-svn: 250747
* Vectorize: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-191-0/+3
| | | | | | | | | | | | | Besides the usual, I finally added an overload to `BasicBlock::splitBasicBlock()` that accepts an `Instruction*` instead of `BasicBlock::iterator`. Someone can go back and remove this overload later (after updating the callers I'm going to skip going forward), but the most common call seems to be `BB->splitBasicBlock(BB->getTerminator(), ...)` and I'm not sure it's better to add `->getIterator()` to every one than have the overload. It's pretty hard to get the usage wrong. llvm-svn: 250745
* Pass FunctionInfoIndex by reference to WriteFunctionSummaryToFile (NFC)Teresa Johnson2015-10-191-1/+1
| | | | | | Implemented suggestion by dblakie in review for r250704. llvm-svn: 250723
* [Orc] Add explicit move constructor and assignment operator to make MSVC happy.Lang Hames2015-10-191-0/+18
| | | | llvm-svn: 250722
* [Orc] Lambda needs to capture 'this'.Lang Hames2015-10-191-1/+1
| | | | llvm-svn: 250716
* [Orc] Remove extraneous semicolon that found its way into r250712.Lang Hames2015-10-191-1/+1
| | | | llvm-svn: 250715
* Revert "RegisterPressure: allocatable physreg uses are always kills"Matthias Braun2015-10-191-2/+0
| | | | | | | | | This reverts commit r250596. Reverted for now as the commit triggers assert in the AMDGPU target pending investigation. llvm-svn: 250713
* [Orc] Add support for emitting indirect stubs directly into the JIT target'sLang Hames2015-10-194-118/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | memory, rather than representing the stubs in IR. Update the CompileOnDemand layer to use this functionality. Directly emitting stubs is much cheaper than building them in IR and codegen'ing them (see below). It also plays well with remote JITing - stubs can be emitted directly in the target process, rather than having to send them over the wire. The downsides are: (1) Care must be taken when resolving symbols, as stub symbols are held in a separate symbol table. This is only a problem for layer writers and other people using this API directly. The CompileOnDemand layer hides this detail. (2) Aliases of function stubs can't be symbolic any more (since there's no symbol definition in IR), but must be converted into a constant pointer expression. This means that modules containing aliases of stubs cannot be cached. In practice this is unlikely to be a problem: There's no benefit to caching such a module anyway. On balance I think the extra performance is more than worth the trade-offs: In a simple stress test with 10000 dummy functions requiring stubs and a single executed "hello world" main function, directly emitting stubs reduced user time for JITing / executing by over 90% (1.5s for IR stubs vs 0.1s for direct emission). llvm-svn: 250712
* Removed parameter "Consecutive" from isLegalMaskedLoad() / isLegalMaskedStore().Elena Demikhovsky2015-10-192-14/+13
| | | | | | | | | | Originally I planned to use the same interface for masked gather/scatter and set isConsecutive to "false" in this case. Now I'm implementing masked gather/scatter and see that the interface is inconvenient. I want to add interfaces isLegalMaskedGather() / isLegalMaskedScatter() instead of using the "Consecutive" parameter in the existing interfaces. Differential Revision: http://reviews.llvm.org/D13850 llvm-svn: 250686
* Add hashing and DenseMapInfo for ArrayRefRafael Espindola2015-10-182-0/+31
| | | | | | | | | Sometimes it is more natural to use a ArrayRef<uint8_t> than a StringRef to represent a range of bytes that is not, semantically, a string. This will be used in lld in a sec. llvm-svn: 250658
* [X86][AVX512DQ] add scalar fpclassAsaf Badouh2015-10-181-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D13769 llvm-svn: 250650
* Minor Instr PGO code restructuringXinliang David Li2015-10-182-19/+105
| | | | | | | | | | | | | | | | 1. Key constant values (version, magic) and data structures related to raw and indexed profile format are moved into one centralized file: InstrProf.h. 2. Utility function such as MD5Hash computation is also moved to the common header to allow sharing with other components in the future. 3. A header data structure is introduced for Indexed format so that the reader and writer can always be in sync. 4. Added some comments to document different places where multiple definition of the data structure must be kept in sync (reader/writer, runtime, lowering etc). No functional change is intended. Differential Revision: http://reviews.llvm.org/D13758 llvm-svn: 250638
* Use binary search in isCPUStringValid since the array is sorted.Craig Topper2015-10-171-5/+2
| | | | llvm-svn: 250613
* RegisterPressure: Unify the sparse sets in LiveRegsSet; NFCMatthias Braun2015-10-171-15/+41
| | | | | | Also do some cleanups comment improvements. llvm-svn: 250598
* RegisterPressure: allocatable physreg uses are always killsMatthias Braun2015-10-171-0/+2
| | | | | | | | | | | | | | This property was already used in the code path when no liveness intervals are present. Unfortunately the code path that uses liveness intervals tried to query a cached live interval for an allocatable physreg, those are usually not computed so a conservative default was used. This doesn't affect any of the lit testcases. This is a foreclosure to upcoming changes which should be NFC but without this patch this tidbit wouldn't be NFC. llvm-svn: 250596
* RegisterPressure: Hide non-const iterators of PressureDiffMatthias Braun2015-10-171-3/+5
| | | | | | | It is too easy to accidentally violate the ordering requirements when modifying the PressureDiff entries through iterators. llvm-svn: 250590
* [WinEH] Fix stack alignment in funclets and ParentFrameOffset calculationReid Kleckner2015-10-161-0/+4
| | | | | | | | | | | | Our previous value of "16 + 8 + MaxCallFrameSize" for ParentFrameOffset is incorrect when CSRs are involved. We were supposed to have a test case to catch this, but it wasn't very rigorous. The main effect here is that calling _CxxThrowException inside a catchpad doesn't immediately crash on MOVAPS when you have an odd number of CSRs. llvm-svn: 250583
* Instroduce a template file to define InstrPGO core data structures.Xinliang David Li2015-10-161-0/+88
| | | | | | | | | | | | | | | Changing PGO data format layout can be a pain. Many different places need to be touched and kept in sync. Failing to do so usually results in errors very time consuming to debug. This file is intended to be the master file that defines the layout of the core runtime data structures. Currently only two structure is covered: Per function ProfData structure and the function record structure used in coverage mapping. No client code has been made yet, so this commit is NFC. llvm-svn: 250574
* Sample profiles - Re-arrange binary format to emit head samples only on top ↵Diego Novillo2015-10-163-3/+8
| | | | | | | | | | | | | | functions. The number of samples collected at the head of a function only make sense for top-level functions (i.e., those actually called as opposed to being inlined inside another). Head samples essentially count the time spent inside the function's prologue. This clearly doesn't make sense for inlined functions, so we were always emitting 0 in those. llvm-svn: 250539
* Fix typo, NFC.Yaron Keren2015-10-161-1/+1
| | | | llvm-svn: 250529
* Sample Profiling - Remove useless asserts. NFC.Diego Novillo2015-10-161-2/+0
| | | | llvm-svn: 250513
* Initial migration of AVR backendDylan McKay2015-10-161-0/+1
| | | | | | | | This patch adds the underlying infrastructure for an AVR backend to be included into LLVM. It is the first of a series of patches aimed at moving the out-of-tree AVR backend into the tree. It consists of adding a new`Triple` target 'avr'. llvm-svn: 250492
* Add emacs c++ mode hint.Lang Hames2015-10-161-1/+1
| | | | llvm-svn: 250479
OpenPOWER on IntegriCloud