Skip to content

Commit 786537e

Browse files
committed
[X86] Use explicit const SDValue& to avoid implicit copy in for-range across op_values(). NFC.
Fixes static analysis warning.
1 parent 124cd11 commit 786537e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52816,7 +52816,7 @@ static SDValue getInvertedVectorForFMA(SDValue V, SelectionDAG &DAG) {
5281652816
SmallVector<SDValue, 8> Ops;
5281752817
EVT VT = V.getValueType();
5281852818
EVT EltVT = VT.getVectorElementType();
52819-
for (auto Op : V->op_values()) {
52819+
for (const SDValue &Op : V->op_values()) {
5282052820
if (auto *Cst = dyn_cast<ConstantFPSDNode>(Op)) {
5282152821
Ops.push_back(DAG.getConstantFP(-Cst->getValueAPF(), SDLoc(Op), EltVT));
5282252822
} else {
@@ -52838,8 +52838,8 @@ static SDValue getInvertedVectorForFMA(SDValue V, SelectionDAG &DAG) {
5283852838
// prefer one of the values. We prefer a constant with a negative value on
5283952839
// the first place.
5284052840
// N.B. We need to skip undefs that may precede a value.
52841-
for (auto op : V->op_values()) {
52842-
if (auto *Cst = dyn_cast<ConstantFPSDNode>(op)) {
52841+
for (const SDValue &Op : V->op_values()) {
52842+
if (auto *Cst = dyn_cast<ConstantFPSDNode>(Op)) {
5284352843
if (Cst->isNegative())
5284452844
return SDValue();
5284552845
break;

0 commit comments

Comments
 (0)