MLIR  19.0.0git
Public Types | Public Member Functions | List of all members
mlir::AliasResult Class Reference

The possible results of an alias query. More...

#include "mlir/Analysis/AliasAnalysis.h"

Public Types

enum  Kind { NoAlias = 0 , MayAlias , PartialAlias , MustAlias }
 

Public Member Functions

 AliasResult (Kind kind)
 
bool operator== (const AliasResult &other) const
 
bool operator!= (const AliasResult &other) const
 
 operator bool () const
 Allow conversion to bool to signal if there is an aliasing or not. More...
 
AliasResult merge (AliasResult other) const
 Merge this alias result with other and return a new result that represents the conservative merge of both results. More...
 
bool isNo () const
 Returns if this result indicates no possibility of aliasing. More...
 
bool isMay () const
 Returns if this result is a may alias. More...
 
bool isMust () const
 Returns if this result is a must alias. More...
 
bool isPartial () const
 Returns if this result is a partial alias. More...
 
void print (raw_ostream &os) const
 Print this alias result to the provided output stream. More...
 

Detailed Description

The possible results of an alias query.

Definition at line 26 of file AliasAnalysis.h.

Member Enumeration Documentation

◆ Kind

Enumerator
NoAlias 

The two locations do not alias at all.

This value is arranged to convert to false, while all other values
convert to true. This allows a boolean context to convert the result to
a binary flag indicating whether there is the possibility of aliasing. 
MayAlias 

The two locations may or may not alias.

This is the least precise result.

PartialAlias 

The two locations alias, but only due to a partial overlap.

MustAlias 

The two locations precisely alias each other.

Definition at line 28 of file AliasAnalysis.h.

Constructor & Destructor Documentation

◆ AliasResult()

mlir::AliasResult::AliasResult ( Kind  kind)
inline

Definition at line 44 of file AliasAnalysis.h.

Member Function Documentation

◆ isMay()

bool mlir::AliasResult::isMay ( ) const
inline

Returns if this result is a may alias.

Definition at line 62 of file AliasAnalysis.h.

References MayAlias.

Referenced by mlir::AliasAnalysis::alias().

◆ isMust()

bool mlir::AliasResult::isMust ( ) const
inline

Returns if this result is a must alias.

Definition at line 65 of file AliasAnalysis.h.

References MustAlias.

Referenced by merge().

◆ isNo()

bool mlir::AliasResult::isNo ( ) const
inline

Returns if this result indicates no possibility of aliasing.

Definition at line 59 of file AliasAnalysis.h.

References NoAlias.

◆ isPartial()

bool mlir::AliasResult::isPartial ( ) const
inline

Returns if this result is a partial alias.

Definition at line 68 of file AliasAnalysis.h.

References PartialAlias.

Referenced by merge().

◆ merge()

AliasResult AliasResult::merge ( AliasResult  other) const

Merge this alias result with other and return a new result that represents the conservative merge of both results.

If the results represent a known alias, the stronger alias is chosen (i.e. Partial+Must=Must). If the two results are conflicting, MayAlias is returned.

Definition at line 24 of file AliasAnalysis.cpp.

References isMust(), isPartial(), MayAlias, and PartialAlias.

◆ operator bool()

mlir::AliasResult::operator bool ( ) const
inlineexplicit

Allow conversion to bool to signal if there is an aliasing or not.

Definition at line 49 of file AliasAnalysis.h.

References NoAlias.

◆ operator!=()

bool mlir::AliasResult::operator!= ( const AliasResult other) const
inline

Definition at line 46 of file AliasAnalysis.h.

◆ operator==()

bool mlir::AliasResult::operator== ( const AliasResult other) const
inline

Definition at line 45 of file AliasAnalysis.h.

◆ print()

void AliasResult::print ( raw_ostream &  os) const

Print this alias result to the provided output stream.

Definition at line 34 of file AliasAnalysis.cpp.

Referenced by mlir::operator<<().


The documentation for this class was generated from the following files: