[llvm] [GlobalISel] Add G_CONCAT_VECTOR handling in computeNumSignBits (PR #142355)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 2 03:25:35 PDT 2025
================
@@ -1958,6 +1958,27 @@ unsigned GISelValueTracking::computeNumSignBits(Register R,
}
break;
}
+ case TargetOpcode::G_CONCAT_VECTORS: {
+ if (MRI.getType(MI.getOperand(0).getReg()).isScalableVector())
+ break;
+ FirstAnswer = std::numeric_limits<unsigned>::max();
+ // Determine the minimum number of sign bits across all demanded
+ // elts of the input vectors. Early out if the result is already 1.
+ unsigned NumSubVectorElts =
+ MRI.getType(MI.getOperand(1).getReg()).getNumElements();
+ unsigned NumSubVectors = MI.getNumOperands() - 1;
+ for (unsigned i = 0; (i < NumSubVectors); ++i) {
----------------
davemgreen wrote:
Can remove the brackets from `(i < NumSubVectors)`
https://github.com/llvm/llvm-project/pull/142355
More information about the llvm-commits
mailing list