summaryrefslogtreecommitdiff
path: root/docs/LangRef.rst
AgeCommit message (Collapse)Author
2017-12-09Hardware-assisted AddressSanitizer (llvm part).Evgeniy Stepanov
Summary: This is LLVM instrumentation for the new HWASan tool. It is basically a stripped down copy of ASan at this point, w/o stack or global support. Instrumenation adds a global constructor + runtime callbacks for every load and store. HWASan comes with its own IR attribute. A brief design document can be found in clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier). Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D40932 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320217 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[LangRef] clarify semantics of the frem instructionSanjay Patel
As noted in D40594, the frem instruction corresponds to fmod() except that it can't set errno. I modified the text that we currently use for intrinsics that map to libm functions and applied it to frem. Differential Revision: https://reviews.llvm.org/D40629 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319437 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16Let llvm.invariant.group.barrier accepts pointer to any address spaceYaxun Liu
llvm.invariant.group.barrier may accept pointers to arbitrary address space. This patch let it accept pointers to i8 in any address space and returns pointer to i8 in the same address space. Differential Revision: https://reviews.llvm.org/D39973 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Add an @llvm.sideeffect intrinsicDan Gohman
This patch implements Chandler's idea [0] for supporting languages that require support for infinite loops with side effects, such as Rust, providing part of a solution to bug 965 [1]. Specifically, it adds an `llvm.sideeffect()` intrinsic, which has no actual effect, but which appears to optimization passes to have obscure side effects, such that they don't optimize away loops containing it. It also teaches several optimization passes to ignore this intrinsic, so that it doesn't significantly impact optimization in most cases. As discussed on llvm-dev [2], this patch is the first of two major parts. The second part, to change LLVM's semantics to have defined behavior on infinite loops by default, with a function attribute for opting into potential-undefined-behavior, will be implemented and posted for review in a separate patch. [0] http://lists.llvm.org/pipermail/llvm-dev/2015-July/088103.html [1] https://bugs.llvm.org/show_bug.cgi?id=965 [2] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118632.html Differential Revision: https://reviews.llvm.org/D38336 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-06[IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' ↵Sanjay Patel
fast-math-flag As discussed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-November/107104.html and again more recently: http://lists.llvm.org/pipermail/llvm-dev/2017-October/118118.html ...this is a step in cleaning up our fast-math-flags implementation in IR to better match the capabilities of both clang's user-visible flags and the backend's flags for SDNode. As proposed in the above threads, we're replacing the 'UnsafeAlgebra' bit (which had the 'umbrella' meaning that all flags are set) with a new bit that only applies to algebraic reassociation - 'AllowReassoc'. We're also adding a bit to allow approximations for library functions called 'ApproxFunc' (this was initially proposed as 'libm' or similar). ...and we're out of bits. 7 bits ought to be enough for anyone, right? :) FWIW, I did look at getting this out of SubclassOptionalData via SubclassData (spacious 16-bits), but that's apparently already used for other purposes. Also, I don't think we can just add a field to FPMathOperator because Operator is not intended to be instantiated. We'll defer movement of FMF to another day. We keep the 'fast' keyword. I thought about removing that, but seeing IR like this: %f.fast = fadd reassoc nnan ninf nsz arcp contract afn float %op1, %op2 ...made me think we want to keep the shortcut synonym. Finally, this change is binary incompatible with existing IR as seen in the compatibility tests. This statement: "Newer releases can ignore features from older releases, but they cannot miscompile them. For example, if nsw is ever replaced with something else, dropping it would be a valid way to upgrade the IR." ( http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility ) ...provides the flexibility we want to make this change without requiring a new IR version. Ie, we're not loosening the FP strictness of existing IR. At worst, we will fail to optimize some previously 'fast' code because it's no longer recognized as 'fast'. This should get fixed as we audit/squash all of the uses of 'isFast()'. Note: an inter-dependent clang commit to use the new API name should closely follow commit. Differential Revision: https://reviews.llvm.org/D39304 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317488 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-06[docs] Update code block for compatibility with Sphinx 1.5.1Jonas Devlieghere
It is currently not possible to build the documentation with cmake and the same version of Sphinx (1.5.1) used to generate the public facing documentation on llvm.org. When code blocks cannot be parsed by Pygments, it generates a warning which is treated as an error. In addition to being annoying and confusing for developers, this needlessly increases the bar for newcomers that want to get involved. This patch removes the language specifier from the affected block. The result is the same as when parsing fails: the block are not highlighted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317472 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02Irreducible loop metadata for more accurate block frequency under PGO.Hiroshi Yamauchi
Summary: Currently the block frequency analysis is an approximation for irreducible loops. The new irreducible loop metadata is used to annotate the irreducible loop headers with their header weights based on the PGO profile (currently this is approximated to be evenly weighted) and to help improve the accuracy of the block frequency analysis for irreducible loops. This patch is a basic support for this. Reviewers: davidxl Reviewed By: davidxl Subscribers: mehdi_amini, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D39028 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26Represent runtime preemption in the IR.Sean Fertile
Currently we do not represent runtime preemption in the IR, which has several drawbacks: 1) The semantics of GlobalValues differ depending on the object file format you are targeting (as well as the relocation-model and -fPIE value). 2) We have no way of disabling inlining of run time interposable functions, since in the IR we only know if a function is link-time interposable. Because of this llvm cannot support elf-interposition semantics. 3) In LTO builds of executables we will have extra knowledge that a symbol resolved to a local definition and can't be preemptable, but have no way to propagate that knowledge through the compiler. This patch adds preemptability specifiers to the IR with the following meaning: dso_local --> means the compiler may assume the symbol will resolve to a definition within the current linkage unit and the symbol may be accessed directly even if the definition is not within this compilation unit. dso_preemptable --> means that the compiler must assume the GlobalValue may be replaced with a definition from outside the current linkage unit at runtime. To ease transitioning dso_preemptable is treated as a 'default' in that low-level codegen will still do the same checks it did previously to see if a symbol should be accessed indirectly. Eventually when IR producers emit the specifiers on all Globalvalues we can change dso_preemptable to mean 'always access indirectly', and remove the current logic. Differential Revision: https://reviews.llvm.org/D20217 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24[LangRef] Update description of Constant ExpressionsBjorn Pettersson
Summary: When describing trunc/zext/sext/ptrtoint/inttoptr in the chapter about Constant Expressions we now simply refer to the Instruction Reference. As far as I know there are no difference when it comes to the semantics and the argument constraints. The only difference is that the syntax is slighly different for the constant expressions, regarding the use of parenthesis in constant expressions. Referring to the Instruction Reference is the same solution as already used for several other operations, such as bitcast. The main goal was to add information that vector types are allowed also in trunc/zext/sext/ptrtoint/inttoptr constant expressions. That was not explicitly mentioned earlier, and resulted in some questions in the review of https://reviews.llvm.org/D38546 Reviewers: efriedma, majnemer Reviewed By: efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39165 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-16Add !callees metadataMatthew Simpson
This patch adds a new kind of metadata that indicates the possible callees of indirect calls. Differential Revision: https://reviews.llvm.org/D37354 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315944 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28Docs: fix link to Debugger intrinsic functionsHans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13Fix a misleading phrase in the LangRefSanjoy Das
Reviewers: hfinkel, dberlin Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D37432 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313170 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05Fix RST syntax in LangRef for llvm.codeview.annotation intrinsicReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05Add llvm.codeview.annotation to implement MSVC __annotationReid Kleckner
Summary: This intrinsic represents a label with a list of associated metadata strings. It is modelled as reading and writing inaccessible memory so that it won't be removed as dead code. I think the intention is that the annotation strings should appear at most once in the debug info, so I marked it noduplicate. We are allowed to inline code with annotations as long as we strip the annotation, but that can be done later. Reviewers: majnemer Subscribers: eraman, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D36904 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-24Add ‘llvm.experimental.constrained.fma‘ Intrinsic.Wei Ding
Differential Revision: http://reviews.llvm.org/D36335 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311629 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-23Test commit.Pete Couperus
Fix instrinsic -> intrinsic typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311598 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-22Emit section information for extern variablesErich Keane
Update IR generated to retain section information for external declarations. This is related to https://reviews.llvm.org/D36487 Patch By: eandrews Differential Revision: https://reviews.llvm.org/D36712 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15[Doc] Update LangRef for new Module Flag BehaviorSteven Wu
Summary: Add the documentation for the new module flag behavior. The new ModFlagBehavior is added in r303590. Reviewers: tejohnson Reviewed By: tejohnson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36557 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-14Add strictfp attribute to prevent unwanted optimizations of libm callsAndrew Kaylor
Differential Revision: https://reviews.llvm.org/D34163 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09LangRef: Fix/improve cmpxchg wordingMatthias Braun
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Add documentation for the attribute "no-jump-tables"Sumanth Gundapaneni
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309445 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Reword sentence in LangRefAdrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309431 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Remove the obsolete offset parameter from @llvm.dbg.valueAdrian Prantl
There is no situation where this rarely-used argument cannot be substituted with a DIExpression and removing it allows us to simplify the DWARF backend. Note that this patch does not yet remove any of the newly dead code. rdar://problem/33580047 Differential Revision: https://reviews.llvm.org/D35951 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12Add element atomic memset intrinsicDaniel Neilson
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memset intrinsic. This intrinsic is essentially memset with the implementation requirement that all stores used for the assignment are done with unordered-atomic stores of a given element size. Reviewers: eli.friedman, reames, mkazantsev, skatkov Reviewed By: reames Subscribers: jfb, dschuff, sbc100, jgravelle-google, aheejin, efriedma, llvm-commits Differential Revision: https://reviews.llvm.org/D34885 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12Add element atomic memmove intrinsicDaniel Neilson
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memmove intrinsic. This intrinsic is essentially memmove with the implementation requirement that all loads/stores used for the copy are done with unordered-atomic loads/stores of a given element size. Reviewers: eli.friedman, reames, mkazantsev, skatkov Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34884 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307796 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11Enhance synchscope representationKonstantin Zhuravlyov
OpenCL 2.0 introduces the notion of memory scopes in atomic operations to global and local memory. These scopes restrict how synchronization is achieved, which can result in improved performance. This change extends existing notion of synchronization scopes in LLVM to support arbitrary scopes expressed as target-specific strings, in addition to the already defined scopes (single thread, system). The LLVM IR and MIR syntax for expressing synchronization scopes has changed to use *syncscope("<scope>")*, where <scope> can be "singlethread" (this replaces *singlethread* keyword), or a target-specific name. As before, if the scope is not specified, it defaults to CrossThread/System scope. Implementation details: - Mapping from synchronization scope name/string to synchronization scope id is stored in LLVM context; - CrossThread/System and SingleThread scopes are pre-defined to efficiently check for known scopes without comparing strings; - Synchronization scope names are stored in SYNC_SCOPE_NAMES_BLOCK in the bitcode. Differential Revision: https://reviews.llvm.org/D21723 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-02fix trivial typos in documents; NFCHiroshi Inoue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-22Define behavior of "stack-probe-size" attribute when inlining.whitequark
Also document the attribute, since "probe-stack" already is. Reviewed By: majnemer Differential Revision: https://reviews.llvm.org/D34528 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-21Add a "probe-stack" attributewhitequark
This attribute is used to ensure the guard page is triggered on stack overflow. Stack frames larger than the guard page size will generate a call to __probestack to touch each page so the guard page won't be skipped. Reviewed By: majnemer Differential Revision: https://reviews.llvm.org/D34386 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19[Doc] Fix getelementptr description about argumentsDavid Blaikie
Section "Arguments" of `getelementptr` [1] says the first argument is a type, the second argument is a pointer or a vector of pointers, and is the base address to start from. Update `getelementptr` FAQ [2] accordingly, based on discussion with David on the mailing list [3]. [1] http://llvm.org/docs/LangRef.html#getelementptr-instruction [2] http://llvm.org/docs/GetElementPtr.html [3] http://lists.llvm.org/pipermail/llvm-dev/2017-June/114294.html Patch by Wei-Ren Chen! Differential Revision: https://reviews.llvm.org/D34325 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16[Atomics] Rename and change prototype for atomic memcpy intrinsicDaniel Neilson
Summary: Background: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html This change is to alter the prototype for the atomic memcpy intrinsic. The prototype itself is being changed to more closely resemble the semantics and parameters of the llvm.memcpy intrinsic -- to ease later combination of the llvm.memcpy and atomic memcpy intrinsics. Furthermore, the name of the atomic memcpy intrinsic is being changed to make it clear that it is not a generic atomic memcpy, but specifically a memcpy is unordered atomic. Reviewers: reames, sanjoy, efriedma Reviewed By: reames Subscribers: mzolotukhin, anna, llvm-commits, skatkov Differential Revision: https://reviews.llvm.org/D33240 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15[Doc] Document prof metadata in LangRefTeresa Johnson
Summary: Points to existing documentation for branch_weights and function_entry_count, and adds an example for VP value profile metadata. Reviewers: davidxl, reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34218 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14Align definition of DW_OP_plus with DWARF spec [3/3]Florian Hahn
Summary: This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things. The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack. This is done in three stages: • The first patch (LLVM) adds support for DW_OP_plus_uconst. • The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst. • The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions. Patch by Sander de Smalen. Reviewers: echristo, pcc, aprantl Reviewed By: aprantl Subscribers: fhahn, javed.absar, aprantl, llvm-commits Differential Revision: https://reviews.llvm.org/D33894 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13Align definition of DW_OP_plus with DWARF spec [1/3]Florian Hahn
Summary: This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things. The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack. This is done in three stages: • The first patch (LLVM) adds support for DW_OP_plus_uconst. • The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst. • The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions. Patch by Sander de Smalen. Reviewers: pcc, echristo, aprantl Reviewed By: aprantl Subscribers: fhahn, aprantl, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D33892 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305304 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12Update LangRef for PR27284.Adrian Prantl
And reverse the ownership between DICompileUnit and DISubprogram. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12IR: Replace the "Linker Options" module flag with "llvm.linker.options" ↵Peter Collingbourne
named metadata. The new metadata is easier to manipulate than module flags. Differential Revision: https://reviews.llvm.org/D31349 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06[docs] Make it clear shifts yield poison when shift amount >= bitwidthNuno Lopes
Some InstCombine optimizations already rely on the result being poison rather than undef. For example, the following rewrite is wrong if undef is used: ; (1 << Y) * X -> X << Y %Op0 = shl 1, %Y %r = mul %Op0, %Op1 => %r = shl %Op1, %Y ERROR: Mismatch in values for i4 %r Example: i4 %Y = 0x8 (8, -8) i4 %Op0 = 0x0 (0) i4 %Op1 = 0x0 (0) source: 0x0 (0) target: 0x1 (1) The optimization is correct if poison is returned instead: http://rise4fun.com/Alive/ygX Differential Revision: https://reviews.llvm.org/D33654 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304780 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25Add constrained intrinsics for some libm-equivalent operationsAndrew Kaylor
Differential revision: https://reviews.llvm.org/D32319 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25Delete an obsolete paragraph in LangRef.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20[docs] Small style nits.George Burgess IV
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303486 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12[SPARC] Support 'f' and 'e' inline asm constraints.James Y Knight
Based on patch by Patrick Boettcher and Chris Dewhurst. Differential Revision: https://reviews.llvm.org/D29116 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11[IR] Allow attributes with global variablesJaved Absar
This patch extends llvm-ir to allow attributes to be set on global variables. An RFC was sent out earlier by my colleague James Molloy: http://lists.llvm.org/pipermail/cfe-dev/2017-March/053100.html A key part of that proposal was to extend LLVM-IR to carry attributes on global variables. This generic feature could be useful for multiple purposes. In our present context, it would be useful to carry user specified sections for bss/rodata/data. Reviewed by: Jonathan Roelofs, Reid Kleckner Differential Revision: https://reviews.llvm.org/D32009 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302794 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09Introduce experimental generic intrinsics for horizontal vector reductions.Amara Emerson
- This change allows targets to opt-in to using them instead of the log2 shufflevector algorithm. - The SLP and Loop vectorizers have the common code to do shuffle reductions factored out into LoopUtils, and now have a unified interface for generating reductions regardless of the preference of the target. LoopUtils now uses TTI to determine what kind of reductions the target wants to handle. - For CodeGen, basic legalization support is added. Differential Revision: https://reviews.llvm.org/D30086 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03Support arbitrary address space pointers in masked gather/scatter intrinsics.Elad Cohen
Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a non-default address space pointer we fail with a "Calling a function with a bad singature!" assertion. This patch solves this by adding the 'vector of pointers' argument as an overloaded type which will determine the address space. Differential revision: https://reviews.llvm.org/D31490 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02Typo in LangRef.rst. NFCXin Tong
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28Add speculatable function attributeMatt Arsenault
This attribute tells the optimizer that the function may be speculated. Patch by Tom Stellard git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20Fix formatting of constrained FP intrinsic documentationAndrew Kaylor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18PR32382: Fix emitting complex DWARF expressions.Adrian Prantl
The DWARF specification knows 3 kinds of non-empty simple location descriptions: 1. Register location descriptions - describe a variable in a register - consist of only a DW_OP_reg 2. Memory location descriptions - describe the address of a variable 3. Implicit location descriptions - describe the value of a variable - end with DW_OP_stack_value & friends The existing DwarfExpression code is pretty much ignorant of these restrictions. This used to not matter because we only emitted very short expressions that we happened to get right by accident. This patch makes DwarfExpression aware of the rules defined by the DWARF standard and now chooses the right kind of location description for each expression being emitted. This would have been an NFC commit (for the existing testsuite) if not for the way that clang describes captured block variables. Based on how the previous code in LLVM emitted locations, DW_OP_deref operations that should have come at the end of the expression are put at its beginning. Fixing this means changing the semantics of DIExpression, so this patch bumps the version number of DIExpression and implements a bitcode upgrade. There are two major changes in this patch: I had to fix the semantics of dbg.declare for describing function arguments. After this patch a dbg.declare always takes the *address* of a variable as the first argument, even if the argument is not an alloca. When lowering a DBG_VALUE, the decision of whether to emit a register location description or a memory location description depends on the MachineLocation — register machine locations may get promoted to memory locations based on their DIExpression. (Future) optimization passes that want to salvage implicit debug location for variables may do so by appending a DW_OP_stack_value. For example: DBG_VALUE, [RBP-8] --> DW_OP_fbreg -8 DBG_VALUE, RAX --> DW_OP_reg0 +0 DBG_VALUE, RAX, DIExpression(DW_OP_deref) --> DW_OP_reg0 +0 All testcases that were modified were regenerated from clang. I also added source-based testcases for each of these to the debuginfo-tests repository over the last week to make sure that no synchronized bugs slip in. The debuginfo-tests compile from source and run the debugger. https://bugs.llvm.org/show_bug.cgi?id=32382 <rdar://problem/31205000> Differential Revision: https://reviews.llvm.org/D31439 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13Remove more lies from the LangRef.George Burgess IV
Same change as in r300168, but for invoke instead of call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13Update the LangRef to reflect reality.George Burgess IV
At the very least, we have CallInst::setIsNoInline() for adding the noinline attribute to callsites, and I'm told alwaysinline seems to work. Thought of adding "not all attributes are guaranteed to work here". If someone thinks that would be better (or has a better way of phrasing that, etc.), happy to add it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300168 91177308-0d34-0410-b5e6-96231b3b80d8