From ff70fe40aa64ed260aaff5f77151c3c2fb39b75a Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 6 Jul 2010 15:26:33 +0000 Subject: Note the relationship between C99 restrict and LLVM noalias, and clarify a few other things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107659 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/GetElementPtr.html | 6 ++++-- docs/LangRef.html | 13 +++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/GetElementPtr.html b/docs/GetElementPtr.html index 1bf6f43..3bf38a3 100644 --- a/docs/GetElementPtr.html +++ b/docs/GetElementPtr.html @@ -64,7 +64,8 @@

This document seeks to dispel the mystery and confusion surrounding LLVM's - GetElementPtr (GEP) instruction. Questions about the wily GEP instruction are + GetElementPtr (GEP) instruction. + Questions about the wily GEP instruction are probably the most frequently occurring questions once a developer gets down to coding with LLVM. Here we lay out the sources of confusion and show that the GEP instruction is really quite simple. @@ -653,7 +654,8 @@ idx3 = (char*) &MyVar + 8

  • Support C, C-like languages, and languages which can be conceptually lowered into C (this covers a lot).
  • Support optimizations such as those that are common in - C compilers.
  • + C compilers. In particular, GEP is a cornerstone of LLVM's + pointer aliasing model.
  • Provide a consistent method for computing addresses so that address computations don't need to be a part of load and store instructions in the IR.
  • diff --git a/docs/LangRef.html b/docs/LangRef.html index ad730de..f8a2643 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -1062,7 +1062,15 @@ declare signext i8 @returns_signed_char() The caller shares the responsibility with the callee for ensuring that these requirements are met. For further details, please see the discussion of the NoAlias response in - alias analysis. + alias analysis.
    +
    + Note that this definition of noalias is intentionally + similar to the definition of restrict in C99 for function + arguments, thought it is slightly weaker. +
    + For function return values, C99's restrict is not meaningful, + while LLVM's noalias is. +
    nocapture
    This indicates that the callee does not make any copies of the pointer @@ -2397,7 +2405,8 @@ has undefined behavior.

  • An instruction with externally visible side effects depends on the most recent preceding instruction with externally visible side effects, following - the order in the IR. (This includes volatile loads and stores.)
  • + the order in the IR. (This includes + volatile operations.)
  • An instruction control-depends on a terminator instruction -- cgit v1.1