[PATCH] D142666: [DAGCombiner] Transform ABS(X) eq/ne 0/IntMin -> X eq/ne 0/IntMIn

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 03:29:30 PST 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:11698
+        if (N0->getNumOperands() == 2 && C->getAPIntValue().isMinSignedValue())
+          if (auto *C1 = dyn_cast<ConstantSDNode>(N0->getOperand(1)))
+            if (C1->getAPIntValue().isOne())
----------------
Isn't ISD::ABS always one operand? We don't have the INT_MIN handling in the DAG node:
```
  /// ABS - Determine the unsigned absolute value of a signed integer value of
  /// the same bitwidth.
  /// Note: A value of INT_MIN will return INT_MIN, no saturation or overflow
  /// is performed.
  ABS,
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142666/new/

https://reviews.llvm.org/D142666



More information about the llvm-commits mailing list