| LLVM 22.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/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 32 of file DXILIntrinsicExpansion.cpp.
Definition at line 135 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), getNumElements(), llvm::User::getOperand(), llvm::ConstantVector::getSplat(), and llvm::Value::getType().
Referenced by expandIsFPClass().
Definition at line 54 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), getNumElements(), llvm::User::getOperand(), llvm::ConstantVector::getSplat(), and llvm::Value::getType().
Referenced by expandIntrinsic(), and expandIsFPClass().
Definition at line 89 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), getNumElements(), llvm::User::getOperand(), llvm::ConstantVector::getSplat(), and llvm::Value::getType().
Referenced by expandIntrinsic(), and expandIsFPClass().
Definition at line 162 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), llvm::Type::getInt16Ty(), llvm::Instruction::getModule(), getNumElements(), llvm::User::getOperand(), llvm::ConstantVector::getSplat(), and llvm::Value::getType().
Referenced by expandIsFPClass().
Definition at line 292 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::ElementCount::getFixed(), getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), and X.
Referenced by expandIntrinsic().
| 
 | static | 
Definition at line 500 of file DXILIntrinsicExpansion.cpp.
References assert(), Cond, llvm::dyn_cast(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), I, llvm::Type::isFloatingPointTy(), and X.
Referenced by expandIntrinsic().
Definition at line 610 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, and Y.
Referenced by expandIntrinsic().
Definition at line 708 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::Type::isDoubleTy(), llvm::Type::isIntegerTy(), llvm_unreachable, llvm::Lo, llvm::make_early_inc_range(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::ArrayRef< T >::size(), and llvm::Value::users().
Referenced by expandIntrinsic().
Definition at line 819 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::User::getOperand(), llvm::FunctionType::getParamType(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), I, llvm::Int32Ty, llvm::Type::isDoubleTy(), and llvm::Type::isIntegerTy().
Referenced by expandIntrinsic().
| 
 | static | 
Definition at line 937 of file DXILIntrinsicExpansion.cpp.
References getMaxForClamp(), getMinForClamp(), llvm::User::getOperand(), and X.
Referenced by expandIntrinsic().
Definition at line 308 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::PoisonValue::get(), llvm::Value::getName(), getNumElements(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::reportFatalUsageError().
Referenced by expandIntrinsic().
Definition at line 950 of file DXILIntrinsicExpansion.cpp.
References llvm::User::getOperand(), llvm::numbers::inv_pi, and X.
Referenced by expandIntrinsic().
Definition at line 426 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::numbers::log2ef, and X.
Referenced by expandIntrinsic().
Definition at line 387 of file DXILIntrinsicExpansion.cpp.
References expandFloatDotIntrinsic(), and llvm::User::getOperand().
Definition at line 346 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(), expandIntrinsic(), and expandNormalizeIntrinsic().
| 
 | static | 
Definition at line 393 of file DXILIntrinsicExpansion.cpp.
References A(), assert(), B(), llvm::dyn_cast(), llvm::User::getOperand(), llvm::Type::getScalarType(), I, llvm::Type::isIntegerTy(), and llvm::Type::isVectorTy().
Referenced by expandIntrinsic().
Definition at line 984 of file DXILIntrinsicExpansion.cpp.
References llvm::Instruction::eraseFromParent(), expand16BitIsInf(), expand16BitIsNaN(), expandAbs(), expandAnyOrAllIntrinsic(), expandAtan2Intrinsic(), expandBufferLoadIntrinsic(), expandBufferStoreIntrinsic(), expandClampIntrinsic(), expandCrossIntrinsic(), expandDegreesIntrinsic(), expandExpIntrinsic(), expandFloatDotIntrinsic(), expandIntegerDotIntrinsic(), expandIsFPClass(), expandLerpIntrinsic(), expandLog10Intrinsic(), expandLogIntrinsic(), expandNormalizeIntrinsic(), expandPowIntrinsic(), expandRadiansIntrinsic(), expandSignIntrinsic(), expandStepIntrinsic(), expandUsubSat(), expandVecReduceAdd(), F, and llvm::Value::replaceAllUsesWith().
Referenced by expansionIntrinsics().
Definition at line 445 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::reportFatalUsageError(), and T.
Referenced by expandIntrinsic().
Definition at line 541 of file DXILIntrinsicExpansion.cpp.
References llvm::User::getOperand(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 569 of file DXILIntrinsicExpansion.cpp.
References expandLogIntrinsic(), llvm::numbers::ln10f, and llvm::numbers::ln2f.
Referenced by expandIntrinsic().
Definition at line 551 of file DXILIntrinsicExpansion.cpp.
References llvm::cast(), llvm::CallBase::getAttributes(), llvm::ElementCount::getFixed(), getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::CallInst::isTailCall(), llvm::numbers::ln2f, and X.
Referenced by expandIntrinsic(), and expandLog10Intrinsic().
Definition at line 575 of file DXILIntrinsicExpansion.cpp.
References llvm::dyn_cast(), expandFloatDotIntrinsic(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::APFloat::isZero(), llvm::reportFatalUsageError(), and X.
Referenced by expandIntrinsic().
| 
 | static | 
Definition at line 658 of file DXILIntrinsicExpansion.cpp.
References llvm::CallBase::getAttributes(), llvm::User::getOperand(), llvm::CallInst::isTailCall(), Mul, X, and Y.
Referenced by expandIntrinsic().
Definition at line 700 of file DXILIntrinsicExpansion.cpp.
References llvm::User::getOperand(), llvm::numbers::pi, and X.
Referenced by expandIntrinsic().
Definition at line 958 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), and X.
Referenced by expandIntrinsic().
Definition at line 678 of file DXILIntrinsicExpansion.cpp.
References Cond, llvm::dyn_cast(), llvm::ElementCount::getFixed(), llvm::User::getOperand(), llvm::ConstantVector::getSplat(), X, and Y.
Referenced by expandIntrinsic().
Definition at line 247 of file DXILIntrinsicExpansion.cpp.
References A(), B(), llvm::CallBase::getArgOperand(), and llvm::Sub.
Referenced by expandIntrinsic().
| 
 | static | 
Definition at line 260 of file DXILIntrinsicExpansion.cpp.
References assert(), llvm::dyn_cast(), llvm::User::getOperand(), I, llvm::Constant::isZeroValue(), and X.
Referenced by expandIntrinsic().
Definition at line 1085 of file DXILIntrinsicExpansion.cpp.
References llvm::dyn_cast(), expandIntrinsic(), F, isIntrinsicExpansion(), and llvm::make_early_inc_range().
Referenced by llvm::DXILIntrinsicExpansion::run(), and DXILIntrinsicExpansionLegacy::runOnModule().
| 
 | static | 
Definition at line 919 of file DXILIntrinsicExpansion.cpp.
References assert().
Referenced by expandClampIntrinsic().
| 
 | static | 
Definition at line 928 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 198 of file DXILIntrinsicExpansion.cpp.
References F, and resourceAccessNeeds64BitExpansion().
Referenced by expansionIntrinsics().
Definition at line 45 of file DXILIntrinsicExpansion.cpp.
References llvm::Type::getScalarType(), llvm::Type::isDoubleTy(), and llvm::Type::isIntegerTy().
Referenced by isIntrinsicExpansion().
| DEBUG_TYPE | 
Definition at line 1117 of file DXILIntrinsicExpansion.cpp.
| DXIL Intrinsic Expansion | 
Definition at line 1118 of file DXILIntrinsicExpansion.cpp.
Referenced by llvm::coverage::CoverageMapping::getCoverageForExpansion().
| DXIL Intrinsic false | 
Definition at line 1118 of file DXILIntrinsicExpansion.cpp.