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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 10 15:42:58 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2147
+
+  Hi = DAG.getNode(ISD::ABS, dl, OpType, Tmp);
+  // Lo = Hi==abs(Hi) ? Lo : 0 - Lo;
----------------
Isn't this wrong if the value of high is 0x80000000? The absolute value of that would be 0x80000000 which would cause us to leave the low bits unchanged. But if the full value is 0x80000000_00000001 then the absolute value should be 0x7fffffff_ffffffff.


Repository:
  rL LLVM

https://reviews.llvm.org/D49837





More information about the llvm-commits mailing list