[PATCH] D49837: [SelectionDAG][X86] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 04:56:56 PDT 2018


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1388-1390
+  case ISD::ABS:
+    ExpandIntRes_ABS(N, Lo, Hi);
+    break;
----------------
ikulagin wrote:
> lebedev.ri wrote:
> > Inconsistent with the rest.
> > Unless the final line is longer than 80-chars, make it one line?
> The code was formatted by clang-format.
> Should I reformat it like the rest?
Yes please - keep the styling consistent in cases like this (and we don't want to clang-format the whole thing as it makes blaming/diffs tricky).


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:3004
+
+    if (IsUnary) {
+      OpCode = Opc;
----------------
Shouldn't we only do this if TLI.isOperationLegalOrCustom(Opc, VT) ? That probably removes the need for some of the legalization code from this initial patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D49837





More information about the llvm-commits mailing list