[PATCH] D151421: [KnownBits] Simplify shl. NFCI.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 07:57:23 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Support/KnownBits.cpp:210-214
+    if (MinShiftAmount == BitWidth) {
+      // Always poison. Return zero because we don't like returning conflict.
+      Known.setAllZero();
+      return Known;
+    }
----------------
nikic wrote:
> Seems like pulling this out of the `isUnknown()` branch would be cleaner, as it is not specific to unknown values.
Yeah, maybe. This was a result of me trying to work out why this code is required, and it's only required in the LHS.isUnknown() case, otherwise it will naturally fall out in the wash. And since it will almost never happen in practice, I chose to keep it out of the main code path.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151421



More information about the llvm-commits mailing list