================
@@ -6608,6 +6608,24 @@ static SDValue coerceLoadedValue(SDValue LdOp, EVT
FirstVT, EVT WidenVT,
return LdOp;
}
+/// Inverse of coerceLoadedValue: pull a FirstVT-sized scalar/vector out of the
+/// widened value so it can be issued in a single atomic store.
+static SDValue coerceStoredValue(SDValue StVal, EVT FirstVT, EVT WidenVT,
+ TypeSize FirstVTWidth, SDLoc dl,
+ SelectionDAG &DAG) {
+ TypeSize WidenWidth = WidenVT.getSizeInBits();
+ if (!FirstVT.isVector()) {
+ unsigned NumElts =
+ WidenWidth.getFixedValue() / FirstVTWidth.getFixedValue();
+ EVT NewVecVT = EVT::getVectorVT(*DAG.getContext(), FirstVT, NumElts);
+ SDValue VecOp = DAG.getNode(ISD::BITCAST, dl, NewVecVT, StVal);
+ return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, FirstVT, VecOp,
----------------
RKSimon wrote:
```suggestion
return DAG.getExtractVectorElt(dl, FirstVT, VecOp, 0);
```
https://github.com/llvm/llvm-project/pull/197618
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits