LLVM: lib/Transforms/Utils/SimplifyLibCalls.cpp File Reference (original) (raw)
Go to the source code of this file.
| Variables | |
|---|---|
| static cl::opt< bool > | EnableUnsafeFPShrink ("enable-double-float-shrink", cl::Hidden, cl::init(false), cl::desc("Enable unsafe double to float " "shrinking for math lib calls")) |
| static cl::opt< bool > | OptimizeHotColdNew ("optimize-hot-cold-new", cl::Hidden, cl::init(false), cl::desc("Enable hot/cold operator new library calls")) |
| static cl::opt< bool > | OptimizeExistingHotColdNew ("optimize-existing-hot-cold-new", cl::Hidden, cl::init(false), cl::desc("Enable optimization of existing hot/cold operator new library calls")) |
| static cl::opt< bool > | OptimizeNoBuiltinHotColdNew ("optimize-nobuiltin-hot-cold-new-new", cl::Hidden, cl::init(false), cl::desc("Enable transformation of nobuiltin operator new library calls")) |
| static cl::opt< unsigned, false, HotColdHintParser > | ColdNewHintValue ("cold-new-hint-value", cl::Hidden, cl::init(1), cl::desc("Value to pass to hot/cold operator new for cold allocation")) |
| static cl::opt< unsigned, false, HotColdHintParser > | NotColdNewHintValue ("notcold-new-hint-value", cl::Hidden, cl::init(128), cl::desc("Value to pass to hot/cold operator new for " "notcold (warm) allocation")) |
| static cl::opt< unsigned, false, HotColdHintParser > | HotNewHintValue ("hot-new-hint-value", cl::Hidden, cl::init(254), cl::desc("Value to pass to hot/cold operator new for hot allocation")) |
| static cl::opt< unsigned, false, HotColdHintParser > | AmbiguousNewHintValue ("ambiguous-new-hint-value", cl::Hidden, cl::init(222), cl::desc("Value to pass to hot/cold operator new for ambiguous allocation")) |
◆ annotateDereferenceableBytes()
Definition at line 276 of file SimplifyLibCalls.cpp.
References llvm::CallBase::addParamAttr(), F, llvm::CallBase::getArgOperand(), llvm::CallBase::getCaller(), llvm::Value::getContext(), llvm::CallBase::getParamDereferenceableBytes(), llvm::CallBase::getParamDereferenceableOrNullBytes(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), llvm::Attribute::getWithDereferenceableBytes(), llvm::NullPointerIsDefined(), llvm::CallBase::paramHasAttr(), and llvm::CallBase::removeParamAttr().
Referenced by annotateNonNullAndDereferenceable(), and annotateNonNullNoUndefBasedOnAccess().
◆ annotateNonNullAndDereferenceable()
Definition at line 323 of file SimplifyLibCalls.cpp.
References annotateDereferenceableBytes(), annotateNonNullNoUndefBasedOnAccess(), DL, llvm::dyn_cast(), llvm::isKnownNonZero(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), Size, X, and Y.
◆ annotateNonNullNoUndefBasedOnAccess()
◆ callHasFloatingPointArgument()
◆ callHasFP128Argument()
◆ canTransformToMemCmp()
◆ convertStrToInt()
Definition at line 148 of file SimplifyLibCalls.cpp.
References B(), llvm::sampleprof::Base, llvm::CallBase::getArgOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::isAlpha(), llvm::isDigit(), llvm::isSpace(), llvm::maxIntN(), llvm::maxUIntN(), llvm::Offset, llvm::SaturatingMultiplyAdd(), and llvm::toUpper().
◆ copyFlags()
◆ createPowWithIntegerExponent()
◆ getIntToFPVal()
◆ getSqrtCall()
◆ ignoreCallingConv()
| bool ignoreCallingConv ( LibFunc Func) | static |
|---|
◆ insertSinCosCall()
Definition at line 2967 of file SimplifyLibCalls.cpp.
References assert(), B(), llvm::BasicBlock::begin(), llvm::dyn_cast(), llvm::FixedVectorType::get(), llvm::StructType::get(), llvm::Function::getAttributes(), llvm::TargetLibraryInfo::getLibFunc(), llvm::getOrInsertLibFunc(), llvm::GlobalValue::getParent(), llvm::Module::getTargetTriple(), llvm::Value::getType(), llvm::isLibFuncEmittable(), llvm::Type::isStructTy(), T, llvm::Triple::x86, and llvm::Triple::x86_64.
◆ isOnlyUsedInComparisonWithZero()
| bool isOnlyUsedInComparisonWithZero ( Value * V) | static |
|---|
◆ isOnlyUsedInEqualityComparison()
◆ isReportingError()
◆ isTrigLibCall()
◆ memChrToCharCompare()
◆ mergeAttributesAndFlags()
Definition at line 352 of file SimplifyLibCalls.cpp.
References llvm::CallBase::arg_size(), copyFlags(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::CallBase::getParamAttributes(), llvm::CallBase::getRetAttributes(), llvm::Value::getType(), I, llvm::CallBase::removeParamAttrs(), llvm::CallBase::removeRetAttrs(), and llvm::CallBase::setAttributes().
◆ optimizeBinaryDoubleFP()
◆ optimizeDoubleFP()
Shrink double -> float functions.
Definition at line 1964 of file SimplifyLibCalls.cpp.
References B(), llvm::dyn_cast(), llvm::emitBinaryFloatFnCall(), llvm::emitUnaryFloatFnCall(), llvm::StringRef::ends_with(), llvm::CallBase::getArgOperand(), llvm::Function::getAttributes(), llvm::CallBase::getCalledFunction(), llvm::Instruction::getFastMathFlags(), llvm::Instruction::getFunction(), llvm::Function::getIntrinsicID(), llvm::Value::getName(), llvm::Value::getType(), isBinary(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Function::isIntrinsic(), llvm::StringRef::size(), llvm::StringRef::starts_with(), llvm::Value::users(), and valueHasFloatPrecision().
Referenced by optimizeBinaryDoubleFP(), and optimizeUnaryDoubleFP().
◆ optimizeMemCmpConstantSize()
Definition at line 1542 of file SimplifyLibCalls.cpp.
References B(), llvm::ConstantFoldLoadFromConstPtr(), DL, llvm::dyn_cast(), llvm::IntegerType::get(), llvm::Value::getContext(), llvm::getKnownAlignment(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::isOnlyUsedInZeroEqualityComparison(), LHS, and RHS.
◆ optimizeMemCmpVarSize()
Definition at line 1500 of file SimplifyLibCalls.cpp.
References B(), DL, llvm::getConstantStringInfo(), llvm::Constant::getNullValue(), llvm::ConstantInt::getSigned(), llvm::Value::getType(), llvm::CmpInst::ICMP_ULE, LHS, RHS, Size, and llvm::StringRef::size().
◆ optimizeNaN()
◆ optimizeSymmetricCall()
Definition at line 3023 of file SimplifyLibCalls.cpp.
References B(), Call, copyFlags(), llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::PatternMatch::m_CopySign(), llvm::PatternMatch::m_FAbs(), llvm::PatternMatch::m_FNeg(), llvm::MIPatternMatch::m_OneUse(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and X.
◆ optimizeUnaryDoubleFP()
◆ replaceUnaryCall()
◆ substr()
Definition at line 366 of file SimplifyLibCalls.cpp.
Referenced by llvm::StringRef::consume_back(), llvm::StringRef::consume_back_insensitive(), llvm::StringRef::consume_front(), llvm::StringRef::consume_front_insensitive(), llvm::StringRef::drop_back(), llvm::StringRef::drop_front(), llvm::StringRef::drop_until(), llvm::StringRef::drop_while(), llvm::DWARFDataExtractor::DWARFDataExtractor(), llvm::DWARFDataExtractorBase< Relocator >::DWARFDataExtractorBase(), llvm::object::MachOObjectFile::getSectionContents(), llvm::PGOCtxProfileReader::PGOCtxProfileReader(), llvm::DXContainerYAML::PSVInfo::PSVInfo(), llvm::StringRef::rsplit(), llvm::DXContainerYAML::SignatureElement::SignatureElement(), llvm::StringRef::split(), llvm::StringRef::take_until(), and llvm::StringRef::take_while().
◆ valueHasFloatPrecision()
| Value * valueHasFloatPrecision ( Value * Val) | static |
|---|
◆ AmbiguousNewHintValue
| cl::opt< unsigned, false, HotColdHintParser > AmbiguousNewHintValue("ambiguous-new-hint-value", cl::Hidden, cl::init(222), cl::desc( "Value to pass to hot/cold operator new for ambiguous allocation")) ( "ambiguous-new-hint-value" , cl::Hidden , cl::init(222) , cl::desc( "Value to pass to hot/cold operator new for ambiguous allocation") ) | static |
|---|
◆ ColdNewHintValue
| cl::opt< unsigned, false, HotColdHintParser > ColdNewHintValue("cold-new-hint-value", cl::Hidden, cl::init(1), cl::desc("Value to pass to hot/cold operator new for cold allocation")) ( "cold-new-hint-value" , cl::Hidden , cl::init(1) , cl::desc("Value to pass to hot/cold operator new for cold allocation") ) | static |
|---|
◆ EnableUnsafeFPShrink
| cl::opt< bool > EnableUnsafeFPShrink("enable-double-float-shrink", cl::Hidden, cl::init(false), cl::desc("Enable unsafe double to float " "shrinking for math lib calls")) ( "enable-double-float-shrink" , cl::Hidden , cl::init(false) , cl::desc("Enable unsafe double to float " "shrinking for math lib calls") ) | static |
|---|
◆ HotNewHintValue
| cl::opt< unsigned, false, HotColdHintParser > HotNewHintValue("hot-new-hint-value", cl::Hidden, cl::init(254), cl::desc("Value to pass to hot/cold operator new for hot allocation")) ( "hot-new-hint-value" , cl::Hidden , cl::init(254) , cl::desc("Value to pass to hot/cold operator new for hot allocation") ) | static |
|---|
◆ NotColdNewHintValue
| cl::opt< unsigned, false, HotColdHintParser > NotColdNewHintValue("notcold-new-hint-value", cl::Hidden, cl::init(128), cl::desc("Value to pass to hot/cold operator new for " "notcold (warm) allocation")) ( "notcold-new-hint-value" , cl::Hidden , cl::init(128) , cl::desc("Value to pass to hot/cold operator new for " "notcold (warm) allocation") ) | static |
|---|
◆ OptimizeExistingHotColdNew
| cl::opt< bool > OptimizeExistingHotColdNew("optimize-existing-hot-cold-new", cl::Hidden, cl::init(false), cl::desc( "Enable optimization of existing hot/cold operator new library calls")) ( "optimize-existing-hot-cold-new" , cl::Hidden , cl::init(false) , cl::desc( "Enable optimization of existing hot/cold operator new library calls") ) | static |
|---|
◆ OptimizeHotColdNew
| cl::opt< bool > OptimizeHotColdNew("optimize-hot-cold-new", cl::Hidden, cl::init(false), cl::desc("Enable hot/cold operator new library calls")) ( "optimize-hot-cold-new" , cl::Hidden , cl::init(false) , cl::desc("Enable hot/cold operator new library calls") ) | static |
|---|
◆ OptimizeNoBuiltinHotColdNew
| cl::opt< bool > OptimizeNoBuiltinHotColdNew("optimize-nobuiltin-hot-cold-new-new", cl::Hidden, cl::init(false), cl::desc("Enable transformation of nobuiltin operator new library calls")) ( "optimize-nobuiltin-hot-cold-new-new" , cl::Hidden , cl::init(false) , cl::desc("Enable transformation of nobuiltin operator new library calls") ) | static |
|---|