|
LLVM 24.0.0git
|
#include "DirectX.h"#include "llvm/ADT/APInt.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/CodeGen/Passes.h"#include "llvm/IR/Constants.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/MatrixBuilder.h"#include "llvm/IR/Module.h"#include "llvm/IR/PassManager.h"#include "llvm/IR/Type.h"#include "llvm/Pass.h"#include "llvm/Support/Casting.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 34 of file DXILIntrinsicExpansion.cpp.
|
static |
Definition at line 284 of file DXILIntrinsicExpansion.cpp.
References A(), assert(), B(), llvm::APInt::getLowBitsSet(), T, and llvm::V1.
Referenced by expandMulWithOverflow().
Definition at line 137 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::Type::isHalfTy(), and llvm::Type::isVectorTy().
Referenced by expandIntrinsic(), and expandIsFPClass().
Definition at line 56 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::Type::isHalfTy(), and llvm::Type::isVectorTy().
Referenced by expandIntrinsic(), and expandIsFPClass().
Definition at line 91 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::Type::isHalfTy(), llvm::Type::isVectorTy(), and Zero.
Referenced by expandIntrinsic(), and expandIsFPClass().
Definition at line 164 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::Type::isHalfTy(), llvm::Type::isVectorTy(), and Zero.
Referenced by expandIsFPClass().
Definition at line 422 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), V, X, and Zero.
Referenced by expandIntrinsic().
Definition at line 640 of file DXILIntrinsicExpansion.cpp.
References llvm::CallBase::getAttributes(), llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), llvm::CallInst::isTailCall(), llvm::numbers::pi, llvm::CallBase::setAttributes(), llvm::CallInst::setTailCall(), X, Y, and Zero.
Referenced by expandIntrinsic().
Definition at line 764 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::sampleprof::Base, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::PoisonValue::get(), llvm::StructType::get(), llvm::VectorType::get(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Type::getStructElementType(), llvm::Value::getType(), llvm::Hi, I, llvm::isa(), llvm::Type::isDoubleTy(), llvm::Type::isIntegerTy(), llvm_unreachable, Lo, llvm::Load, llvm::make_early_inc_range(), llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::ArrayRef< T >::size(), and llvm::Instruction::users().
Referenced by expandIntrinsic().
Definition at line 879 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::sampleprof::Base, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::PoisonValue::get(), llvm::StructType::get(), llvm::VectorType::get(), llvm::ElementCount::getFixed(), llvm::CallBase::getFunctionType(), llvm::Type::getInt32Ty(), llvm::User::getOperand(), llvm::FunctionType::getParamType(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), I, llvm::isa(), llvm::Type::isDoubleTy(), llvm::Type::isIntegerTy(), and llvm::Offset.
Referenced by expandIntrinsic().
|
static |
Definition at line 1001 of file DXILIntrinsicExpansion.cpp.
References getMaxForClamp(), getMinForClamp(), llvm::User::getOperand(), and X.
Referenced by expandIntrinsic().
Definition at line 1042 of file DXILIntrinsicExpansion.cpp.
References llvm::BitWidth, llvm::StructType::get(), llvm::User::getOperand(), llvm::APInt::getSignMask(), llvm::Value::getType(), llvm::Type::getWithNewType(), and Sign.
Referenced by expandIntrinsic().
Definition at line 544 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::numbers::log2ef, llvm::CallBase::setAttributes(), llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic().
Definition at line 439 of file DXILIntrinsicExpansion.cpp.
References A(), assert(), B(), llvm::dyn_cast(), llvm::Type::getScalarType(), I, llvm::Type::isFloatingPointTy(), llvm::Type::isVectorTy(), and llvm::reportFatalUsageError().
Referenced by expandFloatDotIntrinsic().
Definition at line 478 of file DXILIntrinsicExpansion.cpp.
References A(), assert(), B(), llvm::cast(), expandFloatDotChunk(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Triple::getOSVersion(), llvm::Module::getTargetTriple(), I, and llvm::Offset.
Referenced by expandIntrinsic().
Definition at line 689 of file DXILIntrinsicExpansion.cpp.
References A(), assert(), B(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::isPowerOf2_32().
Referenced by expandIntrinsic().
|
static |
Definition at line 511 of file DXILIntrinsicExpansion.cpp.
References A(), assert(), B(), llvm::dyn_cast(), llvm::User::getOperand(), llvm::Type::getScalarType(), I, llvm::Type::isIntegerTy(), llvm::Type::isVectorTy(), and uint64_t.
Referenced by expandIntrinsic().
Definition at line 1285 of file DXILIntrinsicExpansion.cpp.
References llvm::Instruction::eraseFromParent(), expand16BitIsFinite(), expand16BitIsInf(), expand16BitIsNaN(), expandAbs(), expandAtan2Intrinsic(), expandBufferLoadIntrinsic(), expandBufferStoreIntrinsic(), expandClampIntrinsic(), expandCopySignIntrinsic(), expandExpIntrinsic(), expandFloatDotIntrinsic(), expandFunnelShiftIntrinsic(), expandIntegerDotIntrinsic(), expandIsFPClass(), expandLoadInput(), expandLog10Intrinsic(), expandLogIntrinsic(), expandMatrixMultiply(), expandMatrixTranspose(), expandMulWithOverflow(), expandPowIntrinsic(), expandQuadAll(), expandSignIntrinsic(), expandStoreOutput(), expandUsubSat(), expandVecReduceAdd(), expandVecReduceAndOr(), F, and llvm::Value::replaceAllUsesWith().
Referenced by expansionIntrinsics().
Definition at line 563 of file DXILIntrinsicExpansion.cpp.
References llvm::BitWidth, llvm::dyn_cast(), expand16BitIsFinite(), expand16BitIsInf(), expand16BitIsNaN(), expand16BitIsNormal(), F, llvm::fcFinite, llvm::fcInf, llvm::fcNan, llvm::fcNegZero, llvm::fcNormal, llvm::FixedVectorType::get(), llvm::CallBase::getArgOperand(), llvm::Type::getIntNTy(), llvm::Type::getPrimitiveSizeInBits(), llvm::APInt::getSignMask(), llvm::reportFatalUsageError(), and T.
Referenced by expandIntrinsic().
Definition at line 1232 of file DXILIntrinsicExpansion.cpp.
References llvm::dyn_cast(), llvm::PoisonValue::get(), llvm::CallBase::getArgOperand(), llvm::Type::getInt32Ty(), llvm::Type::getInt8Ty(), llvm::Instruction::getModule(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::Value::getType(), and I.
Referenced by expandIntrinsic().
Definition at line 636 of file DXILIntrinsicExpansion.cpp.
References expandLogIntrinsic(), llvm::numbers::ln10f, and llvm::numbers::ln2f.
Referenced by expandIntrinsic().
Definition at line 618 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::numbers::ln2f, llvm::CallBase::setAttributes(), llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic(), and expandLog10Intrinsic().
Definition at line 1090 of file DXILIntrinsicExpansion.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), C(), llvm::cast(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::PoisonValue::get(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), I, llvm::Type::isDoubleTy(), llvm::Type::isFloatingPointTy(), LHS, llvm::Intrinsic::not_intrinsic, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reportFatalUsageError(), and RHS.
Referenced by expandIntrinsic().
Definition at line 1179 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::CallBase::getArgOperand(), and I.
Referenced by expandIntrinsic().
Definition at line 309 of file DXILIntrinsicExpansion.cpp.
References A(), B(), createMulHighUnsigned(), llvm::PoisonValue::get(), llvm::StructType::get(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), llvm::Type::getWithNewBitWidth(), llvm::Hi, Lo, Mul, and llvm::Signed.
Referenced by expandIntrinsic().
|
static |
Definition at line 744 of file DXILIntrinsicExpansion.cpp.
References llvm::CallBase::getAttributes(), llvm::User::getOperand(), llvm::CallInst::isTailCall(), Mul, llvm::CallBase::setAttributes(), llvm::CallInst::setTailCall(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 1267 of file DXILIntrinsicExpansion.cpp.
References Cond, llvm::CallBase::getArgOperand(), and llvm::CallBase::getOperandBundlesAsDefs().
Referenced by expandIntrinsic().
Definition at line 1014 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), X, and Zero.
Referenced by expandIntrinsic().
Definition at line 1196 of file DXILIntrinsicExpansion.cpp.
References llvm::Data, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallBase::getArgOperand(), llvm::Type::getInt32Ty(), llvm::Type::getInt8Ty(), llvm::Instruction::getModule(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::Value::getType(), and I.
Referenced by expandIntrinsic().
Definition at line 268 of file DXILIntrinsicExpansion.cpp.
References A(), B(), llvm::CallBase::getArgOperand(), llvm::Sub, and Zero.
Referenced by expandIntrinsic().
|
static |
Definition at line 373 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::dyn_cast(), llvm::User::getOperand(), I, llvm::Constant::isNullValue(), uint64_t, and X.
Referenced by expandIntrinsic().
|
static |
Definition at line 405 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::cast(), llvm::CallBase::getArgOperand(), I, uint64_t, and X.
Referenced by expandIntrinsic().
Definition at line 1404 of file DXILIntrinsicExpansion.cpp.
References llvm::dyn_cast(), expandIntrinsic(), F, isIntrinsicExpansion(), and llvm::make_early_inc_range().
Referenced by llvm::DXILIntrinsicExpansionPass::run(), and DXILIntrinsicExpansionLegacy::runOnModule().
|
static |
Definition at line 983 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
|
static |
Definition at line 992 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
| INITIALIZE_PASS_BEGIN | ( | DXILIntrinsicExpansionLegacy | , |
| DEBUG_TYPE | , | ||
| "DXIL Intrinsic Expansion" | , | ||
| false | , | ||
| false | ) |
References DEBUG_TYPE.
Definition at line 208 of file DXILIntrinsicExpansion.cpp.
References F, resourceAccessNeeds64BitExpansion(), and shouldExpandFloatDotIntrinsic().
Referenced by expansionIntrinsics().
Definition at line 47 of file DXILIntrinsicExpansion.cpp.
References llvm::Type::getScalarType(), llvm::Type::isDoubleTy(), and llvm::Type::isIntegerTy().
Referenced by isIntrinsicExpansion().
Definition at line 200 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::cast(), and F.
Referenced by isIntrinsicExpansion().
| DEBUG_TYPE |
Definition at line 1436 of file DXILIntrinsicExpansion.cpp.
| DXIL Intrinsic Expansion |
Definition at line 1437 of file DXILIntrinsicExpansion.cpp.
Referenced by llvm::NVPTXTargetLowering::emitTrailingFence(), llvm::coverage::CoverageMapping::getCoverageForExpansion(), llvm::coverage::CovMapFunctionRecordV1< IntPtrT >::getCoverageMapping(), and llvm::NVPTXTargetLowering::shouldInsertFencesForAtomic().
| DXIL Intrinsic false |
Definition at line 1437 of file DXILIntrinsicExpansion.cpp.