[PATCH] D47491: Expand constrained FP operations

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 12:17:00 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1133
+  const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+  ArrayRef<EVT> ValueVTs = {EltVT, MVT::Other};
+  SDValue Chain = Op.getOperand(0);
----------------
This makes an ArrayRef to a temporary std::initializer_list. This is very unsafe.

You just want

```
EVT ValuesVTs[] = {EltVT, MVT::Other};
```


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1157
+ 
+    ScalarOp = DAG.getNode(Op->getOpcode(), dl, ValueVTs, Opers);
+
----------------
Add SDValue in front of this and remove the earlier declaration.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1163
+
+  Result = DAG.getBuildVector(VT, dl, OpValues);
+  NewChain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, OpChains);
----------------
Add SDValue in front of these and remvoe the earlier declaration.


https://reviews.llvm.org/D47491





More information about the llvm-commits mailing list