Go to the documentation of this file.
14 #ifndef LLVM_TRANSFORMS_UTILS_VALUEMAPPER_H
15 #define LLVM_TRANSFORMS_UTILS_VALUEMAPPER_H
25 class GlobalIndirectSymbol;
38 virtual void anchor();
51 virtual void anchor();
104 return RemapFlags(
unsigned(LHS) |
unsigned(RHS));
180 unsigned MappingContextID = 0);
184 unsigned MappingContextID = 0);
187 unsigned MappingContextID = 0);
283 #endif // LLVM_TRANSFORMS_UTILS_VALUEMAPPER_H
void scheduleMapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix, bool IsOldCtorDtor, ArrayRef< Constant * > NewMembers, unsigned MappingContextID=0)
Metadata * MapMetadata(const Metadata *MD, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Lookup or compute a mapping for a piece of metadata.
@ RF_NullMapMissingGlobalValues
Any global values not in value map are mapped to null instead of mapping to self.
ValueMapper & operator=(ValueMapper &&)=delete
Target - Wrapper for Target specific information.
ValueMapper(ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Value * MapValue(const Value *V, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Look up or compute a value in the value map.
The instances of the Type class are immutable: once they are created, they are never changed.
MDNode * mapMDNode(const MDNode &N)
void scheduleMapGlobalInitializer(GlobalVariable &GV, Constant &Init, unsigned MappingContextID=0)
This is a class that can be implemented by clients to remap types when cloning constants and instruct...
Metadata * mapMetadata(const Metadata &MD)
unsigned registerAlternateMappingContext(ValueToValueMapTy &VM, ValueMaterializer *Materializer=nullptr)
Register an alternate mapping context.
void scheduleMapGlobalIndirectSymbol(GlobalIndirectSymbol &GIS, Constant &Target, unsigned MappingContextID=0)
@ RF_ReuseAndMutateDistinctMDs
Instruct the remapper to reuse and mutate distinct metadata (remapping them in place) instead of clon...
void scheduleRemapFunction(Function &F, unsigned MappingContextID=0)
void RemapInstruction(Instruction *I, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Convert the instruction operands from referencing the current values into those specified by VM.
virtual Value * materialize(Value *V)=0
This method can be implemented to generate a mapped Value on demand.
(vector float) vec_cmpeq(*A, *B) C
RemapFlags
These are flags that the value mapping APIs allow.
Value * mapValue(const Value &V)
@ RF_NoModuleLevelChanges
If this flag is set, the remapper knows that only local values within a function (such as an instruct...
ValueMaterializer & operator=(const ValueMaterializer &)=default
virtual ~ValueMapTypeRemapper()=default
Context for (re-)mapping values (and metadata).
void remapFunction(Function &F)
This is an important base class in LLVM.
ValueMaterializer()=default
APInt operator|(APInt a, const APInt &b)
void remapInstruction(Instruction &I)
void RemapFunction(Function &F, ValueToValueMapTy &VM, RemapFlags Flags=RF_None, ValueMapTypeRemapper *TypeMapper=nullptr, ValueMaterializer *Materializer=nullptr)
Remap the operands, metadata, arguments, and instructions of a function.
virtual Type * remapType(Type *SrcTy)=0
The client should implement this method if they want to remap types while mapping values.
~ValueMaterializer()=default
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
void addFlags(RemapFlags Flags)
Add to the current RemapFlags.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Constant * mapConstant(const Constant &C)
@ RF_IgnoreMissingLocals
If this flag is set, the remapper ignores missing function-local entries (Argument,...
This is a class that can be implemented by clients to materialize Values on demand.
LLVM Value Representation.