[llvm] [PowerPC] Fix inefficient code for __builtin_ppc_test_data_class (PR #181420)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 17 11:13:45 PST 2026


================
@@ -11360,15 +11361,30 @@ SDValue PPCTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
     unsigned CmprOpc = OpVT == MVT::f128 ? PPC::XSTSTDCQP
                                          : (OpVT == MVT::f64 ? PPC::XSTSTDCDP
                                                              : PPC::XSTSTDCSP);
-    return SDValue(
-        DAG.getMachineNode(
-            PPC::SELECT_CC_I4, dl, MVT::i32,
-            {SDValue(DAG.getMachineNode(CmprOpc, dl, MVT::i32, Op.getOperand(2),
-                                        Op.getOperand(1)),
-                     0),
-             DAG.getConstant(1, dl, MVT::i32), DAG.getConstant(0, dl, MVT::i32),
-             DAG.getTargetConstant(PPC::PRED_EQ, dl, MVT::i32)}),
-        0);
+    // Create XSTSTDCDP/XSTSTDCSP node.
----------------
lei137 wrote:

nit: would be good if we provide documentation here as to why we are doing this vs doc what we code gen we are producing.

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


More information about the llvm-commits mailing list