[llvm] [AArch64][SME] Conditionally do smstart/smstop (PR #77113)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 08:59:10 PST 2024


================
@@ -4852,17 +4852,16 @@ static SDValue getSVEPredicateBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) {
   return DAG.getNode(ISD::AND, DL, VT, Reinterpret, Mask);
 }
 
-SDValue AArch64TargetLowering::getPStateSM(SelectionDAG &DAG, SDValue Chain,
-                                           SMEAttrs Attrs, SDLoc DL,
-                                           EVT VT) const {
-  if (Attrs.hasStreamingInterfaceOrBody())
+SDValue AArch64TargetLowering::getPStateSM(
+    SelectionDAG &DAG, SDValue Chain, SMEAttrs Attrs, SDLoc DL, EVT VT,
+    bool AllowStreamingCompatibleInterface) const {
----------------
sdesmalen-arm wrote:

I find this extra operand rather confusing.

It seems that `getPStateSM` has only two uses. What if you rename the function to `getRuntimePStateSM` and change the use in `LowerCall` to:
```
if (CallerAttrs.hasStreamingInterfaceOrBody())
  PStateSM = DAG.getConstant(1, DL, MVT::i64);
else if (CallerAttrs.hasNonStreamingInterface())
  PStateSM = DAG.getConstant(0, DL, MVT::i64);
else
  PStateSM = getRuntimePStateSM(DAG, Chain, DL, MVT::i64);
```
That would simplify this function a bit more.

https://github.com/llvm/llvm-project/pull/77113


More information about the llvm-commits mailing list