[llvm] [PPC] Add custom lowering for uaddo (PR #110137)

Maryam Moghadas via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 12:42:32 PDT 2024


================
@@ -11967,11 +11969,45 @@ SDValue PPCTargetLowering::LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const {
   llvm_unreachable("ERROR:Should return for all cases within swtich.");
 }
 
+SDValue PPCTargetLowering::LowerUaddo(SDValue Op, SelectionDAG &DAG) const {
+  // Default to target independent lowering if there is a logical user of the
+  // carry-bit.
+  for (SDNode *U : Op->uses()) {
+    if (U->getOpcode() == ISD::SELECT || ISD::isBitwiseLogicOp(U->getOpcode()))
+      return SDValue();
----------------
maryammo wrote:

Yes, it does not make the long long case worse, it custom lowers long long in 64 bit mode except for some cases that returns to the default lowering.

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


More information about the llvm-commits mailing list