[PATCH] D118595: [AARCH64][DAGCombine] Add combine for negation of CSEL absolute value pattern.
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 7 04:08:20 PST 2022
dmgreen added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:14699
+static bool isNegatedInteger(const SDValue &Op) {
+ return Op.getOpcode() == ISD::SUB && isNullConstant(Op.getOperand(0));
----------------
SDValues can be passed by value - they are pretty small.
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:14718
+static SDValue performNegCSelCombine(SDNode *N, SelectionDAG &DAG) {
+ if (N->getOpcode() != ISD::SUB || !isNullConstant(N->getOperand(0)))
+ return SDValue();
----------------
Could this now use: `if (!isNegatedInteger(N))`?
================
Comment at: llvm/test/CodeGen/AArch64/neg-selects.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=aarch64-none-none-eabi %s -o - | FileCheck %s
----------------
Can you pre-commit the tests and show just the differences here?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118595/new/
https://reviews.llvm.org/D118595
More information about the llvm-commits
mailing list