[llvm] [X86] Fix potential CSE issues in commuteSelect multi-use path (PR #214092)
Timur Golubovich via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 5 06:15:23 PDT 2026
================
@@ -48594,11 +48594,13 @@ static SDValue commuteSelect(SDNode *N, SelectionDAG &DAG, const SDLoc &DL,
return DAG.getSelect(DL, LHS.getValueType(), NewCond, RHS, LHS);
// Invert the setcc for all users and commute all vselects.
- DAG.ReplaceAllUsesOfValueWith(Cond, NewCond);
- for (SDNode *User : NewCond->users()) {
+ SmallVector<SDNode *> UsersToUpdate(Cond->users());
+ for (SDNode *User : UsersToUpdate) {
----------------
timurgol007 wrote:
Yeah, this is more idiomatic, thank you
https://github.com/llvm/llvm-project/pull/214092
More information about the llvm-commits
mailing list