[DAG] visitFREEZE - pull out Operands array. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 22 Oct 2022 19:14:56 +0000 (20:14 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 22 Oct 2022 19:14:56 +0000 (20:14 +0100)
Initial tidyup and it will make it easier to adjust additional Operands in a future patch.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 3313645..38cd6b5 100644 (file)
@@ -14161,7 +14161,8 @@ SDValue DAGCombiner::visitFREEZE(SDNode *N) {
                                   /*ConsiderFlags*/ false) &&
       N0->getNumValues() == 1 && N0->hasOneUse()) {
     SDValue MaybePoisonOperand;
-    for (SDValue Op : N0->ops()) {
+    SmallVector<SDValue> Ops(N0->op_begin(), N0->op_end());
+    for (SDValue Op : Ops) {
       if (DAG.isGuaranteedNotToBeUndefOrPoison(Op, /*PoisonOnly*/ false,
                                                /*Depth*/ 1))
         continue;