[llvm] [AArch64] Combine SEXT_INREG(CSET) to CSETM. (PR #156429)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 2 09:31:44 PDT 2025
================
@@ -26585,6 +26585,26 @@ performSignExtendInRegCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
return DAG.getNode(SOpc, DL, N->getValueType(0), Ext);
}
+ // Sign extend of CSET -> CSETM.
+ if (Opc == AArch64ISD::CSEL &&
----------------
rj-jesus wrote:
Even if the CSEL has more uses, I think this shouldn't make things worse: it shouldn't increase the instruction count since we avoid the sign extension, and should help reduce the latency of the sign-extended result since we compute it from the CSEL operands, right? Are you concerned about some other effect that emitting both CSET and CSETM might have? (I'm happy to add the hasOneUse() check, I'm just confirming I'm not missing anything. :) )
https://github.com/llvm/llvm-project/pull/156429
More information about the llvm-commits
mailing list