summaryrefslogtreecommitdiffstats
path: root/llvm/docs/LangRef.rst
Commit message (Collapse)AuthorAgeFilesLines
* Document the status quo of DIExpression semantics in LangRef.rstAdrian Prantl2017-03-221-7/+20
| | | | llvm-svn: 298528
* Let llvm.objectsize be conservative with null pointersGeorge Burgess IV2017-03-211-7/+12
| | | | | | | | | | | This adds a parameter to @llvm.objectsize that makes it return conservative values if it's given null. This fixes PR23277. Differential Revision: https://reviews.llvm.org/D28494 llvm-svn: 298430
* Fix docs-llvm-html build.Evgeniy Stepanov2017-03-171-1/+2
| | | | llvm-svn: 298163
* Add !associated metadata.Evgeniy Stepanov2017-03-171-0/+25
| | | | | | | | | | | | | | | | This is an ELF-specific thing that adds SHF_LINK_ORDER to the global's section pointing to the metadata argument's section. The effect of that is a reverse dependency between sections for the linker GC. !associated does not change the behavior of global-dce. The global may also need to be added to llvm.compiler.used. Since SHF_LINK_ORDER is per-section, !associated effectively enables fdata-sections for the affected globals, the same as comdats do. Differential Revision: https://reviews.llvm.org/D29104 llvm-svn: 298157
* [InstSimplify] vector div/rem with any zero element in divisor is undefSanjay Patel2017-03-091-7/+14
| | | | | | | | | | | This was suggested as a DAG simplification in the review for rL297026 : http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435253.html ...but let's start with IR since we have actual docs for IR (LangRef). Differential Revision: https://reviews.llvm.org/D30665 llvm-svn: 297390
* [DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderefKonstantin Zhuravlyov2017-03-081-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D29672 llvm-svn: 297247
* Fix a typo. Patch by fcrick on github ↵Sylvestre Ledru2017-03-041-1/+1
| | | | | | https://github.com/llvm-mirror/llvm/pull/23 llvm-svn: 296969
* Explicitly state the behavior of inbounds with a null pointer.Eli Friedman2017-02-231-2/+4
| | | | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=31439; this reflects LLVM's behavior in practice, and should be compatible with C/C++ rules. Differential Revision: https://reviews.llvm.org/D28026 llvm-svn: 295916
* [LangRef] Explicitly allow readnone and reaodnly functions to unwindSanjoy Das2017-02-131-5/+8
| | | | | | | | | | | | | | | | | | Summary: This change edits the language reference to explicitly allow the existence of readnone and readonly functions that can throw. Full discussion at http://lists.llvm.org/pipermail/llvm-dev/2017-January/108637.html Reviewers: dberlin, chandlerc, hfinkel, majnemer Reviewed By: majnemer Subscribers: majnemer, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D28740 llvm-svn: 295000
* [LangRef] Update the TBAA sectionSanjoy Das2017-02-131-27/+146
| | | | | | | | | | | | | | | | | | | | Summary: Update the TBAA section to mention the struct path TBAA that LLVM implements today. This is not a proposal or change in semantics -- it is intended only to **document** what LLVM already does today. This is related to https://reviews.llvm.org/D26438 where I've tried to implement some of the constraints as verifier checks. Reviewers: anna, reames, rsmith, chandlerc, hfinkel, rjmccall, mehdi_amini, dexonsmith, manmanren Reviewed By: manmanren Subscribers: dberlin, dberris, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D26831 llvm-svn: 294999
* Encode duplication factor from loop vectorization and loop unrolling to ↵Dehao Chen2017-02-101-1/+3
| | | | | | | | | | | | | | | | | | | | | discriminator. Summary: This patch starts the implementation as discuss in the following RFC: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106532.html When optimization duplicates code that will scale down the execution count of a basic block, we will record the duplication factor as part of discriminator so that the offline process tool can find the duplication factor and collect the accurate execution frequency of the corresponding source code. Two important optimization that fall into this category is loop vectorization and loop unroll. This patch records the duplication factor for these 2 optimizations. The recording will be guarded by a flag encode-duplication-in-discriminators, which is off by default. Reviewers: probinson, aprantl, davidxl, hfinkel, echristo Reviewed By: hfinkel Subscribers: mehdi_amini, anemet, mzolotukhin, llvm-commits Differential Revision: https://reviews.llvm.org/D26420 llvm-svn: 294782
* This patch adds a ssa_copy intrinsic, as part of splitting up D29316.Daniel Berlin2017-02-071-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The intrinsic, marked as returning it's first argument, has no code generation effect (though currently not every optimization pass knows that intrinsics with the returned attribute can be looked through). It is about to be used to by the PredicateInfo pass to attach predicate information to existing operands, and be able to tell what the predicate information affects. We deliberately do not attach any info through a second operand so that the intrinsics do not need to dominate the comparisons/etc (since in the case of assume, we may want to push them up the post-dominator tree). Reviewers: davide, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29517 llvm-svn: 294341
* [LangRef] Document some LLVM inline asm special escapesReid Kleckner2017-02-061-0/+16
| | | | | | | As discussed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2017-February/109862.html llvm-svn: 294204
* [LanRef] Fix typo in getelementptr example.Alexey Bader2017-01-301-1/+1
| | | | | | | | | | | | | | Summary: Change B type from double to pointer to double. Reviewers: delena, sanjoy Reviewed By: sanjoy Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D29009 llvm-svn: 293467
* [LangRef] Make @llvm.sqrt(x) return undef, rather than have UB, for negative x.Justin Lebar2017-01-271-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some frontends emit a speculate-and-select idiom for sqrt, wherein they compute sqrt(x), check if x is negative, and select NaN if it is: %cmp = fcmp olt double %a, -0.000000e+00 %sqrt = call double @llvm.sqrt.f64(double %a) %ret = select i1 %cmp, double 0x7FF8000000000000, double %sqrt This is technically UB as the LangRef is written today if %a is ever less than -0. But emitting code that's compliant with the current definition of sqrt would require a branch, which would then prevent us from matching this idiom in SelectionDAG (which we do today -- ISD::FSQRT has defined behavior on negative inputs), because SelectionDAG looks at one BB at a time. Nothing in LLVM takes advantage of this undefined behavior, as far as we can tell, and the fact that llvm.sqrt has UB dates from its initial addition to the LangRef. Reviewers: arsenm, mehdi_amini, hfinkel Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D28797 llvm-svn: 293242
* Add intrinsics for constrained floating point operationsAndrew Kaylor2017-01-261-0/+271
| | | | | | | | | | | | | | This commit introduces a set of experimental intrinsics intended to prevent optimizations that make assumptions about the rounding mode and floating point exception behavior. These intrinsics will later be extended to specify flush-to-zero behavior. More work is also required to model instruction dependencies in machine code and to generate these instructions from clang (when required by pragmas and/or command line options that are not currently supported). Differential Revision: https://reviews.llvm.org/D27028 llvm-svn: 293226
* [Doc][LangRef] Fix typo-ish error in description of Masked GatherZvi Rackover2017-01-261-1/+1
| | | | | | | | | | | | | | Summary: Fix the example of equivalent expansion for when mask is all ones. Reviewers: delena Reviewed By: delena Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29179 llvm-svn: 293206
* LangRef: Document the allowed metadata dropping transforms.Peter Collingbourne2017-01-251-3/+16
| | | | | | | | | Document the current practice regarding dropping metadata on modules, functions and global variables. Differential Revision: https://reviews.llvm.org/D29110 llvm-svn: 293101
* docs: Document that !absolute_symbol { all-ones, all-ones } means the full set.Peter Collingbourne2017-01-201-2/+5
| | | | llvm-svn: 292657
* Silence some Sphinx diagnostics in an attempt to get the documentation ↵Aaron Ballman2017-01-171-1/+1
| | | | | | builder back to green (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/1895). llvm-svn: 292271
* LangRef: Note that calls also support fast math flagsMatt Arsenault2017-01-101-2/+3
| | | | | | | | This is already documented on the call instruction, but not in the list of supported instructions in the fast math flag section. llvm-svn: 291578
* [MemDep] Handle gep with zeros for invariant.groupPiotr Padlewski2016-12-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it to getelementptr because it make SROA can then handle it. Simple case like void g(A &a) { z(a); if (glob) a.foo(); } void testG() { A a; g(a); } was not devirtualized with -fstrict-vtable-pointers because luck of handling for gep 0 in Memory Dependence Analysis Reviewers: dberlin, nlewycky, chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28126 llvm-svn: 290763
* Fix documentation generator warnings after rL290708.Igor Laevsky2016-12-291-3/+3
| | | | llvm-svn: 290709
* Introduce element-wise atomic memcpy intrinsicIgor Laevsky2016-12-291-0/+76
| | | | | | | | | | This change adds a new intrinsic which is intended to provide memcpy functionality with additional atomicity guarantees. Please refer to the review thread or language reference for further details. Differential Revision: https://reviews.llvm.org/D27133 llvm-svn: 290708
* [DebugInfo] Added support for Checksum debug info feature.Amjad Aboud2016-12-251-1/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D27642 llvm-svn: 290514
* Revert @llvm.assume with operator bundles (r289755-r289757)Daniel Jasper2016-12-191-9/+0
| | | | | | | This creates non-linear behavior in the inliner (see more details in r289755's commit thread). llvm-svn: 290086
* Make processing @llvm.assume more efficient by using operand bundlesHal Finkel2016-12-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | There was an efficiency problem with how we processed @llvm.assume in ValueTracking (and other places). The AssumptionCache tracked all of the assumptions in a given function. In order to find assumptions relevant to computing known bits, etc. we searched every assumption in the function. For ValueTracking, that means that we did O(#assumes * #values) work in InstCombine and other passes (with a constant factor that can be quite large because we'd repeat this search at every level of recursion of the analysis). Several of us discussed this situation at the last developers' meeting, and this implements the discussed solution: Make the values that an assume might affect operands of the assume itself. To avoid exposing this detail to frontends and passes that need not worry about it, I've used the new operand-bundle feature to add these extra call "operands" in a way that does not affect the intrinsic's signature. I think this solution is relatively clean. InstCombine adds these extra operands based on what ValueTracking, LVI, etc. will need and then those passes need only search the users of the values under consideration. This should fix the computational-complexity problem. At this point, no passes depend on the AssumptionCache, and so I'll remove that as a follow-up change. Differential Revision: https://reviews.llvm.org/D27259 llvm-svn: 289755
* IR, X86: Understand !absolute_symbol metadata on global variables.Peter Collingbourne2016-12-081-0/+19
| | | | | | | | | | | | | | | | | Summary: Attaching !absolute_symbol to a global variable does two things: 1) Marks it as an absolute symbol reference. 2) Specifies the value range of that symbol's address. Teach the X86 backend to allow absolute symbols to appear in place of immediates by extending the relocImm and mov64imm32 matchers. Start using relocImm in more places where it is legal. As previously proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html Differential Revision: https://reviews.llvm.org/D25878 llvm-svn: 289087
* Fix doc of `llvm.bitreverse.iN`Yichao Yu2016-11-231-1/+1
| | | | | | | | | | | | | | | Summary: The return type is `iN` rather than always `i16` Seems to be a typo in https://reviews.llvm.org/rL252878 . Reviewers: jmolloy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27047 llvm-svn: 287769
* [LangRef] Drop misleading anecdoteSanjoy Das2016-11-131-3/+1
| | | | | | | | | | | `shl nsw i8 1, i8 8` is poison, but `mul i8 1, i8 128` is not. This was discussed previously here: http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html. From the discussion, it was not clear which semantics we want for `shl`, but for now at least make the language reference more accurate. llvm-svn: 286785
* IR: Introduce inrange attribute on getelementptr indices.Peter Collingbourne2016-11-101-3/+15
| | | | | | | | | | | | | | | | | If the inrange keyword is present before any index, loading from or storing to any pointer derived from the getelementptr has undefined behavior if the load or store would access memory outside of the bounds of the element selected by the index marked as inrange. This can be used, e.g. for alias analysis or to split globals at element boundaries where beneficial. As previously proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-July/102472.html Differential Revision: https://reviews.llvm.org/D22793 llvm-svn: 286514
* [LangRef] Drop "experimental" caveat from operand bundlesSanjoy Das2016-11-101-3/+0
| | | | | | I think we're past that point now. llvm-svn: 286428
* DebugInfo: make DW_TAG_atomic_type validVictor Leschuk2016-10-311-2/+3
| | | | | | | | | | | | | | DW_TAG_atomic_type was already included in Dwarf.defs and emitted correctly, however Verifier didn't recognize it as valid. Thus we introduce the following changes: * Make DW_TAG_atomic_type valid tag for IR and DWARF (enabled only with -gdwarf-5) * Add it to related docs * Add DebugInfo tests Differential Revision: https://reviews.llvm.org/D26144 llvm-svn: 285624
* fix title underline lengthAlbert Gutowski2016-10-121-1/+1
| | | | llvm-svn: 284078
* Create llvm.addressofreturnaddress intrinsicAlbert Gutowski2016-10-121-0/+26
| | | | | | | | | | | | Summary: We need a new LLVM intrinsic to implement MS _AddressOfReturnAddress builtin on 64-bit Windows. Reviewers: majnemer, rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25293 llvm-svn: 284061
* [docs] Fix indentation bug in LangRef.Lang Hames2016-10-081-2/+2
| | | | llvm-svn: 283624
* Extend title underlineXinliang David Li2016-09-181-1/+1
| | | | llvm-svn: 281869
* [Profile] Implement select instruction instrumentation in IR PGOXinliang David Li2016-09-181-0/+31
| | | | | | Differential Revision: http://reviews.llvm.org/D23727 llvm-svn: 281858
* [LangRef] Add a clarifying example for undefSanjoy Das2016-09-151-0/+3
| | | | llvm-svn: 281570
* It should also be legal to pass a swifterror parameter to a call as a swifterrorArnold Schwaighofer2016-09-101-4/+5
| | | | | | | | argument. rdar://28233388 llvm-svn: 281147
* Remove restriction that 'sret' must be on the first parameterReid Kleckner2016-09-081-4/+3
| | | | | | | | | | On Windows, it is often applied to the second parameter, and the x86 backend is prepared to deal with sret appearing on any parameter. Other backends assume it only appears on parameter zero, but those are target-specific requirements, and not an IR-level rule. llvm-svn: 280951
* [LangRef] Clarify !invariant.load semantics.Geoff Berry2016-08-311-6/+4
| | | | | | Based on discussion on llvm-dev. llvm-svn: 280262
* docs: mention that clobbering output regs in inline asm is illegal.Peter Zotov2016-08-301-0/+3
| | | | | | | | | I've found this out the hard way; LLVM will not normally catch this error (unless -verify-machineinstrs is passed), and under certain very specific circumstances (such as register scavenger running under pressure) this would result in an opaque crash in codegen. llvm-svn: 280071
* Revert "Revert "Invariant start/end intrinsics overloaded for address space""Mehdi Amini2016-08-131-2/+4
| | | | | | This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530. llvm-svn: 278609
* Revert "Invariant start/end intrinsics overloaded for address space"Mehdi Amini2016-08-131-4/+2
| | | | | | This reverts commit r276447. llvm-svn: 278608
* [LangRef] Fix formatting (no semantic change)Sanjoy Das2016-08-101-5/+4
| | | | llvm-svn: 278294
* Revert "[X86] Support the "ms-hotpatch" attribute."Charles Davis2016-08-081-19/+1
| | | | | | | | This reverts commit r278048. Something changed between the last time I built this--it takes awhile on my ridiculously slow and ancient computer--and now that broke this. llvm-svn: 278053
* [X86] Support the "ms-hotpatch" attribute.Charles Davis2016-08-081-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Based on two patches by Michael Mueller. This is a target attribute that causes a function marked with it to be emitted as "hotpatchable". This particular mechanism was originally devised by Microsoft for patching their binaries (which they are constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but is now commonly abused by Windows programs to hook API functions. This mechanism is target-specific. For x86, a two-byte no-op instruction is emitted at the function's entry point; the entry point must be immediately preceded by 64 (32-bit) or 128 (64-bit) bytes of padding. This padding is where the patch code is written. The two byte no-op is then overwritten with a short jump into this code. The no-op is usually a `movl %edi, %edi` instruction; this is used as a magic value indicating that this is a hotpatchable function. Reviewers: majnemer, sanjoy, rnk Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D19908 llvm-svn: 278048
* [IR] Introduce a non-integral pointer typeSanjoy Das2016-07-281-0/+24
| | | | | | | | | | | | | | | Summary: This change adds a `ni` specifier in the `datalayout` string to denote pointers in some given address spaces as "non-integral", and adds some typing rules around these special pointers. Reviewers: majnemer, chandlerc, atrick, dberlin, eli.friedman, tstellarAMD, arsenm Subscribers: arsenm, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D22488 llvm-svn: 277085
* fix some typos in the docSylvestre Ledru2016-07-281-1/+1
| | | | llvm-svn: 276968
OpenPOWER on IntegriCloud