[llvm] [AArch64][SelectionDAG] Add CodeGen support for scalar FEAT_CPA (PR #105669)
Alexander Richardson via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 10:28:42 PST 2025
================
@@ -2612,6 +2615,98 @@ SDValue DAGCombiner::foldSubToAvg(SDNode *N, const SDLoc &DL) {
return SDValue();
}
+/// Try to fold a pointer arithmetic node.
+/// This needs to be done separately from normal addition, because pointer
+/// addition is not commutative.
+/// This function was adapted from DAGCombiner::visitPTRADD() from the Morello
+/// project, which is based on CHERI.
+SDValue DAGCombiner::visitPTRADD(SDNode *N) {
+ SDValue N0 = N->getOperand(0);
+ SDValue N1 = N->getOperand(1);
+ EVT PtrVT = N0.getValueType();
+ EVT IntVT = N1.getValueType();
+ SDLoc DL(N);
+
+ // fold (ptradd und*f, y) -> und*f
----------------
arichardson wrote:
Yeah these comments should use undef and we ignore the warning.
https://github.com/llvm/llvm-project/pull/105669
More information about the llvm-commits
mailing list