Merge the two given lattice values. The interesting cases are merging two FunctionSet values and a FunctionSet value with an Undefined value. For these cases, we simply union the function sets. If the size of the union is greater than the maximum functions we track, the merged value is overdefined. LLVM CVP has set overdefined if X or Y are overdefined when merging, but Custom CVP has set overdefi
| 165 | /// but Custom CVP has set overdefined when X and Y are overdefined. |
| 166 | /// Changed condition helps to keep track of more variables. |
| 167 | CVPLatticeVal MergeValues(CVPLatticeVal X, CVPLatticeVal Y) override { |
| 168 | if (X == getOverdefinedVal() && Y == getOverdefinedVal()) |
| 169 | return getOverdefinedVal(); |
| 170 | if (X == getUndefVal() && Y == getUndefVal()) |
| 171 | return getUndefVal(); |
| 172 | std::vector<Function *> Union; |
| 173 | std::set_union(X.getFunctions().begin(), X.getFunctions().end(), |
| 174 | Y.getFunctions().begin(), Y.getFunctions().end(), |
| 175 | std::back_inserter(Union), CVPLatticeVal::Compare{}); |
| 176 | if (Union.size() > MaxFunctionsPerValue) |
| 177 | return getOverdefinedVal(); |
| 178 | return CVPLatticeVal(std::move(Union)); |
| 179 | } |
| 180 | |
| 181 | /// Compute the lattice values that change as a result of executing the given |
| 182 | /// instruction. The changed values are stored in \p ChangedValues. We handle |
nothing calls this directly
no test coverage detected