110 const llvm::SmallPtrSetImpl<Block *> ¬ForAnalysis_,
111 llvm::DenseMap<Operation *, bool> &readOnlyCache_,
113 const llvm::SmallPtrSetImpl<Value> &ConstantValues,
114 const llvm::SmallPtrSetImpl<Value> &ActiveValues,
116 : notForAnalysis(notForAnalysis_), readOnlyCache(readOnlyCache_),
118 ConstantValues(ConstantValues.begin(), ConstantValues.end()),
119 ActiveValues(ActiveValues.begin(), ActiveValues.end()) {}
133 DenseMap<Operation *, llvm::SmallPtrSet<Value, 4>>
134 ReEvaluateValueIfInactiveOp;
135 DenseMap<Value, llvm::SmallPtrSet<Value, 4>> ReEvaluateValueIfInactiveValue;
136 DenseMap<Value, llvm::SmallPtrSet<Operation *, 4>>
137 ReEvaluateOpIfInactiveValue;
139 void InsertConstantOperation(MTypeResults
const &TR, Operation *op);
140 void InsertConstantValue(MTypeResults
const &TR, Value V);
145 : notForAnalysis(Other.notForAnalysis),
147 directions(directions), ConstantOperations(Other.ConstantOperations),
148 ActiveOperations(Other.ActiveOperations),
149 ConstantValues(Other.ConstantValues), ActiveValues(Other.ActiveValues) {
151 assert(directions != 0);
152 assert((directions & Other.directions) == directions);
153 assert((directions & Other.directions) != 0);
157 void insertConstantsFrom(MTypeResults
const &TR,
159 for (
auto I : Hypothesis.ConstantOperations) {
160 InsertConstantOperation(TR, I);
162 for (
auto V : Hypothesis.ConstantValues) {
163 InsertConstantValue(TR, V);
170 insertConstantsFrom(TR, Hypothesis);
171 for (
auto I : Hypothesis.ActiveOperations) {
172 bool inserted = ActiveOperations.insert(I).second;
173 if (inserted && directions == 3) {
174 ReEvaluateOpIfInactiveValue[Orig].insert(I);
177 for (
auto V : Hypothesis.ActiveValues) {
178 bool inserted = ActiveValues.insert(V).second;
179 if (inserted && directions == 3) {
180 ReEvaluateValueIfInactiveValue[Orig].insert(V);
186 bool isFunctionArgumentConstant(mlir::CallOpInterface CI, Value val);
191 bool isValueInactiveFromOrigin(
192 MTypeResults
const &TR, Value val,
193 llvm::SmallPtrSetImpl<mlir::Value> *inactArg =
nullptr);
197 bool isOperationInactiveFromOrigin(
198 MTypeResults
const &TR, Operation *op,
199 std::optional<unsigned> resultNo = std::nullopt,
200 llvm::SmallPtrSetImpl<mlir::Value> *inactArg =
nullptr);
222 Operation **FoundInst =
nullptr);
226 bool outside =
false);
231 std::map<std::pair<bool, Value>,
bool> StoredOrReturnedCache;
236inline bool operator<(
const Value &lhs,
const Value &rhs) {
237 return lhs.getAsOpaquePointer() < rhs.getAsOpaquePointer();