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

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 05:40:37 PDT 2018


kparzysz marked an inline comment as done.
kparzysz 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);
----------------
RKSimon wrote:
> Brackets for clarity : (OpSizeInBits - 1)
I actually removed them for clarity (I forgot about the "sub" case)...


================
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)>;
+
----------------
RKSimon wrote:
> Is there existing test coverage for these?
test/CodeGen/ARM/neon_vabs.ll failed without those.  I think the patterns above it will no longer be triggered actually, but I didn't want to remove them.


Repository:
  rL LLVM

https://reviews.llvm.org/D47831





More information about the llvm-commits mailing list