diff options
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); |