LLVM 19.0.0git
|
#include "DXILIntrinsicExpansion.h"
#include "DirectX.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsDirectX.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Type.h"
#include "llvm/Pass.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "dxil-intrinsic-expansion" |
Functions | |
static bool | isIntrinsicExpansion (Function &F) |
static bool | expandAbs (CallInst *Orig) |
static bool | expandIntegerDot (CallInst *Orig, Intrinsic::ID DotIntrinsic) |
static bool | expandExpIntrinsic (CallInst *Orig) |
static bool | expandAnyIntrinsic (CallInst *Orig) |
static bool | expandLerpIntrinsic (CallInst *Orig) |
static bool | expandLogIntrinsic (CallInst *Orig, float LogConstVal=numbers::ln2f) |
static bool | expandLog10Intrinsic (CallInst *Orig) |
static bool | expandPowIntrinsic (CallInst *Orig) |
static Intrinsic::ID | getMaxForClamp (Type *ElemTy, Intrinsic::ID ClampIntrinsic) |
static Intrinsic::ID | getMinForClamp (Type *ElemTy, Intrinsic::ID ClampIntrinsic) |
static bool | expandClampIntrinsic (CallInst *Orig, Intrinsic::ID ClampIntrinsic) |
static bool | expandIntrinsic (Function &F, CallInst *Orig) |
static bool | expansionIntrinsics (Module &M) |
INITIALIZE_PASS_BEGIN (DXILIntrinsicExpansionLegacy, DEBUG_TYPE, "DXIL Intrinsic Expansion", false, false) INITIALIZE_PASS_END(DXILIntrinsicExpansionLegacy | |
Variables | |
DEBUG_TYPE | |
DXIL Intrinsic | Expansion |
DXIL Intrinsic | false |
#define DEBUG_TYPE "dxil-intrinsic-expansion" |
Definition at line 30 of file DXILIntrinsicExpansion.cpp.
Definition at line 52 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateSub(), llvm::Instruction::eraseFromParent(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Type::isVectorTy(), llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), and X.
Referenced by expandIntrinsic().
Definition at line 125 of file DXILIntrinsicExpansion.cpp.
References Cond, llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateFCmpUNE(), llvm::IRBuilderBase::CreateICmpNE(), llvm::IRBuilderBase::CreateOr(), llvm::Instruction::eraseFromParent(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), I, llvm::Type::isFloatingPointTy(), llvm::Type::isVectorTy(), llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), and X.
Referenced by expandIntrinsic().
|
static |
Definition at line 246 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), llvm::Instruction::eraseFromParent(), getMaxForClamp(), getMinForClamp(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), and X.
Referenced by expandIntrinsic().
Definition at line 103 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::Instruction::eraseFromParent(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::Type::isVectorTy(), llvm::numbers::log2ef, llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic().
|
static |
Definition at line 72 of file DXILIntrinsicExpansion.cpp.
References A, assert(), B, llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateMul(), llvm::Instruction::eraseFromParent(), llvm::User::getOperand(), llvm::Instruction::getParent(), I, llvm::Type::isVectorTy(), llvm::Value::replaceAllUsesWith(), and llvm::IRBuilderBase::SetInsertPoint().
Referenced by expandIntrinsic().
Definition at line 264 of file DXILIntrinsicExpansion.cpp.
References expandAbs(), expandAnyIntrinsic(), expandClampIntrinsic(), expandExpIntrinsic(), expandIntegerDot(), expandLerpIntrinsic(), expandLog10Intrinsic(), expandLogIntrinsic(), expandPowIntrinsic(), and F.
Referenced by expansionIntrinsics().
Definition at line 160 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFAdd(), llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateFSub(), llvm::Instruction::eraseFromParent(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 196 of file DXILIntrinsicExpansion.cpp.
References expandLogIntrinsic(), llvm::numbers::ln10f, and llvm::numbers::ln2f.
Referenced by expandIntrinsic().
Definition at line 174 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::Instruction::eraseFromParent(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::Type::isVectorTy(), llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic(), and expandLog10Intrinsic().
Definition at line 200 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::Instruction::eraseFromParent(), llvm::CallBase::getAttributes(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::CallInst::isTailCall(), Mul, llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), llvm::CallInst::setTailCall(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 290 of file DXILIntrinsicExpansion.cpp.
References expandIntrinsic(), F, isIntrinsicExpansion(), and llvm::make_early_inc_range().
Referenced by llvm::DXILIntrinsicExpansion::run(), and llvm::DXILIntrinsicExpansionLegacy::runOnModule().
|
static |
Definition at line 220 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::Type::getScalarType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), and llvm::Type::isVectorTy().
Referenced by expandClampIntrinsic().
|
static |
Definition at line 233 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::Type::getScalarType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), and llvm::Type::isVectorTy().
Referenced by expandClampIntrinsic().
INITIALIZE_PASS_BEGIN | ( | DXILIntrinsicExpansionLegacy | , |
DEBUG_TYPE | , | ||
"DXIL Intrinsic Expansion" | , | ||
false | , | ||
false | |||
) |
Definition at line 34 of file DXILIntrinsicExpansion.cpp.
References F.
Referenced by expansionIntrinsics().
DEBUG_TYPE |
Definition at line 322 of file DXILIntrinsicExpansion.cpp.
DXIL Intrinsic Expansion |
Definition at line 323 of file DXILIntrinsicExpansion.cpp.
Referenced by llvm::coverage::CoverageMapping::getCoverageForExpansion().
DXIL Intrinsic false |
Definition at line 323 of file DXILIntrinsicExpansion.cpp.