14#ifndef LLVM_TRANSFORMS_UTILS_SIMPLIFYLIBCALLS_H
15#define LLVM_TRANSFORMS_UTILS_SIMPLIFYLIBCALLS_H
44 bool OnlyLowerUnknownSize;
48 bool OnlyLowerUnknownSize =
false);
94 bool isFortifiedCallFoldable(
CallInst *CI,
unsigned ObjSizeOp,
95 std::optional<unsigned> SizeOp = std::nullopt,
96 std::optional<unsigned> StrOp = std::nullopt,
97 std::optional<unsigned> FlagsOp = std::nullopt);
114 bool UnsafeFPShrink =
false;
123 I->replaceAllUsesWith(With);
127 static void eraseFromParentDefault(
Instruction *
I) {
I->eraseFromParent(); }
137 replaceAllUsesWith(
I, With);
148 &replaceAllUsesWithDefault,
265 Value *Bound =
nullptr);
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
A cache of @llvm.assume calls within a function.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
This class represents a function call, abstracting a target machine's calling convention.
A parsed version of the target data layout string in and methods for querying it.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
This class implements simplifications for calls to fortified library functions (__st*cpy_chk,...
FortifiedLibCallSimplifier(const TargetLibraryInfo *TLI, bool OnlyLowerUnknownSize=false)
Value * optimizeCall(CallInst *CI, IRBuilderBase &B)
Take the given call instruction and return a more optimal value to replace the instruction with or 0 ...
Common base class shared among various IRBuilders.
LibCallSimplifier(const DataLayout &DL, const TargetLibraryInfo *TLI, DominatorTree *DT, DomConditionCache *DC, AssumptionCache *AC, OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI, function_ref< void(Instruction *, Value *)> Replacer=&replaceAllUsesWithDefault, function_ref< void(Instruction *)> Eraser=&eraseFromParentDefault)
Value * optimizeCall(CallInst *CI, IRBuilderBase &B)
optimizeCall - Take the given call instruction and return a more optimal value to replace the instruc...
A Module instance is used to store all the information related to an LLVM module.
Analysis providing profile information.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Provides information about what library functions are available for the current target.
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.