|
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 |
Recombine the lo/hi i32 pairs in I32Vec into double or i64 values.
If Result is a vector, they are inserted into it from element Base on and the updated vector is returned; otherwise the single combined scalar is returned.
Definition at line 775 of file DXILIntrinsicExpansion.cpp.
References llvm::sampleprof::Base, llvm::cast(), llvm::Value::getType(), llvm::Hi, I, and Lo.
Referenced by expandBufferLoadIntrinsic(), and expandTextureLoadIntrinsic().
|
static |
Definition at line 291 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 429 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 647 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 880 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::sampleprof::Base, combineI32Pairs(), 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::isa(), llvm::Type::isDoubleTy(), llvm::Type::isIntegerTy(), llvm_unreachable, 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 998 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::sampleprof::Base, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallBase::getFunctionType(), llvm::User::getOperand(), llvm::FunctionType::getParamType(), llvm::Type::getScalarType(), I, llvm::isa(), llvm::Type::isDoubleTy(), llvm::Type::isIntegerTy(), llvm::Offset, and splitIntoI32Pairs().
Referenced by expandIntrinsic().
|
static |
Definition at line 1075 of file DXILIntrinsicExpansion.cpp.
References getMaxForClamp(), getMinForClamp(), llvm::User::getOperand(), and X.
Referenced by expandIntrinsic().
Definition at line 1116 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 551 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 446 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 485 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 696 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 518 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 1359 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(), expandSinCosIntrinsic(), expandStoreOutput(), expandTextureLoadIntrinsic(), expandTextureStoreIntrinsic(), expandUsubSat(), expandVecReduceAdd(), expandVecReduceAndOr(), F, and llvm::Value::replaceAllUsesWith().
Referenced by expansionIntrinsics().
Definition at line 570 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 1306 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 643 of file DXILIntrinsicExpansion.cpp.
References expandLogIntrinsic(), llvm::numbers::ln10f, and llvm::numbers::ln2f.
Referenced by expandIntrinsic().
Definition at line 625 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 1164 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 1253 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::CallBase::getArgOperand(), and I.
Referenced by expandIntrinsic().
Definition at line 316 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 751 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 1341 of file DXILIntrinsicExpansion.cpp.
References Cond, llvm::CallBase::getArgOperand(), and llvm::CallBase::getOperandBundlesAsDefs().
Referenced by expandIntrinsic().
Definition at line 1088 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 859 of file DXILIntrinsicExpansion.cpp.
References llvm::PoisonValue::get(), llvm::CallBase::getArgOperand(), llvm::Instruction::getMetadata(), llvm::Value::getType(), llvm::CallInst::isTailCall(), llvm::Instruction::setMetadata(), llvm::CallInst::setTailCall(), and X.
Referenced by expandIntrinsic().
Definition at line 1270 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().
Split a 64-bit llvm.dx.resource.load.level into a load of lo/hi i32 pairs on the same texture, forwarding the coordinates, mip level and offsets.
Definition at line 963 of file DXILIntrinsicExpansion.cpp.
References llvm::CallBase::args(), assert(), combineI32Pairs(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::FixedVectorType::get(), llvm::PoisonValue::get(), llvm::Value::getType(), llvm::Load, and llvm::Value::replaceAllUsesWith().
Referenced by expandIntrinsic().
Split a 64-bit llvm.dx.resource.store.texture into a store of lo/hi i32 pairs to the same texture, forwarding the coordinates.
Definition at line 985 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::cast(), llvm::Data, llvm::Instruction::eraseFromParent(), llvm::CallBase::getArgOperand(), and splitIntoI32Pairs().
Referenced by expandIntrinsic().
Definition at line 275 of file DXILIntrinsicExpansion.cpp.
References A(), B(), llvm::CallBase::getArgOperand(), llvm::Sub, and Zero.
Referenced by expandIntrinsic().
|
static |
Definition at line 380 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 412 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::cast(), llvm::CallBase::getArgOperand(), I, uint64_t, and X.
Referenced by expandIntrinsic().
Definition at line 1489 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 1057 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
|
static |
Definition at line 1066 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().
Split the double or i64 scalar or vector Val into a vector of i32 that holds the low and high halves of each element in turn.
Definition at line 815 of file DXILIntrinsicExpansion.cpp.
References llvm::dyn_cast(), llvm::FixedVectorType::get(), llvm::PoisonValue::get(), llvm::StructType::get(), llvm::ElementCount::getFixed(), llvm::Type::getInt32Ty(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), I, and llvm::Type::isDoubleTy().
Referenced by expandBufferStoreIntrinsic(), and expandTextureStoreIntrinsic().
| DEBUG_TYPE |
Definition at line 1521 of file DXILIntrinsicExpansion.cpp.
| DXIL Intrinsic Expansion |
Definition at line 1522 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 1522 of file DXILIntrinsicExpansion.cpp.