[llvm] [PowerPC] improve P10 store forwarding on P7 scalar to vector (PR #102330)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 09:48:18 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 8bfa089e5bfb9f26e05b9cefa9065ca7f97406ce a6a70508836addfa5ca59ff2e510da6d96629c42 --extensions cpp -- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index d1f29a79c9..3228a89ea5 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -105,7 +105,8 @@ using namespace llvm;
 
 #define DEBUG_TYPE "ppc-lowering"
 
-static cl::opt<bool> DisableP10StoreForward("disable-p10-store-forward",
+static cl::opt<bool> DisableP10StoreForward(
+    "disable-p10-store-forward",
     cl::desc("disable P10 store forward-friendly conversion"), cl::Hidden,
     cl::init(false));
 
@@ -11503,23 +11504,21 @@ SDValue PPCTargetLowering::LowerSCALAR_TO_VECTOR(SDValue Op,
       ValVT.getSizeInBits() <= 64) {
     Val = DAG.getNode(ISD::ANY_EXTEND, dl, MVT::i64, Val);
     EVT ShiftAmountTy = getShiftAmountTy(MVT::i64, DAG.getDataLayout());
-    SDValue ShiftBy =
-        DAG.getConstant(64 - Op.getValueType().getScalarSizeInBits(),
-                        dl, ShiftAmountTy);
+    SDValue ShiftBy = DAG.getConstant(
+        64 - Op.getValueType().getScalarSizeInBits(), dl, ShiftAmountTy);
     Val = DAG.getNode(ISD::SHL, dl, MVT::i64, Val, ShiftBy);
-    SDValue Plus8 = DAG.getNode(ISD::ADD, dl, PtrVT, FIdx,
-                                DAG.getConstant(8, dl, PtrVT));
-    SDValue Store2 = DAG.getStore(DAG.getEntryNode(), dl, Val, Plus8,
-                                  MachinePointerInfo());
-    SDValue Store = DAG.getStore(Store2, dl, Val, FIdx,
-                                 MachinePointerInfo());
+    SDValue Plus8 =
+        DAG.getNode(ISD::ADD, dl, PtrVT, FIdx, DAG.getConstant(8, dl, PtrVT));
+    SDValue Store2 =
+        DAG.getStore(DAG.getEntryNode(), dl, Val, Plus8, MachinePointerInfo());
+    SDValue Store = DAG.getStore(Store2, dl, Val, FIdx, MachinePointerInfo());
     return DAG.getLoad(Op.getValueType(), dl, Store, FIdx,
                        MachinePointerInfo());
   }
 
   // Store the input value into Value#0 of the stack slot.
-  SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Val, FIdx,
-                               MachinePointerInfo());
+  SDValue Store =
+      DAG.getStore(DAG.getEntryNode(), dl, Val, FIdx, MachinePointerInfo());
   // Load it out.
   return DAG.getLoad(Op.getValueType(), dl, Store, FIdx, MachinePointerInfo());
 }

``````````

</details>


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


More information about the llvm-commits mailing list