[PATCH] D59506: [ValueTracking][InstSimplify] Support min/max selects in computeConstantRange()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 13:14:26 PDT 2019


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5686
+      break;
+    default:
+      break;
----------------
lebedev.ri wrote:
> No `SPF_ABS` / `SPF_[N]ABS` ?
Those wouldn't match because I'm bailing out early if I don't have a Constant operand.

However, I just found that InstructionSimplify already has handling for ABS/NABS in simplifyICmpWithAbsNabs(). I could just move that in here, save the duplicate matchSelectPattern() call, and also remove the performance concern (because we were already calling matchSelectPattern(), not it's just in a more general place...)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59506





More information about the llvm-commits mailing list