[PATCH] D47831: [DAGCombiner] Recognize more patterns for ABS

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 02:19:44 PDT 2018


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5655
+        if (ConstantSDNode *C = isConstOrConstSplat(S.getOperand(1)))
+          if (C->getAPIntValue() == OpSizeInBits - 1)
+            return DAG.getNode(ISD::ABS, SDLoc(N), VT, S0);
----------------
Brackets for clarity : (OpSizeInBits - 1)


================
Comment at: lib/Target/ARM/ARMInstrNEON.td:5399
+def : Pat<(v2i64 (abs (sub (zext (v2i32 DPR:$opA)), (zext (v2i32 DPR:$opB))))),
+          (VABDLuv2i64 DPR:$opA, DPR:$opB)>;
+
----------------
Is there existing test coverage for these?


Repository:
  rL LLVM

https://reviews.llvm.org/D47831





More information about the llvm-commits mailing list