1//===-- SimplifyQuery.h - Context for simplifications -----------*- C++ -*-===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9#ifndef LLVM_ANALYSIS_SIMPLIFYQUERY_H 10#define LLVM_ANALYSIS_SIMPLIFYQUERY_H 18classDomConditionCache;
20classTargetLibraryInfo;
22/// InstrInfoQuery provides an interface to query additional information for 23/// instructions like metadata or keywords like nsw, which provides conservative 24/// results if the users specified it is safe to use. 32returnI->getMetadata(KindID);
38returnOp->hasNoUnsignedWrap();
44returnOp->hasNoSignedWrap();
50return cast<PossiblyExactOperator>(
Op)->isExact();
56returnOp->hasNoSignedZeros();
61/// Evaluate query assuming this condition holds. 79// Wrapper to query additional information for instructions like metadata or 80// keywords like nsw, which provides conservative results if those cannot 84 /// Controls whether simplifications are allowed to constrain the range of 85 /// possible values for uses of undef. If it is false, simplifications are not 86 /// allowed to assume a particular value for a use of undef for example. 95constInstruction *CXTI =
nullptr,
bool UseInstrInfo =
true,
102constInstruction *CXTI =
nullptr,
bool UseInstrInfo =
true,
114 Copy.CanUseUndef =
false;
118 /// If CanUseUndef is true, returns whether \p V is undef. 119 /// Otherwise always return false. 141}
// end namespace llvm This file defines the SmallPtrSet class.
A cache of @llvm.assume calls within a function.
This class represents an Operation in the Expression.
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.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Provides information about what library functions are available for the current target.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
Evaluate query assuming this condition holds.
SmallPtrSet< Value *, 4 > AffectedValues
InstrInfoQuery provides an interface to query additional information for instructions like metadata o...
bool isExact(const BinaryOperator *Op) const
MDNode * getMetadata(const Instruction *I, unsigned KindID) const
bool hasNoSignedZeros(const InstT *Op) const
bool hasNoSignedWrap(const InstT *Op) const
bool hasNoUnsignedWrap(const InstT *Op) const
SimplifyQuery getWithoutCondContext() const
SimplifyQuery(const DataLayout &DL, const Instruction *CXTI=nullptr)
bool CanUseUndef
Controls whether simplifications are allowed to constrain the range of possible values for uses of un...
SimplifyQuery getWithCondContext(const CondContext &CC) const
SimplifyQuery getWithInstruction(const Instruction *I) const
SimplifyQuery(const DataLayout &DL, const TargetLibraryInfo *TLI, const DominatorTree *DT=nullptr, AssumptionCache *AC=nullptr, const Instruction *CXTI=nullptr, bool UseInstrInfo=true, bool CanUseUndef=true, const DomConditionCache *DC=nullptr)
bool isUndefValue(Value *V) const
If CanUseUndef is true, returns whether V is undef.
const DomConditionCache * DC
SimplifyQuery(const DataLayout &DL, const DominatorTree *DT, AssumptionCache *AC=nullptr, const Instruction *CXTI=nullptr, bool UseInstrInfo=true, bool CanUseUndef=true)
const TargetLibraryInfo * TLI
SimplifyQuery getWithoutUndef() const
SimplifyQuery getWithoutDomCondCache() const