|
clang 24.0.0git
|
#include "PassDetail.h"#include "TargetLowering/LowerModule.h"#include "mlir/IR/Attributes.h"#include "mlir/IR/BuiltinAttributeInterfaces.h"#include "mlir/IR/IRMapping.h"#include "mlir/IR/Location.h"#include "mlir/IR/Value.h"#include "clang/AST/ASTContext.h"#include "clang/Basic/Cuda.h"#include "clang/Basic/SourceManager.h"#include "clang/Basic/Specifiers.h"#include "clang/Basic/TargetCXXABI.h"#include "clang/Basic/TargetInfo.h"#include "clang/CIR/Dialect/Builder/CIRBaseBuilder.h"#include "clang/CIR/Dialect/IR/CIRAttrs.h"#include "clang/CIR/Dialect/IR/CIRDataLayout.h"#include "clang/CIR/Dialect/IR/CIRDialect.h"#include "clang/CIR/Dialect/IR/CIROpsEnums.h"#include "clang/CIR/Dialect/IR/CIRTypes.h"#include "clang/CIR/Dialect/Passes.h"#include "clang/CIR/Interfaces/ASTAttrInterfaces.h"#include "clang/CIR/MissingFeatures.h"#include "llvm/ADT/StringRef.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/IR/Instructions.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/Path.h"#include "llvm/Support/VersionTuple.h"#include <map>#include <memory>#include <optional>#include "clang/CIR/Dialect/Passes.h.inc"Go to the source code of this file.
Namespaces | |
| namespace | mlir |
Macros | |
| #define | GEN_PASS_DEF_LOWERINGPREPARE |
Functions | |
| static SmallString< 128 > | getTransformedFileName (mlir::ModuleOp mlirModule) |
| static mlir::Value | lowerScalarToComplexCast (mlir::MLIRContext &ctx, cir::CastOp op) |
| static mlir::Value | lowerComplexToScalarCast (mlir::MLIRContext &ctx, cir::CastOp op, cir::CastKind elemToBoolKind) |
| static mlir::Value | lowerComplexToComplexCast (mlir::MLIRContext &ctx, cir::CastOp op, cir::CastKind scalarCastKind) |
| static mlir::Value | buildComplexBinOpLibCall (LoweringPreparePass &pass, CIRBaseBuilderTy &builder, llvm::StringRef(*libFuncNameGetter)(llvm::APFloat::Semantics), mlir::Location loc, cir::ComplexType ty, mlir::Value lhsReal, mlir::Value lhsImag, mlir::Value rhsReal, mlir::Value rhsImag) |
| static llvm::StringRef | getComplexDivLibCallName (llvm::APFloat::Semantics semantics) |
| static mlir::Value | buildAlgebraicComplexDiv (CIRBaseBuilderTy &builder, mlir::Location loc, mlir::Value lhsReal, mlir::Value lhsImag, mlir::Value rhsReal, mlir::Value rhsImag) |
| static mlir::Value | buildRangeReductionComplexDiv (CIRBaseBuilderTy &builder, mlir::Location loc, mlir::Value lhsReal, mlir::Value lhsImag, mlir::Value rhsReal, mlir::Value rhsImag) |
| static mlir::Type | higherPrecisionElementTypeForComplexArithmetic (mlir::MLIRContext &context, const clang::TargetInfo &targetInfo, const clang::LangOptions &langOpts, CIRBaseBuilderTy &builder, mlir::Type elementType) |
| static mlir::Value | lowerComplexDiv (LoweringPreparePass &pass, CIRBaseBuilderTy &builder, mlir::Location loc, cir::ComplexDivOp op, mlir::Value lhsReal, mlir::Value lhsImag, mlir::Value rhsReal, mlir::Value rhsImag, mlir::MLIRContext &mlirCx, const clang::TargetInfo &targetInfo) |
| static llvm::StringRef | getComplexMulLibCallName (llvm::APFloat::Semantics semantics) |
| static mlir::Value | lowerComplexMul (LoweringPreparePass &pass, CIRBaseBuilderTy &builder, mlir::Location loc, cir::ComplexMulOp op, mlir::Value lhsReal, mlir::Value lhsImag, mlir::Value rhsReal, mlir::Value rhsImag) |
| static bool | isThreadWrapperReplaceable (const clang::TargetInfo &targetInfo) |
| static cir::GlobalLinkageKind | getThreadLocalWrapperLinkage (GlobalOp op, const clang::TargetInfo &targetInfo) |
| template<typename AttributeTy> | |
| static llvm::SmallVector< mlir::Attribute > | prepareCtorDtorAttrList (mlir::MLIRContext *context, llvm::ArrayRef< std::pair< std::string, uint32_t > > list) |
| static std::string | getPrioritySuffix (unsigned priority) |
| Compute the zero-padded priority suffix used to name priority-specific global init functions, so that the function names also sort in priority order (e.g. | |
| static void | lowerArrayDtorCtorIntoLoop (cir::CIRBaseBuilderTy &builder, const clang::TargetInfo &targetInfo, mlir::Operation *op, mlir::Type eltTy, mlir::Value addr, mlir::Value numElements, uint64_t arrayLen, bool isCtor) |
| Lower a cir.array.ctor or cir.array.dtor into a do-while loop that iterates over every element. | |
| static llvm::StringRef | getCUDAPrefix (const clang::LangOptions &langOpts) |
| static std::string | addUnderscoredPrefix (llvm::StringRef prefix, llvm::StringRef name) |
| #define GEN_PASS_DEF_LOWERINGPREPARE |
Definition at line 46 of file LoweringPrepare.cpp.
|
static |
Definition at line 2502 of file LoweringPrepare.cpp.
|
static |
Definition at line 756 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createAdd(), cir::CIRBaseBuilderTy::createComplexCreate(), cir::CIRBaseBuilderTy::createDiv(), cir::CIRBaseBuilderTy::createFAdd(), cir::CIRBaseBuilderTy::createFDiv(), cir::CIRBaseBuilderTy::createFMul(), cir::CIRBaseBuilderTy::createFSub(), cir::CIRBaseBuilderTy::createMul(), and cir::CIRBaseBuilderTy::createSub().
Referenced by lowerComplexDiv().
|
static |
Definition at line 707 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createCallOp().
Referenced by lowerComplexDiv(), and lowerComplexMul().
|
static |
Definition at line 797 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createCompare(), cir::CIRBaseBuilderTy::createComplexCreate(), cir::CIRBaseBuilderTy::createFAdd(), cir::CIRBaseBuilderTy::createFDiv(), cir::CIRBaseBuilderTy::createFMul(), cir::CIRBaseBuilderTy::createFSub(), and cir::CIRBaseBuilderTy::createYield().
Referenced by lowerComplexDiv().
|
static |
Definition at line 736 of file LoweringPrepare.cpp.
Referenced by lowerComplexDiv().
|
static |
Definition at line 1020 of file LoweringPrepare.cpp.
Referenced by lowerComplexMul().
|
static |
Definition at line 2496 of file LoweringPrepare.cpp.
|
static |
Compute the zero-padded priority suffix used to name priority-specific global init functions, so that the function names also sort in priority order (e.g.
200 -> "000200").
Definition at line 1968 of file LoweringPrepare.cpp.
|
static |
Definition at line 1576 of file LoweringPrepare.cpp.
References cir::isLinkOnceLinkage(), cir::isLocalLinkage(), isThreadWrapperReplaceable(), and cir::isWeakODRLinkage().
|
static |
Definition at line 50 of file LoweringPrepare.cpp.
References clang::isPreprocessingNumberBody().
|
static |
Definition at line 873 of file LoweringPrepare.cpp.
Referenced by lowerComplexDiv().
|
static |
Definition at line 1567 of file LoweringPrepare.cpp.
References clang::TargetInfo::getTriple().
Referenced by getThreadLocalWrapperLinkage(), and getThreadLocalWrapperLinkage().
|
static |
Lower a cir.array.ctor or cir.array.dtor into a do-while loop that iterates over every element.
For cir.array.ctor ops whose partial_dtor region is non-empty, the ctor loop is wrapped in a cir.cleanup.scope whose EH cleanup performs a reverse destruction loop using the partial dtor body.
Definition at line 2042 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createAlloca(), cir::CIRBaseBuilderTy::createCondition(), cir::CIRBaseBuilderTy::createDoWhile(), cir::CIRBaseBuilderTy::createStore(), cir::CIRBaseBuilderTy::createYield(), cir::CIRBaseBuilderTy::getAlignmentAttr(), cir::CIRBaseBuilderTy::getPointerTo(), cir::CIRBaseBuilderTy::getSignedInt(), clang::TargetInfo::getSignedSizeType(), clang::TargetInfo::getTypeWidth(), and cir::CIRBaseBuilderTy::getUnsignedInt().
|
static |
Definition at line 945 of file LoweringPrepare.cpp.
References buildAlgebraicComplexDiv(), buildComplexBinOpLibCall(), buildRangeReductionComplexDiv(), cir::CIRBaseBuilderTy::createCast(), cir::CIRBaseBuilderTy::createComplexCreate(), cir::CIRBaseBuilderTy::createComplexImag(), cir::CIRBaseBuilderTy::createComplexReal(), getComplexDivLibCallName(), and higherPrecisionElementTypeForComplexArithmetic().
|
static |
Definition at line 1039 of file LoweringPrepare.cpp.
References buildComplexBinOpLibCall(), cir::CIRBaseBuilderTy::createAdd(), cir::CIRBaseBuilderTy::createComplexCreate(), cir::CIRBaseBuilderTy::createFAdd(), cir::CIRBaseBuilderTy::createFMul(), cir::CIRBaseBuilderTy::createFSub(), cir::CIRBaseBuilderTy::createIsNaN(), cir::CIRBaseBuilderTy::createLogicalAnd(), cir::CIRBaseBuilderTy::createMul(), cir::CIRBaseBuilderTy::createSub(), cir::CIRBaseBuilderTy::createYield(), cir::MissingFeatures::fastMathFlags(), and getComplexMulLibCallName().
|
static |
Definition at line 654 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createCast(), cir::CIRBaseBuilderTy::createComplexCreate(), cir::CIRBaseBuilderTy::createComplexImag(), and cir::CIRBaseBuilderTy::createComplexReal().
|
static |
Definition at line 632 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createCast(), cir::CIRBaseBuilderTy::createComplexImag(), cir::CIRBaseBuilderTy::createComplexReal(), cir::CIRBaseBuilderTy::createLogicalOr(), and cir::CIRBaseBuilderTy::getBoolTy().
|
static |
Definition at line 622 of file LoweringPrepare.cpp.
References cir::CIRBaseBuilderTy::createComplexCreate(), and cir::CIRBaseBuilderTy::getNullValue().
|
static |
Definition at line 1860 of file LoweringPrepare.cpp.