[PATCH] D140796: [ValueTracking] Improve ComputeNumSignBits to handle Trunc

Owen Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 1 20:12:01 PST 2023


resistor added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3334
+
       break;
+    }
----------------
nikic wrote:
> return 1 here, we don't want to fall through to computeKnownBits (the ComptueNumSignBits will have already used it if possible).
I don't think that's the case? We invoked `ComputeNumSignBits` on the input to the trunc, so we haven't yet had an opportunity to use `computeKnownBits` results for the output.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140796



More information about the llvm-commits mailing list