aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR
AgeCommit message (Collapse)AuthorFilesLines
2016-09-13[X86] Remove masked shufpd/shufps intrinsics and autoupgrade to native ↵Craig Topper1-0/+26
vector shuffles. They were removed from clang previously but accidentally left in the backend. llvm-svn: 281300
2016-09-13DebugInfo: New metadata representation for global variables.Peter Collingbourne6-18/+45
This patch reverses the edge from DIGlobalVariable to GlobalVariable. This will allow us to more easily preserve debug info metadata when manipulating global variables. Fixes PR30362. A program for upgrading test cases is attached to that bug. Differential Revision: http://reviews.llvm.org/D20147 llvm-svn: 281284
2016-09-10It should also be legal to pass a swifterror parameter to a call as a swifterrorArnold Schwaighofer1-4/+9
argument. rdar://28233388 llvm-svn: 281147
2016-09-10Add an isSwiftError predicate to ValueArnold Schwaighofer1-0/+10
llvm-svn: 281143
2016-09-09Rationalise the attribute getter/setter methods on Function and CallSite.Amaury Sechet2-40/+4
Summary: While woring on mapping attributes in the C API, it clearly appeared that the recent changes in the API on the C++ side left Function and Call/Invoke with an attribute API that grew in an ad hoc manner. This makes it difficult to work with it, because one doesn't know which overloads exists and which do not. Make sure that getter/setter function exists for both enum and string version. Remove inconsistent getter/setter, unless they have many callsites. This should make it easier to work with attributes in the future. This doesn't change how attribute works. Reviewers: bkramer, whitequark, mehdi_amini, void Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21514 llvm-svn: 281019
2016-09-06Formatting with clang-format patch r280700Leny Kholodov2-27/+26
llvm-svn: 280716
2016-09-06DebugInfo: use strongly typed enum for debug info flagsLeny Kholodov3-50/+48
Use ADT/BitmaskEnum for DINode::DIFlags for the following purposes: Get rid of unsigned int for flags to avoid problems on platforms with sizeof(int) < 4 Flags are now strongly typed Patch by: Victor Leschuk <vleschuk@gmail.com> Differential Revision: https://reviews.llvm.org/D23766 llvm-svn: 280700
2016-09-06Revert "DebugInfo: use strongly typed enum for debug info flags"Mehdi Amini3-65/+69
This reverts commit r280686, bots are broken. llvm-svn: 280688
2016-09-06DebugInfo: use strongly typed enum for debug info flagsMehdi Amini3-69/+65
Use ADT/BitmaskEnum for DINode::DIFlags for the following purposes: * Get rid of unsigned int for flags to avoid problems on platforms with sizeof(int) < 4 * Flags are now strongly typed Patch by: Victor Leschuk <vleschuk@gmail.com> Differential Revision: https://reviews.llvm.org/D23766 llvm-svn: 280686
2016-09-04[AVX-512] Remove 128-bit and 256-bit masked floating point add/sub/mul/div ↵Craig Topper1-0/+44
intrinsics and upgrade to native IR. llvm-svn: 280633
2016-09-04[AVX-512] Remove masked integer add/sub/mull intrinsics and upgrade to ↵Craig Topper1-0/+15
native IR. llvm-svn: 280611
2016-09-03[X86] Combine some of the strings in autoupgrade code.Craig Topper1-35/+7
llvm-svn: 280603
2016-09-03ADT: Remove external uses of ilist_iterator, NFCDuncan P. N. Exon Smith2-6/+1
Delete the dead code for Write(ilist_iterator) in the IR Verifier, inline report(ilist_iterator) at its call sites in the MachineVerifier, and use simple_ilist<>::iterator in SymbolTableListTraits. The only remaining reference to ilist_iterator outside of the ilist implementation is from MachineInstrBundleIterator. I'll get rid of that in a follow-up. llvm-svn: 280565
2016-09-02fix documentation comments; NFCSanjay Patel1-5/+0
llvm-svn: 280489
2016-09-02[AVX-512] Remove floating point logical operation instrinsics and replace ↵Craig Topper1-0/+37
them with native IR. llvm-svn: 280466
2016-09-01[IR] Properly handle escape characters in Attribute::getAsString()Honggyu Kim2-7/+13
If an attribute name has special characters such as '\01', it is not properly printed in LLVM assembly language format. Since the format expects the special characters are printed as it is, it has to contain escape characters to make it printable. Before: attributes #0 = { ... "counting-function"="^A__gnu_mcount_nc" ... After: attributes #0 = { ... "counting-function"="\01__gnu_mcount_nc" ... Reviewers: hfinkel, rengolin, rjmccall, compnerd Subscribers: nemanjai, mcrosier, hans, shenhan, majnemer, llvm-commits Differential Revision: https://reviews.llvm.org/D23792 llvm-svn: 280357
2016-08-31[DiagnosticInfo] Add a diagnostic class for the fallback of ISel.Quentin Colombet1-0/+4
This will be used to warm when we fallback in GlobalISel. llvm-svn: 280271
2016-08-30ADT: Guarantee transferNodesFromList is only called on transfersDuncan P. N. Exon Smith1-1/+1
Guarantee that ilist_traits<T>::transferNodesFromList is only called when nodes are actually changing lists. I also moved all the callbacks to occur *first*, before the operation. This is the only choice for iplist<T>::merge, so we might as well be consistent. I expect this to have no effect in practice, although it simplifies the logic in both iplist<T>::transfer and iplist<T>::insert. llvm-svn: 280122
2016-08-29[Constant] remove fdiv and frem from canTrap()Sanjay Patel1-2/+0
Assuming the default FP env, we should not treat fdiv and frem any differently in terms of trapping behavior than any other FP op. Ie, FP ops do not trap with the default FP env. This matches how we treat the fdiv/frem in IR with isSafeToSpeculativelyExecute() and in the backend after: https://reviews.llvm.org/rL279970 llvm-svn: 279973
2016-08-29[Coroutines] Part 9: Add cleanup subfunction.Gor Nishanov1-1/+1
Summary: [Coroutines] Part 9: Add cleanup subfunction. This patch completes coroutine heap allocation elision. Now, the heap elision example from docs\Coroutines.rst compiles and produces expected result (see test/Transform/Coroutines/ex3.ll) Intrinsic Changes: * coro.free gets a token parameter tying it to coro.id to allow reliably discovering all coro.frees associated with a particular coroutine. * coro.id gets an extra parameter that points back to a coroutine function. This allows to check whether a coro.id describes the enclosing function or it belongs to a different function that was later inlined. CoroSplit now creates three subfunctions: # f$resume - resume logic # f$destroy - cleanup logic, followed by a deallocation code # f$cleanup - just the cleanup code CoroElide pass during devirtualization replaces coro.destroy with either f$destroy or f$cleanup depending whether heap elision is performed or not. Other fixes, improvements: * Fixed buglet in Shape::buildFrame that was not creating coro.save properly if coroutine has more than one suspend point. * Switched to using variable width suspend index field (no longer limited to 32 bit index field can be as little as i1 or as large as i<whatever-size_t-is>) Reviewers: majnemer Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23844 llvm-svn: 279971
2016-08-25Make some LLVM_CONSTEXPR variables const. NFC.George Burgess IV1-1/+1
This patch changes LLVM_CONSTEXPR variable declarations to const variable declarations, since LLVM_CONSTEXPR expands to nothing if the current compiler doesn't support constexpr. In all of the changed cases, it looks like the code intended the variable to be const instead of sometimes-constexpr sometimes-not. llvm-svn: 279696
2016-08-24DebugInfo: Add flag to CU to disable emission of inline debug info into the ↵David Blaikie3-8/+15
skeleton CU In cases where .dwo/.dwp files are guaranteed to be available, skipping the extra online (in the .o file) inline info can save a substantial amount of space - see the original r221306 for more details there. llvm-svn: 279650
2016-08-24fix typo 'varaible' in assertNico Weber1-1/+1
llvm-svn: 279636
2016-08-23Fix some Clang-tidy modernize-use-using and Include What You Use warnings; ↵Eugene Zelenko1-2/+6
other minor fixes. Differential revision: https://reviews.llvm.org/D23789 llvm-svn: 279535
2016-08-23[Profile] refactor meta data copying/swapping codeXinliang David Li2-20/+44
Differential Revision: http://reviews.llvm.org/D23619 llvm-svn: 279523
2016-08-22Add comments and an assert to follow-up on r279113. NFC.Pete Cooper1-0/+2
Philip commented on r279113 to ask for better comments as to when to use the different versions of getName. Its also possible to assert in the simple case that we aren't an overloaded intrinsic as those have to use the more capable version of getName. Thanks for the comments Philip. llvm-svn: 279466
2016-08-20[PM] Introduce an abstraction for all the analyses over a particular IRChandler Carruth1-0/+2
unit for use in the PreservedAnalyses set. This doesn't have any important functional change yet but it cleans things up and makes the analysis substantially more efficient by avoiding querying through the type erasure for every analysis. I also think it makes it much easier to reason about how analyses are preserved when walking across pass managers and across IR unit abstractions. Thanks to Sean and Mehdi both for the comments and suggestions. Differential Revision: https://reviews.llvm.org/D23691 llvm-svn: 279360
2016-08-18Add a version of Intrinsic::getName which is more efficient when there are ↵Pete Cooper1-0/+5
no overloads. When running 'opt -O2 verify-uselistorder-nodbg.lto.bc', there are 33m allocations. 8.2m come from std::string allocations in Intrinsic::getName(). Turns out this method only returns a std::string because it needs to handle overloads, but that is not the common case. This adds an overload of getName which just returns a StringRef when there are no overloads and so saves on the allocations. llvm-svn: 279113
2016-08-17Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner1-3/+3
Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
2016-08-17GlobalISel: support irtranslation of icmp instructions.Tim Northover2-35/+36
llvm-svn: 278969
2016-08-17[GenericDomTree] Change GenericDomTree to use NodeRef in GraphTraits. NFC.Tim Shen1-2/+6
Summary: Looking at the implementation, GenericDomTree has more specific requirements on NodeRef, e.g. NodeRefObject->getParent() should compile, and NodeRef should be a pointer. We can remove the pointer requirement, but it seems to have little gain, given the limited use cases. Also changed GraphTraits<Inverse<Inverse<T>> to be more accurate. Reviewers: dblaikie, chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23593 llvm-svn: 278961
2016-08-17Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner3-4/+4
This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
2016-08-17Scalar: Avoid dereferencing end() in IndVarSimplifyDuncan P. N. Exon Smith1-2/+7
IndVarSimplify::sinkUnusedInvariants calls BasicBlock::getFirstInsertionPt on the ExitBlock and moves instructions before it. This can return end(), so it's not safe to dereference. Add an iterator-based overload to Instruction::moveBefore to avoid the UB. llvm-svn: 278886
2016-08-16Make MDNode::intersect faster than O(n * m)David Majnemer1-5/+4
It is pretty easy to get it down to O(nlogn + mlogm). This implementation has the added benefit of automatically deduplicating entries between the two sets. llvm-svn: 278837
2016-08-16Don't passively concatenate MDNodesDavid Majnemer1-13/+5
I have audited all the callers of concatenate and none require duplicate entries to service concatenation. These duplicates serve no purpose but to needlessly embiggen the IR. N.B. Layering getMostGenericAliasScope on top of concatenate makes it O(nlogn + mlogm) instead of O(n*m). llvm-svn: 278836
2016-08-13Revert "Revert "Invariant start/end intrinsics overloaded for address space""Mehdi Amini1-1/+27
This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530. llvm-svn: 278609
2016-08-13Revert "Invariant start/end intrinsics overloaded for address space"Mehdi Amini1-27/+1
This reverts commit r276447. llvm-svn: 278608
2016-08-13Fix some Clang-tidy modernize-use-using and Include What You Use warnings.Eugene Zelenko1-13/+52
Differential revision: https://reviews.llvm.org/D23478 llvm-svn: 278583
2016-08-12[Coroutines]: Part6b: Add coro.id intrinsic.Gor Nishanov1-2/+2
Summary: 1. Make coroutine representation more robust against optimization that may duplicate instruction by introducing coro.id intrinsics that returns a token that will get fed into coro.alloc and coro.begin. Due to coro.id returning a token, it won't get duplicated and can be used as reliable indicator of coroutine identify when a particular coroutine call gets inlined. 2. Move last three arguments of coro.begin into coro.id as they will be shared if coro.begin will get duplicated. 3. doc + test + code updated to support the new intrinsic. Reviewers: mehdi_amini, majnemer Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23412 llvm-svn: 278481
2016-08-12Use the range variant of transform instead of unpacking begin/endDavid Majnemer1-1/+2
No functionality change is intended. llvm-svn: 278476
2016-08-12Use the range variant of remove_if instead of unpacking begin/endDavid Majnemer1-3/+1
No functionality change is intended. llvm-svn: 278475
2016-08-12Use the range variant of find/find_if instead of unpacking begin/endDavid Majnemer2-4/+4
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469
2016-08-11Use the range variant of find instead of unpacking begin/endDavid Majnemer2-8/+5
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
2016-08-11Use range algorithms instead of unpacking begin/endDavid Majnemer3-14/+13
No functionality change is intended. llvm-svn: 278417
2016-08-11IR: Don't cast the end iterator to Instruction*Duncan P. N. Exon Smith1-2/+2
End iterators are usually sentinels, not actually Instruction* at all. Stop casting to it just to get an iterator back. There is likely no observable functionality change here right now (although this is relying on UB, I doubt it was triggering anything), but I'll be removing the cast soon. llvm-svn: 278346
2016-08-11[Statepoints] Minor cosmetic change; NFCSanjoy Das1-1/+1
The verification failure message was missing a space. llvm-svn: 278309
2016-08-10[x86] Fix a bug in the auto-upgrade from r276416 where we failed to giveChandler Carruth1-1/+1
a sufficiently low alignment for the IR load created. There is no test case because we don't have any test cases for the *IR* produced by the autoupgrade, only the x86 assembly, and it happens that the x86 assembly for this intrinsic as it is tested in the autoupgrade path just happens to not produce a separate load instruction where we might have observed the alignment. I'm going to follow up on the original commit to suggest getting IR-level testing in addition to the asm level testing here so that we can see and test these kinds of issues. We might never get an x86 instruction out with an alignment constraint, but we could stil miscompile code by folding against the alignment marked on (or inferred for in this case) the load. llvm-svn: 278203
2016-08-09[IR] Remove some unused #includes (NFC)Vedant Kumar1-4/+0
I needed a reader-writer lock for a downstream project and noticed that llvm has one. Function.cpp is the only file in-tree that refers to it. To anyone reading this: are you using RWMutex in out-of-tree code? Maybe it's not worth keeping around any more... Since we're not actually using RWMutex *here*, remove the #include (and a few other stale headers while we're at it). llvm-svn: 278178
2016-08-09Consistently use ModuleAnalysisManagerSean Silva1-1/+1
Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278078
2016-08-09Consistently use FunctionAnalysisManagerSean Silva2-2/+2
Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278077