From b24a9f0cef88760ae9383d445541b513bcc66018 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 22 Oct 2022 20:14:56 +0100 Subject: [PATCH] [DAG] visitFREEZE - pull out Operands array. NFCI. Initial tidyup and it will make it easier to adjust additional Operands in a future patch. --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 3313645..38cd6b5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -14161,7 +14161,8 @@ SDValue DAGCombiner::visitFREEZE(SDNode *N) { /*ConsiderFlags*/ false) && N0->getNumValues() == 1 && N0->hasOneUse()) { SDValue MaybePoisonOperand; - for (SDValue Op : N0->ops()) { + SmallVector Ops(N0->op_begin(), N0->op_end()); + for (SDValue Op : Ops) { if (DAG.isGuaranteedNotToBeUndefOrPoison(Op, /*PoisonOnly*/ false, /*Depth*/ 1)) continue; -- 2.7.4