24 Type *Ty =
I.getType();
27 switch (
I.getOpcode()) {
28 case Instruction::FDiv:
29 case Instruction::UIToFP:
30 case Instruction::SIToFP:
31 case Instruction::FPToUI:
32 case Instruction::FPToSI:
33 Flags.DX11_1_DoubleExtensions =
true;
41 for (
const auto &
F : M)
42 for (
const auto &BB :
F)
43 for (
const auto &
I : BB)
50 OS <<
formatv(
"; Shader Flags Value: {0:x8}\n;\n", FlagVal);
53 OS <<
"; Note: shader requires additional functionality:\n";
54#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleNum, FlagName, Str) \
56 (OS << ";").indent(7) << Str << "\n";
57#include "llvm/BinaryFormat/DXContainerConstants.def"
58 OS <<
"; Note: extra DXIL module flags:\n";
59#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) \
61 (OS << ";").indent(7) << Str << "\n";
62#include "llvm/BinaryFormat/DXContainerConstants.def"
83 "DXIL Shader Flag Analysis",
true,
true)
static void updateFlags(ComputedShaderFlags &Flags, const Instruction &I)
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
The instances of the Type class are immutable: once they are created, they are never changed.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Wrapper pass for the legacy pass manager.
ComputedShaderFlags run(Module &M, ModuleAnalysisManager &AM)
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(const char *Fmt, Ts &&...Vals) -> formatv_object< decltype(std::make_tuple(support::detail::build_format_adapter(std::forward< Ts >(Vals))...))>
A special type used by analysis passes to provide an address that identifies that particular analysis...
static ComputedShaderFlags computeFlags(Module &M)
void print(raw_ostream &OS=dbgs()) const