[llvm-branch-commits] [llvm] [CGData] Refactor Global Merge Functions (PR #115750)

Kyungwoo Lee via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 12 10:30:47 PST 2024


kyulee-com wrote:

> Do we know why `OpIdx` is 4 here? This is confusing to me because it looks like there is only one argument, `%5`.

The `ignoreOp` function was initially designed for use with `llvm::StructuralHashWithDifferences`, where it iterates over operands within the same instruction. In this context, `OpIdx` is always within the valid range for the specified instruction.
However, we now also utilize this function to determine if a particular operand can be ignored in certain instructions during this merge operation, as matched in the stable function summary— see  `hasValidSharedConst()`  for its use. So, there may be cases where an out-of-range index is passed from a different instruction context (although the entire function hash is matched). In this case, we should simply return false, as the target operand is not an interesting operand (that can be ignored/parameterized for merging).


https://github.com/llvm/llvm-project/pull/115750


More information about the llvm-branch-commits mailing list