LLVM 21.0.0git
|
#include "llvm/SandboxIR/Utils.h"
Static Public Member Functions | |
static Type * | getExpectedType (const Value *V) |
\Returns the expected type of Value V. | |
static Value * | getExpectedValue (const Instruction *I) |
\Returns the expected Value for this instruction. | |
template<typename LoadOrStoreT > | |
static Value * | getMemInstructionBase (const LoadOrStoreT *LSI) |
\Returns the base Value for load or store instruction LSI . | |
static unsigned | getNumBits (Type *Ty, const DataLayout &DL) |
\Returns the number of bits of Ty . | |
static unsigned | getNumBits (Value *V, const DataLayout &DL) |
\Returns the number of bits required to represent the operands or return value of V in DL . | |
static unsigned | getNumBits (Instruction *I) |
\Returns the number of bits required to represent the operands or return value of I . | |
static std::optional< llvm::MemoryLocation > | memoryLocationGetOrNone (const Instruction *I) |
Equivalent to MemoryLocation::getOrNone(I). | |
template<typename LoadOrStoreT > | |
static std::optional< int > | getPointerDiffInBytes (LoadOrStoreT *I0, LoadOrStoreT *I1, ScalarEvolution &SE) |
\Returns the gap between the memory locations accessed by I0 and I1 in bytes. | |
template<typename LoadOrStoreT > | |
static bool | atLowerAddress (LoadOrStoreT *I0, LoadOrStoreT *I1, ScalarEvolution &SE) |
\Returns true if I0 accesses a memory location lower than I1 . | |
static ModRefInfo | aliasAnalysisGetModRefInfo (BatchAAResults &BatchAA, const Instruction *I, const std::optional< MemoryLocation > &OptLoc) |
Equivalent to BatchAA::getModRefInfo(). | |
static bool | verifyFunction (const Function *F, raw_ostream &OS) |
Equivalent to llvm::verifyFunction(). | |
|
inlinestatic |
Equivalent to BatchAA::getModRefInfo().
Definition at line 123 of file Utils.h.
References llvm::BatchAAResults::getModRefInfo(), and I.
|
inlinestatic |
\Returns true if I0
accesses a memory location lower than I1
.
Returns false if the difference cannot be determined, if the memory locations are equal, or if I1 accesses a memory location greater than I0.
Definition at line 113 of file Utils.h.
References getPointerDiffInBytes().
Referenced by llvm::sandboxir::MemSeedBundle< LoadOrStoreT >::insert(), and llvm::sandboxir::MemSeedBundle< LoadOrStoreT >::MemSeedBundle().
\Returns the expected type of Value
V.
For most Values this is equivalent to getType, but for stores returns the stored type, rather than void, and for ReturnInsts returns the returned type.
Definition at line 32 of file Utils.h.
References getExpectedValue(), llvm::sandboxir::Value::getType(), and I.
Referenced by llvm::sandboxir::VecUtils::getCommonScalarType(), getNumBits(), llvm::sandboxir::VecUtils::getNumLanes(), llvm::sandboxir::isValidMemSeed(), llvm::sandboxir::BottomUpVec::runOnFunction(), and llvm::sandboxir::VecUtils::tryGetCommonScalarType().
|
inlinestatic |
\Returns the expected Value for this instruction.
For most instructions, this is the instruction itself, but for stores returns the stored operand, and for ReturnInstructions returns the returned value.
Definition at line 47 of file Utils.h.
References I.
Referenced by getExpectedType().
|
inlinestatic |
\Returns the base Value for load or store instruction LSI
.
Definition at line 57 of file Utils.h.
References llvm::sandboxir::Value::Ctx, llvm::sandboxir::Context::getOrCreateValue(), and llvm::getUnderlyingObject().
|
inlinestatic |
\Returns the number of bits required to represent the operands or return value of I
.
Definition at line 79 of file Utils.h.
References getExpectedType(), and I.
|
inlinestatic |
\Returns the number of bits of Ty
.
Definition at line 66 of file Utils.h.
References DL, and llvm::sandboxir::Type::LLVMTy.
Referenced by llvm::sandboxir::VecUtils::areConsecutive(), getNumBits(), llvm::sandboxir::SeedBundle::getSlice(), llvm::sandboxir::SeedBundle::insertAt(), llvm::sandboxir::BottomUpVec::runOnFunction(), llvm::sandboxir::SeedBundle::SeedBundle(), and llvm::sandboxir::SeedBundle::setUsed().
|
inlinestatic |
\Returns the number of bits required to represent the operands or return value of V
in DL
.
Definition at line 72 of file Utils.h.
References DL, getExpectedType(), and getNumBits().
|
inlinestatic |
\Returns the gap between the memory locations accessed by I0
and I1
in bytes.
Definition at line 92 of file Utils.h.
References llvm::ScalarEvolution::getContext(), llvm::Type::getInt8Ty(), llvm::getPointersDiff(), and llvm::getUnderlyingObject().
Referenced by llvm::sandboxir::VecUtils::areConsecutive(), and atLowerAddress().
|
inlinestatic |
Equivalent to MemoryLocation::getOrNone(I).
Definition at line 85 of file Utils.h.
References llvm::MemoryLocation::getOrNone(), and I.
|
inlinestatic |
Equivalent to llvm::verifyFunction().
\Returns true if the IR is broken.
Definition at line 130 of file Utils.h.
References F, OS, and llvm::verifyFunction().