[PATCH] D87034: [KnownBits] Implement accurate unsigned and signed max and min

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 01:32:07 PDT 2020


RKSimon added a comment.

In D87034#2252892 <https://reviews.llvm.org/D87034#2252892>, @foad wrote:

> In D87034#2252539 <https://reviews.llvm.org/D87034#2252539>, @RKSimon wrote:
>
>> Can you replace the implementations in SelectionDAG::computeKnownBits with these?
>
> Yes, that's the idea, and the same in GlobalISel and in ValueTracking.

Sorry, what I meant was are there any codegen test diffs if you replace SelectionDAG::computeKnownBits with this implementation?



================
Comment at: llvm/include/llvm/Support/KnownBits.h:178
+  /// value is known to be greater than or equal to Val.
+  KnownBits makeGE(APInt Val) const;
+
----------------
foad wrote:
> nikic wrote:
> > `const APInt &`?
> Could do, but then I'd need to copy it in the implementation before calling clearLowBits. I don't know which is best.
Its more common to use the const & approach


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87034



More information about the llvm-commits mailing list