LLVM 21.0.0git
Public Member Functions | List of all members
llvm::sandboxir::InstrMaps Class Reference

Maps the original instructions to the vectorized instrs and the reverse. More...

#include "llvm/Transforms/Vectorize/SandboxVectorizer/InstrMaps.h"

Public Member Functions

 InstrMaps (Context &Ctx)
 
 ~InstrMaps ()
 
ValuegetVectorForOrig (Value *Orig) const
 \Returns the vector value that we got from vectorizing Orig, or nullptr if not found.
 
std::optional< unsignedgetOrigLane (Value *Vec, Value *Orig) const
 \Returns the lane of Orig before it got vectorized into Vec, or nullopt if not found.
 
void registerVector (ArrayRef< Value * > Origs, Value *Vec)
 Update the map to reflect that Origs got vectorized into Vec.
 
void clear ()
 
void print (raw_ostream &OS) const
 
LLVM_DUMP_METHOD void dump () const
 

Detailed Description

Maps the original instructions to the vectorized instrs and the reverse.

For now an original instr can only map to a single vector.

Definition at line 27 of file InstrMaps.h.

Constructor & Destructor Documentation

◆ InstrMaps()

llvm::sandboxir::InstrMaps::InstrMaps ( Context Ctx)
inline

Definition at line 62 of file InstrMaps.h.

References I, and llvm::sandboxir::Context::registerEraseInstrCallback().

◆ ~InstrMaps()

llvm::sandboxir::InstrMaps::~InstrMaps ( )
inline

Member Function Documentation

◆ clear()

void llvm::sandboxir::InstrMaps::clear ( )
inline

◆ dump()

void llvm::sandboxir::InstrMaps::dump ( ) const

Definition at line 15 of file InstrMaps.cpp.

References llvm::dbgs(), and print().

◆ getOrigLane()

std::optional< unsigned > llvm::sandboxir::InstrMaps::getOrigLane ( Value Vec,
Value Orig 
) const
inline

\Returns the lane of Orig before it got vectorized into Vec, or nullopt if not found.

Definition at line 75 of file InstrMaps.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().

◆ getVectorForOrig()

Value * llvm::sandboxir::InstrMaps::getVectorForOrig ( Value Orig) const
inline

\Returns the vector value that we got from vectorizing Orig, or nullptr if not found.

Definition at line 69 of file InstrMaps.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().

◆ print()

void llvm::sandboxir::InstrMaps::print ( raw_ostream OS) const
inline

Definition at line 100 of file InstrMaps.h.

References OS.

Referenced by dump().

◆ registerVector()

void llvm::sandboxir::InstrMaps::registerVector ( ArrayRef< Value * >  Origs,
Value Vec 
)
inline

Update the map to reflect that Origs got vectorized into Vec.

Definition at line 86 of file InstrMaps.h.

References assert(), llvm::enumerate(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().


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