diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
commit | 344a3780b2e33f6ca763666c380202b18aab72a3 (patch) | |
tree | f0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) | |
download | src-344a3780b2e33f6ca763666c380202b18aab72a3.tar.gz src-344a3780b2e33f6ca763666c380202b18aab72a3.zip |
Vendor import of llvm-project main 88e66fa60ae5, the last commit beforevendor/llvm-project/llvmorg-13-init-16847-g88e66fa60ae5vendor/llvm-project/llvmorg-12.0.1-rc2-0-ge7dac564cd0evendor/llvm-project/llvmorg-12.0.1-0-gfed41342a82f
the upstream release/13.x branch was created.
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 79e9d5c46c70..eaa53348028d 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -168,6 +168,8 @@ public: Instruction *visitExtractValueInst(ExtractValueInst &EV); Instruction *visitLandingPadInst(LandingPadInst &LI); Instruction *visitVAEndInst(VAEndInst &I); + Value *pushFreezeToPreventPoisonFromPropagating(FreezeInst &FI); + bool freezeDominatedUses(FreezeInst &FI); Instruction *visitFreeze(FreezeInst &I); /// Specify what to return for unhandled instructions. @@ -187,6 +189,7 @@ public: const Twine &Suffix = ""); private: + void annotateAnyAllocSite(CallBase &Call, const TargetLibraryInfo *TLI); bool shouldChangeType(unsigned FromBitWidth, unsigned ToBitWidth) const; bool shouldChangeType(Type *From, Type *To) const; Value *dyn_castNegVal(Value *V) const; @@ -338,6 +341,7 @@ private: /// \see CastInst::isEliminableCastPair Instruction::CastOps isEliminableCastPair(const CastInst *CI1, const CastInst *CI2); + Value *simplifyIntToPtrRoundTripCast(Value *Val); Value *foldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS, BinaryOperator &And); Value *foldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS, BinaryOperator &Or); @@ -349,13 +353,21 @@ private: Value *foldLogicOfFCmps(FCmpInst *LHS, FCmpInst *RHS, bool IsAnd); Value *foldAndOrOfICmpsOfAndWithPow2(ICmpInst *LHS, ICmpInst *RHS, - BinaryOperator &Logic); + Instruction *CxtI, bool IsAnd, + bool IsLogical = false); Value *matchSelectFromAndOr(Value *A, Value *B, Value *C, Value *D); Value *getSelectCondition(Value *A, Value *B); Instruction *foldIntrinsicWithOverflowCommon(IntrinsicInst *II); Instruction *foldFPSignBitOps(BinaryOperator &I); + // Optimize one of these forms: + // and i1 Op, SI / select i1 Op, i1 SI, i1 false (if IsAnd = true) + // or i1 Op, SI / select i1 Op, i1 true, i1 SI (if IsAnd = false) + // into simplier select instruction using isImpliedCondition. + Instruction *foldAndOrOfSelectUsingImpliedCond(Value *Op, SelectInst &SI, + bool IsAnd); + public: /// Inserts an instruction \p New before instruction \p Old /// @@ -415,16 +427,6 @@ public: U = NewValue; } - /// Creates a result tuple for an overflow intrinsic \p II with a given - /// \p Result and a constant \p Overflow value. - Instruction *CreateOverflowTuple(IntrinsicInst *II, Value *Result, - Constant *Overflow) { - Constant *V[] = {UndefValue::get(Result->getType()), Overflow}; - StructType *ST = cast<StructType>(II->getType()); - Constant *Struct = ConstantStruct::get(ST, V); - return InsertValueInst::Create(Struct, Result, 0); - } - /// Create and insert the idiom we use to indicate a block is unreachable /// without having to rewrite the CFG from within InstCombine. void CreateNonTerminatorUnreachable(Instruction *InsertAt) { @@ -715,10 +717,10 @@ public: Instruction *PromoteCastOfAllocation(BitCastInst &CI, AllocaInst &AI); bool mergeStoreIntoSuccessor(StoreInst &SI); - /// Given an 'or' instruction, check to see if it is part of a + /// Given an initial instruction, check to see if it is the root of a /// bswap/bitreverse idiom. If so, return the equivalent bswap/bitreverse /// intrinsic. - Instruction *matchBSwapOrBitReverse(BinaryOperator &Or, bool MatchBSwaps, + Instruction *matchBSwapOrBitReverse(Instruction &I, bool MatchBSwaps, bool MatchBitReversals); Instruction *SimplifyAnyMemTransfer(AnyMemTransferInst *MI); |