diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h')
-rw-r--r-- | contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h b/contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h index 4add1631ba..cbff6d3736 100644 --- a/contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h +++ b/contrib/libs/llvm12/include/llvm/Analysis/InstructionSimplify.h @@ -33,10 +33,10 @@ // same call context of that function (and not split between caller and callee // contexts of a directly recursive call, for example). // -// Additionally, these routines can't simplify to the instructions that are not -// def-reachable, meaning we can't just scan the basic block for instructions -// to simplify to. -// +// Additionally, these routines can't simplify to the instructions that are not +// def-reachable, meaning we can't just scan the basic block for instructions +// to simplify to. +// //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H @@ -109,39 +109,39 @@ struct SimplifyQuery { // be safely used. const InstrInfoQuery IIQ; - /// Controls whether simplifications are allowed to constrain the range of - /// possible values for uses of undef. If it is false, simplifications are not - /// allowed to assume a particular value for a use of undef for example. - bool CanUseUndef = true; - + /// Controls whether simplifications are allowed to constrain the range of + /// possible values for uses of undef. If it is false, simplifications are not + /// allowed to assume a particular value for a use of undef for example. + bool CanUseUndef = true; + SimplifyQuery(const DataLayout &DL, const Instruction *CXTI = nullptr) : DL(DL), CxtI(CXTI) {} SimplifyQuery(const DataLayout &DL, const TargetLibraryInfo *TLI, const DominatorTree *DT = nullptr, AssumptionCache *AC = nullptr, - const Instruction *CXTI = nullptr, bool UseInstrInfo = true, - bool CanUseUndef = true) - : DL(DL), TLI(TLI), DT(DT), AC(AC), CxtI(CXTI), IIQ(UseInstrInfo), - CanUseUndef(CanUseUndef) {} + const Instruction *CXTI = nullptr, bool UseInstrInfo = true, + bool CanUseUndef = true) + : DL(DL), TLI(TLI), DT(DT), AC(AC), CxtI(CXTI), IIQ(UseInstrInfo), + CanUseUndef(CanUseUndef) {} SimplifyQuery getWithInstruction(Instruction *I) const { SimplifyQuery Copy(*this); Copy.CxtI = I; return Copy; } - SimplifyQuery getWithoutUndef() const { - SimplifyQuery Copy(*this); - Copy.CanUseUndef = false; - return Copy; - } - - /// If CanUseUndef is true, returns whether \p V is undef. - /// Otherwise always return false. - bool isUndefValue(Value *V) const { - if (!CanUseUndef) - return false; - return isa<UndefValue>(V); - } + SimplifyQuery getWithoutUndef() const { + SimplifyQuery Copy(*this); + Copy.CanUseUndef = false; + return Copy; + } + + /// If CanUseUndef is true, returns whether \p V is undef. + /// Otherwise always return false. + bool isUndefValue(Value *V) const { + if (!CanUseUndef) + return false; + return isa<UndefValue>(V); + } }; // NOTE: the explicit multiple argument versions of these functions are @@ -299,8 +299,8 @@ Value *SimplifyFreezeInst(Value *Op, const SimplifyQuery &Q); Value *SimplifyInstruction(Instruction *I, const SimplifyQuery &Q, OptimizationRemarkEmitter *ORE = nullptr); -/// See if V simplifies when its operand Op is replaced with RepOp. If not, -/// return null. +/// See if V simplifies when its operand Op is replaced with RepOp. If not, +/// return null. /// AllowRefinement specifies whether the simplification can be a refinement, /// or whether it needs to be strictly identical. Value *SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp, |