Go to the documentation of this file.
21 #include "llvm/IR/IntrinsicsDirectX.h"
27 #define DEBUG_TYPE "dxil-op-lower"
34 Value *DXILOpArg =
B.getInt32(
static_cast<unsigned>(DXILOp));
39 CallInst *CI = dyn_cast<CallInst>(U);
44 Args.emplace_back(DXILOpArg);
59 #define DXIL_OP_INTRINSIC_MAP
60 #include "DXILOperation.inc"
61 #undef DXIL_OP_INTRINSIC_MAP
64 if (!
F.isDeclaration())
69 auto LowerIt = LowerMap.find(
ID);
70 if (LowerIt == LowerMap.end())
91 class DXILOpLoweringLegacy :
public ModulePass {
94 StringRef getPassName()
const override {
return "DXIL Op Lowering"; }
109 return new DXILOpLoweringLegacy();
A set of analyses that are preserved following a run of a transformation pass.
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...
static void lowerIntrinsic(dxil::OpCode DXILOp, Function &F, Module &M)
A CRTP mix-in to automatically provide informational APIs needed for passes.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
The instances of the Type class are immutable: once they are created, they are never changed.
User::op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
CallInst * createDXILOpCall(dxil::OpCode OpCode, Type *OverloadTy, llvm::iterator_range< Use * > Args)
INITIALIZE_PASS_BEGIN(DXILOpLoweringLegacy, DEBUG_TYPE, "DXIL Op Lowering", false, false) INITIALIZE_PASS_END(DXILOpLoweringLegacy
ModulePass * createDXILOpLoweringLegacyPass()
Pass to lowering LLVM intrinsic call to DXIL op function call.
static bool lowerIntrinsics(Module &M)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
Type * getOverloadTy(dxil::OpCode OpCode, FunctionType *FT, bool NoOpCodeParam)
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
A Module instance is used to store all the information related to an LLVM module.
User::op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
StringRef - Represent a constant reference to a string, i.e.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
A container for analyses that lazily runs them and caches their results.
This class represents a function call, abstracting a target machine's calling convention.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
LLVM Value Representation.
iterator_range< User::op_iterator > args()
Iteration adapter for range-for loops.