[llvm] [GlobalISel] Add computeNumSignBits for ASHR (PR #139503)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 01:46:57 PDT 2025


================
@@ -960,6 +968,64 @@ unsigned GISelValueTracking::computeNumSignBits(Register R, unsigned Depth) {
   return computeNumSignBits(R, DemandedElts, Depth);
 }
 
+std::optional<ConstantRange> GISelValueTracking::getValidShiftAmountRange(
----------------
arsenm wrote:

I mean the return type is a bit heavy if we're doing a compatibility check. I didn't realize the DAG version was more sophisticated and tried to handle the non-constant case. I usually expect the IR version to be better, but it seems to only handle the case of constant shift amounts 

https://github.com/llvm/llvm-project/pull/139503


More information about the llvm-commits mailing list