================
@@ -8992,7 +8994,12 @@ SDValue SITargetLowering::promoteUniformOpToI32(SDValue
Op,
SDValue NewVal;
if (Opc == ISD::SELECT)
NewVal = DAG.getNode(ISD::SELECT, DL, ExtTy, {Op->getOperand(0), LHS,
RHS});
- else
+ else if (Opc == ISD::UADDSAT) {
+ SDValue Sum = DAG.getNode(ISD::ADD, DL, ExtTy, LHS, RHS);
+ SDValue MaxVal = DAG.getConstant(
+ APInt::getMaxValue(OpTy.getScalarSizeInBits()).zext(32), DL, ExtTy);
+ NewVal = DAG.getNode(ISD::UMIN, DL, ExtTy, Sum, MaxVal);
----------------
gandhi56 wrote:
I could create a follow-up PR to implement a helper function to deduplicate the
current instances.
https://github.com/llvm/llvm-project/pull/210156
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits