LLVM  14.0.0git
Public Member Functions | Static Public Member Functions | List of all members
ScalarizationResult Class Reference

Helper class to indicate whether a vector index can be safely scalarized and if a freeze needs to be inserted. More...

Public Member Functions

 ScalarizationResult (const ScalarizationResult &Other)=default
 
 ~ScalarizationResult ()
 
bool isSafe () const
 Returns true if the index can be scalarize without requiring a freeze. More...
 
bool isUnsafe () const
 Returns true if the index cannot be scalarized. More...
 
bool isSafeWithFreeze () const
 Returns true if the index can be scalarize, but requires inserting a freeze. More...
 
void discard ()
 Reset the state of Unsafe and clear ToFreze if set. More...
 
void freeze (IRBuilder<> &Builder, Instruction &UserI)
 Freeze the ToFreeze and update the use in User to use it. More...
 

Static Public Member Functions

static ScalarizationResult unsafe ()
 
static ScalarizationResult safe ()
 
static ScalarizationResult safeWithFreeze (Value *ToFreeze)
 

Detailed Description

Helper class to indicate whether a vector index can be safely scalarized and if a freeze needs to be inserted.

Definition at line 812 of file VectorCombine.cpp.

Constructor & Destructor Documentation

◆ ScalarizationResult()

ScalarizationResult::ScalarizationResult ( const ScalarizationResult Other)
default

◆ ~ScalarizationResult()

ScalarizationResult::~ScalarizationResult ( )
inline

Definition at line 823 of file VectorCombine.cpp.

References assert().

Member Function Documentation

◆ discard()

void ScalarizationResult::discard ( )
inline

Reset the state of Unsafe and clear ToFreze if set.

Definition at line 842 of file VectorCombine.cpp.

◆ freeze()

void ScalarizationResult::freeze ( IRBuilder<> &  Builder,
Instruction UserI 
)
inline

Freeze the ToFreeze and update the use in User to use it.

Definition at line 848 of file VectorCombine.cpp.

References assert(), Builder, llvm::Value::getName(), llvm::is_contained(), llvm::make_early_inc_range(), llvm::User::operands(), and llvm::Value::users().

◆ isSafe()

bool ScalarizationResult::isSafe ( ) const
inline

Returns true if the index can be scalarize without requiring a freeze.

Definition at line 834 of file VectorCombine.cpp.

◆ isSafeWithFreeze()

bool ScalarizationResult::isSafeWithFreeze ( ) const
inline

Returns true if the index can be scalarize, but requires inserting a freeze.

Definition at line 839 of file VectorCombine.cpp.

◆ isUnsafe()

bool ScalarizationResult::isUnsafe ( ) const
inline

Returns true if the index cannot be scalarized.

Definition at line 836 of file VectorCombine.cpp.

◆ safe()

static ScalarizationResult ScalarizationResult::safe ( )
inlinestatic

Definition at line 828 of file VectorCombine.cpp.

Referenced by canScalarizeAccess().

◆ safeWithFreeze()

static ScalarizationResult ScalarizationResult::safeWithFreeze ( Value ToFreeze)
inlinestatic

Definition at line 829 of file VectorCombine.cpp.

Referenced by canScalarizeAccess().

◆ unsafe()

static ScalarizationResult ScalarizationResult::unsafe ( )
inlinestatic

Definition at line 827 of file VectorCombine.cpp.

Referenced by canScalarizeAccess().


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