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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 13:29:59 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5686
+      break;
+    default:
+      break;
----------------
nikic wrote:
> 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...)
Sounds good (maybe new-pm will magically make it easier to cache such things?),
but i'm not sure how that would look.
How about you reverse the order of patches slightly, first do "just move that in here", 
and base this patch ontop of that new patch?


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

https://reviews.llvm.org/D59506





More information about the llvm-commits mailing list