[llvm] [DAGCombiner] Fix ReplaceAllUsesOfValueWith mutation bug in visitFREEZE (PR #104924)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 05:55:20 PDT 2024


bjope wrote:

Not sure who knows a lot about ReplaceAllUsesOfValueWith/ReplaceAllUsesWith etc. Maybe there is some simpler way of doing this? Is it for example possible to setup a vector with "from" and "to" SDValues and use  
```
void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To,
                                  unsigned Num);
```
instead?

But then I don't know what to do about the UpdateNodeOperands fixup, and neither the "Don't replace every single UNDEF everywhere with frozen UNDEF, though." thing. So simply keeping track of the operand numbers that should be frozen seemed simpler and something I could understand myself.

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


More information about the llvm-commits mailing list