joker-eph wrote: The issue is that this isn't necessarily about the immediate operands: ``` %sub = subi %add, %cst %add = addi %div , %cst ``` A folder on `addi` here could replace itself with itself. https://github.com/llvm/llvm-project/pull/161145