LLVM 20.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/InstrTypes.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.
Classes | |
class | DXILIntrinsicExpansionLegacy |
Macros | |
#define | DEBUG_TYPE "dxil-intrinsic-expansion" |
Variables | |
DEBUG_TYPE | |
DXIL Intrinsic | Expansion |
DXIL Intrinsic | false |
#define DEBUG_TYPE "dxil-intrinsic-expansion" |
Definition at line 31 of file DXILIntrinsicExpansion.cpp.
Definition at line 105 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateSub(), llvm::ElementCount::getFixed(), getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Type::isVectorTy(), and X.
Referenced by expandIntrinsic().
|
static |
Definition at line 253 of file DXILIntrinsicExpansion.cpp.
References assert(), Cond, llvm::IRBuilderBase::CreateAnd(), llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateFCmpUNE(), llvm::IRBuilderBase::CreateICmpNE(), llvm::IRBuilderBase::CreateOr(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), I, llvm::Type::isFloatingPointTy(), llvm::Type::isVectorTy(), and X.
Referenced by expandIntrinsic().
Definition at line 365 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateAnd(), llvm::IRBuilderBase::CreateFAdd(), llvm::IRBuilderBase::CreateFCmpOEQ(), llvm::IRBuilderBase::CreateFCmpOGE(), llvm::IRBuilderBase::CreateFCmpOLT(), llvm::IRBuilderBase::CreateFDiv(), llvm::IRBuilderBase::CreateFSub(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateSelect(), llvm::CallBase::getAttributes(), llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), llvm::CallInst::isTailCall(), llvm::numbers::pi, llvm::CallBase::setAttributes(), llvm::IRBuilderBase::setFastMathFlags(), llvm::CallInst::setTailCall(), X, and Y.
Referenced by expandIntrinsic().
|
static |
Definition at line 478 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), getMaxForClamp(), getMinForClamp(), llvm::User::getOperand(), and X.
Referenced by expandIntrinsic().
Definition at line 121 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateFSub(), llvm::IRBuilderBase::CreateInsertElement(), llvm::UndefValue::get(), llvm::Value::getName(), getNumElements(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::report_fatal_error().
Referenced by expandIntrinsic().
Definition at line 491 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::User::getOperand(), llvm::numbers::inv_pi, and X.
Referenced by expandIntrinsic().
Definition at line 234 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::Type::isVectorTy(), llvm::numbers::log2ef, llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic().
Definition at line 195 of file DXILIntrinsicExpansion.cpp.
References expandFloatDotIntrinsic(), and llvm::User::getOperand().
Definition at line 160 of file DXILIntrinsicExpansion.cpp.
References A, assert(), B, llvm::IRBuilderBase::CreateIntrinsic(), llvm::Type::getScalarType(), llvm::Type::isFloatingPointTy(), llvm::Type::isVectorTy(), and llvm::report_fatal_error().
Referenced by expandFloatDotIntrinsic(), expandIntrinsic(), and expandNormalizeIntrinsic().
|
static |
Definition at line 201 of file DXILIntrinsicExpansion.cpp.
References A, assert(), B, llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateMul(), llvm::User::getOperand(), llvm::Type::getScalarType(), I, llvm::Type::isIntegerTy(), and llvm::Type::isVectorTy().
Referenced by expandIntrinsic().
Definition at line 525 of file DXILIntrinsicExpansion.cpp.
References llvm::Instruction::eraseFromParent(), expandAbs(), expandAnyOrAllIntrinsic(), expandAtan2Intrinsic(), expandClampIntrinsic(), expandCrossIntrinsic(), expandDegreesIntrinsic(), expandExpIntrinsic(), expandFloatDotIntrinsic(), expandIntegerDotIntrinsic(), expandLerpIntrinsic(), expandLog10Intrinsic(), expandLogIntrinsic(), expandNormalizeIntrinsic(), expandPowIntrinsic(), expandRadiansIntrinsic(), expandSignIntrinsic(), expandStepIntrinsic(), expandVecReduceAdd(), F, and llvm::Value::replaceAllUsesWith().
Referenced by expansionIntrinsics().
Definition at line 294 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFAdd(), llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateFSub(), llvm::User::getOperand(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 322 of file DXILIntrinsicExpansion.cpp.
References expandLogIntrinsic(), llvm::numbers::ln10f, and llvm::numbers::ln2f.
Referenced by expandIntrinsic().
Definition at line 304 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::Type::isVectorTy(), llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic(), and expandLog10Intrinsic().
Definition at line 328 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFDiv(), llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateVectorSplat(), expandFloatDotIntrinsic(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::APFloat::isZero(), llvm::report_fatal_error(), and X.
Referenced by expandIntrinsic().
Definition at line 413 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::CallBase::getAttributes(), llvm::User::getOperand(), llvm::CallInst::isTailCall(), Mul, llvm::CallInst::setTailCall(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 452 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::User::getOperand(), llvm::numbers::pi, and X.
Referenced by expandIntrinsic().
Definition at line 499 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::IRBuilderBase::CreateFCmpOLT(), llvm::IRBuilderBase::CreateICmpSLT(), llvm::IRBuilderBase::CreateSub(), llvm::IRBuilderBase::CreateZExt(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), RetTy, and X.
Referenced by expandIntrinsic().
Definition at line 430 of file DXILIntrinsicExpansion.cpp.
References Cond, llvm::IRBuilderBase::CreateFCmpOLT(), llvm::IRBuilderBase::CreateSelect(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), X, and Y.
Referenced by expandIntrinsic().
|
static |
Definition at line 73 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateFAdd(), llvm::User::getOperand(), I, llvm::Constant::isZeroValue(), and X.
Referenced by expandIntrinsic().
Definition at line 597 of file DXILIntrinsicExpansion.cpp.
References expandIntrinsic(), F, isIntrinsicExpansion(), and llvm::make_early_inc_range().
Referenced by llvm::DXILIntrinsicExpansion::run(), and DXILIntrinsicExpansionLegacy::runOnModule().
|
static |
Definition at line 460 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
|
static |
Definition at line 469 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
INITIALIZE_PASS_BEGIN | ( | DXILIntrinsicExpansionLegacy | , |
DEBUG_TYPE | , | ||
"DXIL Intrinsic Expansion" | , | ||
false | , | ||
false | |||
) |
Definition at line 44 of file DXILIntrinsicExpansion.cpp.
References F.
Referenced by expansionIntrinsics().
DEBUG_TYPE |
Definition at line 629 of file DXILIntrinsicExpansion.cpp.
DXIL Intrinsic Expansion |
Definition at line 630 of file DXILIntrinsicExpansion.cpp.
Referenced by llvm::coverage::CoverageMapping::getCoverageForExpansion().
DXIL Intrinsic false |
Definition at line 630 of file DXILIntrinsicExpansion.cpp.