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 106 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 254 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 392 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 505 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), getMaxForClamp(), getMinForClamp(), llvm::User::getOperand(), and X.
Referenced by expandIntrinsic().
Definition at line 122 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 518 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::User::getOperand(), llvm::numbers::inv_pi, and X.
Referenced by expandIntrinsic().
Definition at line 235 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 196 of file DXILIntrinsicExpansion.cpp.
References expandFloatDotIntrinsic(), and llvm::User::getOperand().
Definition at line 161 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 202 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 552 of file DXILIntrinsicExpansion.cpp.
References llvm::Instruction::eraseFromParent(), expandAbs(), expandAnyOrAllIntrinsic(), expandAtan2Intrinsic(), expandClampIntrinsic(), expandCrossIntrinsic(), expandDegreesIntrinsic(), expandExpIntrinsic(), expandFloatDotIntrinsic(), expandIntegerDotIntrinsic(), expandLengthIntrinsic(), expandLerpIntrinsic(), expandLog10Intrinsic(), expandLogIntrinsic(), expandNormalizeIntrinsic(), expandPowIntrinsic(), expandRadiansIntrinsic(), expandSignIntrinsic(), expandStepIntrinsic(), expandVecReduceAdd(), F, and llvm::Value::replaceAllUsesWith().
Referenced by expansionIntrinsics().
Definition at line 295 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateExtractElement(), llvm::IRBuilderBase::CreateFAdd(), llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::User::getOperand(), llvm::Type::getScalarType(), I, llvm::Type::isVectorTy(), Mul, llvm::report_fatal_error(), and X.
Referenced by expandIntrinsic().
Definition at line 321 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 349 of file DXILIntrinsicExpansion.cpp.
References expandLogIntrinsic(), llvm::numbers::ln10f, and llvm::numbers::ln2f.
Referenced by expandIntrinsic().
Definition at line 331 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 355 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 440 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 479 of file DXILIntrinsicExpansion.cpp.
References llvm::IRBuilderBase::CreateFMul(), llvm::User::getOperand(), llvm::numbers::pi, and X.
Referenced by expandIntrinsic().
Definition at line 526 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 457 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 74 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 627 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 487 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
|
static |
Definition at line 496 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 659 of file DXILIntrinsicExpansion.cpp.
DXIL Intrinsic Expansion |
Definition at line 660 of file DXILIntrinsicExpansion.cpp.
Referenced by llvm::coverage::CoverageMapping::getCoverageForExpansion().
DXIL Intrinsic false |
Definition at line 660 of file DXILIntrinsicExpansion.cpp.