Go to the documentation of this file.
22 ConstantInt *pConst = mdconst::extract<ConstantInt>(MDO);
39 if (DXILValidatorVersionMD)
40 M.eraseNamedMetadata(DXILValidatorVersionMD);
42 DXILValidatorVersionMD =
M.getOrInsertNamedMetadata(
ValVerKey);
44 auto &Ctx =
M.getContext();
65 for (
auto &
Key : DeadKeys) {
66 if (
M.getModuleFlag(
Key))
69 if (DeadKeySet.
empty())
73 M.getModuleFlagsMetadata(ModuleFlags);
77 for (
auto &
Flag : ModuleFlags) {
88 class DXILTranslateMetadata :
public ModulePass {
91 explicit DXILTranslateMetadata() :
ModulePass(
ID), ValidatorVer(1, 0) {}
93 StringRef getPassName()
const override {
return "DXIL Metadata Emit"; }
95 bool runOnModule(
Module &M)
override;
103 bool DXILTranslateMetadata::runOnModule(
Module &M) {
107 ValidatorVer = ValVer;
117 return new DXILTranslateMetadata();
121 "DXIL Metadata Emit",
false,
false)
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
std::pair< typename Base::iterator, bool > insert(StringRef key)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
unsigned getMajor() const
Retrieve the major version number.
unsigned getNumOperands() const
Return number of MDNode operands.
void addOperand(MDNode *M)
This is the shared class of boolean and integer constants.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
ModulePass * createDXILTranslateMetadataPass()
Pass to emit metadata for DXIL.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
bool contains(StringRef key) const
Check if the set contains the given key.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
void eraseFromParent()
Drop all references and remove the node from parent module.
Represents a version number in the form major[.minor[.subminor[.build]]].
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
const MDOperand & getOperand(unsigned I) const
This is an important class for using LLVM in a threaded context.
Optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
A Module instance is used to store all the information related to an LLVM module.
Class for arbitrary precision integers.
StringSet - A wrapper for StringMap that provides set-like functionality.
StringRef - Represent a constant reference to a string, i.e.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
static Constant * getIntegerValue(Type *Ty, const APInt &V)
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value...
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
constexpr T value_or(U &&alt) const &
Tracking metadata reference owned by Metadata.