LLVM API Documentation

Classes | Public Types | Public Attributes
llvm::LibCallFunctionInfo Struct Reference

#include <LibCallSemantics.h>

Collaboration diagram for llvm::LibCallFunctionInfo:
Collaboration graph
[legend]

List of all members.

Classes

struct  LocationMRInfo

Public Types

enum  { DoesOnly, DoesNot }

Public Attributes

const char * Name
 Name - This is the name of the libcall this describes.
AliasAnalysis::ModRefResult UniversalBehavior
 TODO: Constant folding function: Constant* vector -> Constant*.
enum
llvm::LibCallFunctionInfo:: { ... }  
DetailsType
const LocationMRInfoLocationDetails

Detailed Description

LibCallFunctionInfo - Each record in the array of FunctionInfo structs records the behavior of one libcall that is known by the optimizer. This captures things like the side effects of the call. Side effects are modeled both universally (in the readnone/readonly) sense, but also potentially against a set of abstract locations defined by the optimizer. This allows an optimizer to define that some libcall (e.g. sqrt) is side-effect free except that it might modify errno (thus, the call is not* universally readonly). Or it might say that the side effects are unknown other than to say that errno is not modified.

Definition at line 64 of file LibCallSemantics.h.


Member Enumeration Documentation

anonymous enum

DetailsType - Indicate the sense of the LocationDetails array. This controls how the LocationDetails array is interpreted.

Enumerator:
DoesOnly 

DoesOnly - If DetailsType is set to DoesOnly, then we know that the only* mod/ref behavior of this function is captured by the LocationDetails array. If we are trying to say that 'sqrt' can only modify errno, we'd have the {errnoloc,mod} in the LocationDetails array and have DetailsType set to DoesOnly.

DoesNot 

DoesNot - If DetailsType is set to DoesNot, then the sense of the LocationDetails array is completely inverted. This means that we *do not* know everything about the side effects of this libcall, but we do know things that the libcall cannot do. This is useful for complex functions like 'ctime' which have crazy mod/ref behavior, but are known to never read or write errno. In this case, we'd have {errnoloc,modref} in the LocationDetails array and DetailsType would be set to DoesNot, indicating that ctime does not read or write the errno location.

Definition at line 87 of file LibCallSemantics.h.


Member Data Documentation

DetailsType - Indicate the sense of the LocationDetails array. This controls how the LocationDetails array is interpreted.

LocationDetails - This is a pointer to an array of LocationMRInfo structs which indicates the behavior of the libcall w.r.t. specific locations. For example, if this libcall is known to only modify 'errno', it would have a LocationDetails array with the errno ID and 'mod' in it. See the DetailsType field for how this is interpreted.

In the "DoesOnly" case, this information is 'may' information for: there is no guarantee that the specified side effect actually does happen, just that it could. In the "DoesNot" case, this is 'must not' info.

If this pointer is null, no details are known.

Definition at line 119 of file LibCallSemantics.h.

Name - This is the name of the libcall this describes.

Definition at line 66 of file LibCallSemantics.h.

TODO: Constant folding function: Constant* vector -> Constant*.

UniversalBehavior - This captures the absolute mod/ref behavior without any specific context knowledge. For example, if the function is known to be readonly, this would be set to 'ref'. If known to be readnone, this is set to NoModRef.

Definition at line 74 of file LibCallSemantics.h.


The documentation for this struct was generated from the following file: